From 5016206e461c384806ac3c68b8dfab3d342ba93c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 19:03:15 +0000 Subject: [PATCH] feat(api): api update (#167) --- .stats.yml | 2 +- src/groq/resources/chat/completions.py | 4 ++++ src/groq/types/chat/completion_create_params.py | 2 ++ tests/api_resources/chat/test_completions.py | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4031baa..c917b4e 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-82797b9f004b8c807380a1fa8eec4dc51d760b0f7f1705409a171e88e370102f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-b33d3547dd14387df0951ff9638519f7c1a125db265801f63e9136cfa5e4578b.yml diff --git a/src/groq/resources/chat/completions.py b/src/groq/resources/chat/completions.py index bcd0117..ee40d76 100644 --- a/src/groq/resources/chat/completions.py +++ b/src/groq/resources/chat/completions.py @@ -170,6 +170,7 @@ def create( presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, response_format: Optional[completion_create_params.ResponseFormat] | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, + service_tier: Optional[Literal["on_demand", "flex"]] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, @@ -312,6 +313,7 @@ def create( "presence_penalty": presence_penalty, "response_format": response_format, "seed": seed, + "service_tier": service_tier, "stop": stop, "stream": stream, "temperature": temperature, @@ -470,6 +472,7 @@ async def create( presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, response_format: Optional[completion_create_params.ResponseFormat] | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, + service_tier: Optional[Literal["on_demand", "flex"]] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, @@ -612,6 +615,7 @@ async def create( "presence_penalty": presence_penalty, "response_format": response_format, "seed": seed, + "service_tier": service_tier, "stop": stop, "stream": stream, "temperature": temperature, diff --git a/src/groq/types/chat/completion_create_params.py b/src/groq/types/chat/completion_create_params.py index 811c2d1..e77aa0c 100644 --- a/src/groq/types/chat/completion_create_params.py +++ b/src/groq/types/chat/completion_create_params.py @@ -106,6 +106,8 @@ class CompletionCreateParams(TypedDict, total=False): `system_fingerprint` response parameter to monitor changes in the backend. """ + service_tier: Optional[Literal["on_demand", "flex"]] + stop: Union[Optional[str], List[str], None] """Up to 4 sequences where the API will stop generating further tokens. diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index f89e357..ae9dd97 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -58,6 +58,7 @@ def test_method_create_with_all_params(self, client: Groq) -> None: presence_penalty=-2, response_format={"type": "text"}, seed=0, + service_tier="on_demand", stop="\n", stream=False, temperature=1, @@ -159,6 +160,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGroq) -> N presence_penalty=-2, response_format={"type": "text"}, seed=0, + service_tier="on_demand", stop="\n", stream=False, temperature=1,