Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

docs: patch tools docs and composio docs (#534)

Charles Packercd22669a8af7
diff --git a/letta/functions/schema_generator.py b/letta/functions/schema_generator.py
index 5ba9d2bfd..1f33d87d6 100644
--- a/letta/functions/schema_generator.py
+++ b/letta/functions/schema_generator.py
@@ -1,4 +1,5 @@
import inspect
+import warnings
from typing import Any, Dict, List, Optional, Type, Union, get_args, get_origin
from docstring_parser import parse
@@ -44,6 +45,13 @@ def type_to_json_schema_type(py_type) -> dict:
origin = get_origin(py_type)
if py_type == list or origin in (list, List):
args = get_args(py_type)
+ if len(args) == 0:
+ # is this correct
+ warnings.warn("Defaulting to string type for untyped List")
+ return {
+ "type": "array",
+ "items": {"type": "string"},
+ }
if args and inspect.isclass(args[0]) and issubclass(args[0], BaseModel):
# If it's a list of Pydantic models, return an array with the model schema as items