Skip to content

Commit

Permalink
Add length check for enum (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 authored Nov 27, 2024
1 parent 89d36b9 commit a65fb7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lumen/ai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async def get_schema(
spec.pop("enum")
elif limit and len(spec["enum"]) > limit:
spec["enum"].append("...")
elif limit and spec["enum"][0] is None:
elif limit and len(spec["enum"]) == 1 and spec["enum"][0] is None:
spec["enum"] = [f"(unknown; truncated to {get_kwargs['limit']} rows)"]

schema = format_schema(schema)
Expand Down

0 comments on commit a65fb7a

Please sign in to comment.