diff --git a/python/src/aiconfig/schema.py b/python/src/aiconfig/schema.py index 9ad44280e..d601cab31 100644 --- a/python/src/aiconfig/schema.py +++ b/python/src/aiconfig/schema.py @@ -20,6 +20,27 @@ class OutputData(BaseModel): value: str +class FunctionCallData(BaseModel): + """ + Function call data reprsenting a single function call + """ + + name: str + arguments: str + + class Config: + extra = "allow" + + +class FunctionCall(BaseModel): + """ + Standard format for data representing function call(s) + """ + + kind: Literal["function"] + value: List[FunctionCallData] + + class ExecuteResult(BaseModel): """ ExecuteResult represents the result of executing a prompt. diff --git a/typescript/types.ts b/typescript/types.ts index 7fbd908c4..86d192c10 100644 --- a/typescript/types.ts +++ b/typescript/types.ts @@ -196,6 +196,14 @@ export type ExecuteResult = { | { kind: "string" | "file_uri" | "base64"; value: string; + } + | { + kind: "function"; + value: { + name: string; + arguments: string; + [k: string]: any; + }[]; }; /** * The MIME type of the result. If not specified, the MIME type will be assumed to be plain text.