Skip to content
Snippets Groups Projects
Commit 6f4bf2e0 authored by jamescalam's avatar jamescalam
Browse files

fix: func schema string type

parent 5c3f8080
Branches
Tags
No related merge requests found
...@@ -130,12 +130,12 @@ class Utterance(BaseModel): ...@@ -130,12 +130,12 @@ class Utterance(BaseModel):
# we sort the dicts to ensure consistent order as we need this to compare # we sort the dicts to ensure consistent order as we need this to compare
# stringified function schemas accurately # stringified function schemas accurately
if self.function_schemas is not None: if self.function_schemas is not None:
function_schemas_sorted = [ function_schemas_sorted: List[str] | None = [
json.dumps(schema, sort_keys=True) json.dumps(schema, sort_keys=True)
for schema in self.function_schemas for schema in self.function_schemas
] ]
else: else:
function_schemas_sorted = [] function_schemas_sorted = None
# we must do the same for metadata # we must do the same for metadata
metadata_sorted = json.dumps(self.metadata, sort_keys=True) metadata_sorted = json.dumps(self.metadata, sort_keys=True)
return f"{self.route}: {self.utterance} | {function_schemas_sorted} | {metadata_sorted}" return f"{self.route}: {self.utterance} | {function_schemas_sorted} | {metadata_sorted}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment