Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-b33d3547dd14387df0951ff9638519f7c1a125db265801f63e9136cfa5e4578b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-33be0d612b9f1153b86f53e95bf7c571af2f1e466bda2330b632e6c05832e2a6.yml
16 changes: 14 additions & 2 deletions src/groq/resources/chat/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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,
service_tier: Optional[Literal["auto", "on_demand", "flex"]] | NotGiven = NOT_GIVEN,
stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN,
stream: Optional[bool] | NotGiven = NOT_GIVEN,
temperature: Optional[float] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -144,6 +144,12 @@ def create(
the same result. Determinism is not guaranteed, and you should refer to the
`system_fingerprint` response parameter to monitor changes in the backend.

service_tier: The service tier to use for the request. Defaults to `on_demand`.

- `auto` will automatically select the highest tier available within the rate
limits of your organization.
- `flex` uses the flex tier, which will succeed or fail quickly.

stop: Up to 4 sequences where the API will stop generating further tokens. The
returned text will not contain the stop sequence.

Expand Down Expand Up @@ -264,7 +270,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,
service_tier: Optional[Literal["auto", "on_demand", "flex"]] | NotGiven = NOT_GIVEN,
stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN,
stream: Optional[bool] | NotGiven = NOT_GIVEN,
temperature: Optional[float] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -342,6 +348,12 @@ async def create(
the same result. Determinism is not guaranteed, and you should refer to the
`system_fingerprint` response parameter to monitor changes in the backend.

service_tier: The service tier to use for the request. Defaults to `on_demand`.

- `auto` will automatically select the highest tier available within the rate
limits of your organization.
- `flex` uses the flex tier, which will succeed or fail quickly.

stop: Up to 4 sequences where the API will stop generating further tokens. The
returned text will not contain the stop sequence.

Expand Down
8 changes: 7 additions & 1 deletion src/groq/types/chat/completion_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ class CompletionCreateParams(TypedDict, total=False):
`system_fingerprint` response parameter to monitor changes in the backend.
"""

service_tier: Optional[Literal["on_demand", "flex"]]
service_tier: Optional[Literal["auto", "on_demand", "flex"]]
"""The service tier to use for the request. Defaults to `on_demand`.

- `auto` will automatically select the highest tier available within the rate
limits of your organization.
- `flex` uses the flex tier, which will succeed or fail quickly.
"""

stop: Union[Optional[str], List[str], None]
"""Up to 4 sequences where the API will stop generating further tokens.
Expand Down
4 changes: 2 additions & 2 deletions tests/api_resources/chat/test_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +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",
service_tier="auto",
stop="\n",
stream=True,
temperature=1,
Expand Down Expand Up @@ -160,7 +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",
service_tier="auto",
stop="\n",
stream=True,
temperature=1,
Expand Down