From b99eb2a1d2ea3513d3905a0ec3f182d69a652366 Mon Sep 17 00:00:00 2001 From: Charlie Doern Date: Mon, 1 Dec 2025 16:13:00 -0500 Subject: [PATCH] feat: support thought_signature according to gemini docs: https://ai.google.dev/gemini-api/docs/thought-signatures thought_signature lives in the extra_content of the tool_call, add extra_content to OpenAIChatCompletionToolCall to support this Signed-off-by: Charlie Doern --- client-sdks/stainless/openapi.yml | 5 +++++ docs/static/deprecated-llama-stack-spec.yaml | 5 +++++ docs/static/experimental-llama-stack-spec.yaml | 5 +++++ docs/static/llama-stack-spec.yaml | 5 +++++ docs/static/stainless-llama-stack-spec.yaml | 5 +++++ src/llama_stack_api/inference.py | 1 + 6 files changed, 26 insertions(+) diff --git a/client-sdks/stainless/openapi.yml b/client-sdks/stainless/openapi.yml index f935afae4..b328836c9 100644 --- a/client-sdks/stainless/openapi.yml +++ b/client-sdks/stainless/openapi.yml @@ -4228,6 +4228,11 @@ components: title: OpenAIChatCompletionToolCallFunction - type: 'null' title: OpenAIChatCompletionToolCallFunction + extra_content: + anyOf: + - additionalProperties: true + type: object + - type: 'null' type: object title: OpenAIChatCompletionToolCall description: Tool call specification for OpenAI-compatible chat completion responses. diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index c6271bc63..804e44d8c 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -1071,6 +1071,11 @@ components: title: OpenAIChatCompletionToolCallFunction - type: 'null' title: OpenAIChatCompletionToolCallFunction + extra_content: + anyOf: + - additionalProperties: true + type: object + - type: 'null' type: object title: OpenAIChatCompletionToolCall description: Tool call specification for OpenAI-compatible chat completion responses. diff --git a/docs/static/experimental-llama-stack-spec.yaml b/docs/static/experimental-llama-stack-spec.yaml index d78cfd0e3..b6fff643b 100644 --- a/docs/static/experimental-llama-stack-spec.yaml +++ b/docs/static/experimental-llama-stack-spec.yaml @@ -936,6 +936,11 @@ components: title: OpenAIChatCompletionToolCallFunction - type: 'null' title: OpenAIChatCompletionToolCallFunction + extra_content: + anyOf: + - additionalProperties: true + type: object + - type: 'null' type: object title: OpenAIChatCompletionToolCall description: Tool call specification for OpenAI-compatible chat completion responses. diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index 00d038870..7e3a5c838 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -3249,6 +3249,11 @@ components: title: OpenAIChatCompletionToolCallFunction - type: 'null' title: OpenAIChatCompletionToolCallFunction + extra_content: + anyOf: + - additionalProperties: true + type: object + - type: 'null' type: object title: OpenAIChatCompletionToolCall description: Tool call specification for OpenAI-compatible chat completion responses. diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index f935afae4..b328836c9 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -4228,6 +4228,11 @@ components: title: OpenAIChatCompletionToolCallFunction - type: 'null' title: OpenAIChatCompletionToolCallFunction + extra_content: + anyOf: + - additionalProperties: true + type: object + - type: 'null' type: object title: OpenAIChatCompletionToolCall description: Tool call specification for OpenAI-compatible chat completion responses. diff --git a/src/llama_stack_api/inference.py b/src/llama_stack_api/inference.py index fa2a8fd56..4613fb226 100644 --- a/src/llama_stack_api/inference.py +++ b/src/llama_stack_api/inference.py @@ -438,6 +438,7 @@ class OpenAIChatCompletionToolCall(BaseModel): id: str | None = None type: Literal["function"] = "function" function: OpenAIChatCompletionToolCallFunction | None = None + extra_content: dict[str, Any] | None = None @json_schema_type