From ffb5a7495d92718e060ada6ea714d37ef962956a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:27:42 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 2 +- src/groq/resources/chat/completions.py | 8 ++++++++ src/groq/types/chat/completion_create_params.py | 3 +++ tests/api_resources/chat/test_completions.py | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16322f25..0f94d2bb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-9502f284ff5064eb110a9b293f379ca91401cc2e3fcea6a9e5979a8af530c9b6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-bc652d6aad32c27ff44cc2403b2f4e072ee694bdc1d5242cea30e98f506f55b2.yml diff --git a/src/groq/resources/chat/completions.py b/src/groq/resources/chat/completions.py index 69c110a3..316a87ec 100644 --- a/src/groq/resources/chat/completions.py +++ b/src/groq/resources/chat/completions.py @@ -65,6 +65,7 @@ def create( n: Optional[int] | NotGiven = NOT_GIVEN, parallel_tool_calls: Optional[bool] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, + reasoning_format: Optional[Literal["hidden", "raw", "parsed"]] | NotGiven = NOT_GIVEN, response_format: Optional[completion_create_params.ResponseFormat] | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, service_tier: Optional[Literal["auto", "on_demand", "flex"]] | NotGiven = NOT_GIVEN, @@ -136,6 +137,8 @@ def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_format: Specifies how to output reasoning tokens + response_format: An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the @@ -219,6 +222,7 @@ def create( "n": n, "parallel_tool_calls": parallel_tool_calls, "presence_penalty": presence_penalty, + "reasoning_format": reasoning_format, "response_format": response_format, "seed": seed, "service_tier": service_tier, @@ -275,6 +279,7 @@ async def create( n: Optional[int] | NotGiven = NOT_GIVEN, parallel_tool_calls: Optional[bool] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, + reasoning_format: Optional[Literal["hidden", "raw", "parsed"]] | NotGiven = NOT_GIVEN, response_format: Optional[completion_create_params.ResponseFormat] | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, service_tier: Optional[Literal["auto", "on_demand", "flex"]] | NotGiven = NOT_GIVEN, @@ -346,6 +351,8 @@ async def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_format: Specifies how to output reasoning tokens + response_format: An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the @@ -429,6 +436,7 @@ async def create( "n": n, "parallel_tool_calls": parallel_tool_calls, "presence_penalty": presence_penalty, + "reasoning_format": reasoning_format, "response_format": response_format, "seed": seed, "service_tier": service_tier, diff --git a/src/groq/types/chat/completion_create_params.py b/src/groq/types/chat/completion_create_params.py index 030c1fba..8268b8d5 100644 --- a/src/groq/types/chat/completion_create_params.py +++ b/src/groq/types/chat/completion_create_params.py @@ -95,6 +95,9 @@ class CompletionCreateParams(TypedDict, total=False): far, increasing the model's likelihood to talk about new topics. """ + reasoning_format: Optional[Literal["hidden", "raw", "parsed"]] + """Specifies how to output reasoning tokens""" + response_format: Optional[ResponseFormat] """An object specifying the format that the model must output. diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index 292a2234..e13e0d83 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -57,6 +57,7 @@ def test_method_create_with_all_params(self, client: Groq) -> None: n=1, parallel_tool_calls=True, presence_penalty=-2, + reasoning_format="hidden", response_format={"type": "text"}, seed=0, service_tier="auto", @@ -160,6 +161,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGroq) -> N n=1, parallel_tool_calls=True, presence_penalty=-2, + reasoning_format="hidden", response_format={"type": "text"}, seed=0, service_tier="auto",