mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-30 00:29:34 +00:00
fold openai responses into the Agents API
This commit is contained in:
parent
207224a811
commit
abd6280cb8
25 changed files with 967 additions and 199 deletions
|
|
@ -478,6 +478,8 @@ class JsonSchemaGenerator:
|
|||
}
|
||||
return ret
|
||||
elif origin_type is Literal:
|
||||
if len(typing.get_args(typ)) != 1:
|
||||
print(f"Literal type {typ} has {len(typing.get_args(typ))} arguments")
|
||||
(literal_value,) = typing.get_args(typ) # unpack value of literal type
|
||||
schema = self.type_to_schema(type(literal_value))
|
||||
schema["const"] = literal_value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue