From 4847b77d575ee800a28b02c8e01165a0c8931ceb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 05:43:43 +0000 Subject: [PATCH 01/11] fix(types): allow pyright to infer TypedDict types within SequenceNotStr --- src/groq/_types.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/groq/_types.py b/src/groq/_types.py index e5f275e9..8d11db03 100644 --- a/src/groq/_types.py +++ b/src/groq/_types.py @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False): if TYPE_CHECKING: # This works because str.__contains__ does not accept object (either in typeshed or at runtime) # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... def __contains__(self, value: object, /) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T_co]: ... - def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... - def count(self, value: Any, /) -> int: ... def __reversed__(self) -> Iterator[_T_co]: ... else: # just point this to a normal `Sequence` at runtime to avoid having to special case From 047ce99d97d4085227849a3f293411e1c6fe348b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 05:46:03 +0000 Subject: [PATCH 02/11] chore: add missing docstrings --- src/groq/types/audio/transcription.py | 4 +++ src/groq/types/batch_cancel_response.py | 2 ++ src/groq/types/batch_create_response.py | 2 ++ src/groq/types/batch_list_response.py | 2 ++ src/groq/types/batch_retrieve_response.py | 2 ++ src/groq/types/chat/chat_completion.py | 19 ++++++++++++++ ...chat_completion_assistant_message_param.py | 5 ++++ ...t_completion_function_call_option_param.py | 4 +++ .../types/chat/chat_completion_message.py | 15 +++++++++++ .../chat/chat_completion_message_tool_call.py | 2 ++ ...chat_completion_message_tool_call_param.py | 2 ++ ...chat_completion_named_tool_choice_param.py | 5 ++++ .../types/chat/completion_create_params.py | 25 +++++++++++++++++++ src/groq/types/completion_usage.py | 6 +++++ src/groq/types/create_embedding_response.py | 2 ++ src/groq/types/embedding.py | 2 ++ src/groq/types/file_create_response.py | 2 ++ src/groq/types/file_info_response.py | 2 ++ src/groq/types/file_list_response.py | 2 ++ src/groq/types/model.py | 2 ++ src/groq/types/shared/error_object.py | 5 ++++ 21 files changed, 112 insertions(+) diff --git a/src/groq/types/audio/transcription.py b/src/groq/types/audio/transcription.py index fa512e27..1137ede2 100644 --- a/src/groq/types/audio/transcription.py +++ b/src/groq/types/audio/transcription.py @@ -6,5 +6,9 @@ class Transcription(BaseModel): + """ + Represents a transcription response returned by model, based on the provided input. + """ + text: str """The transcribed text.""" diff --git a/src/groq/types/batch_cancel_response.py b/src/groq/types/batch_cancel_response.py index f03170be..e62311e3 100644 --- a/src/groq/types/batch_cancel_response.py +++ b/src/groq/types/batch_cancel_response.py @@ -31,6 +31,8 @@ class Errors(BaseModel): class RequestCounts(BaseModel): + """The request counts for different statuses within the batch.""" + completed: int """Number of requests that have been completed successfully.""" diff --git a/src/groq/types/batch_create_response.py b/src/groq/types/batch_create_response.py index 8f0a8ab1..f45b069c 100644 --- a/src/groq/types/batch_create_response.py +++ b/src/groq/types/batch_create_response.py @@ -31,6 +31,8 @@ class Errors(BaseModel): class RequestCounts(BaseModel): + """The request counts for different statuses within the batch.""" + completed: int """Number of requests that have been completed successfully.""" diff --git a/src/groq/types/batch_list_response.py b/src/groq/types/batch_list_response.py index a6b3389b..9487be56 100644 --- a/src/groq/types/batch_list_response.py +++ b/src/groq/types/batch_list_response.py @@ -31,6 +31,8 @@ class DataErrors(BaseModel): class DataRequestCounts(BaseModel): + """The request counts for different statuses within the batch.""" + completed: int """Number of requests that have been completed successfully.""" diff --git a/src/groq/types/batch_retrieve_response.py b/src/groq/types/batch_retrieve_response.py index ddc8ab6c..88adfc84 100644 --- a/src/groq/types/batch_retrieve_response.py +++ b/src/groq/types/batch_retrieve_response.py @@ -31,6 +31,8 @@ class Errors(BaseModel): class RequestCounts(BaseModel): + """The request counts for different statuses within the batch.""" + completed: int """Number of requests that have been completed successfully.""" diff --git a/src/groq/types/chat/chat_completion.py b/src/groq/types/chat/chat_completion.py index 1499040f..c1d806cd 100644 --- a/src/groq/types/chat/chat_completion.py +++ b/src/groq/types/chat/chat_completion.py @@ -23,6 +23,8 @@ class ChoiceLogprobs(BaseModel): + """Log probability information for the choice.""" + content: Optional[List[ChatCompletionTokenLogprob]] = None """A list of message content tokens with log probability information.""" @@ -84,11 +86,20 @@ class UsageBreakdownModel(BaseModel): class UsageBreakdown(BaseModel): + """ + Detailed usage breakdown by model when multiple models are used in the request for compound AI systems. + """ + models: List[UsageBreakdownModel] """List of models used in the request and their individual usage statistics""" class XGroqDebug(BaseModel): + """Debug information including input and output token IDs and strings. + + Only present when debug=true in the request. + """ + input_token_ids: Optional[List[int]] = None """Token IDs for the input.""" @@ -103,6 +114,8 @@ class XGroqDebug(BaseModel): class XGroqUsage(BaseModel): + """Additional Groq-specific usage metrics (hardware cache statistics).""" + dram_cached_tokens: Optional[int] = None """Number of tokens served from DRAM cache.""" @@ -111,6 +124,8 @@ class XGroqUsage(BaseModel): class XGroq(BaseModel): + """Groq-specific metadata for non-streaming chat completion responses.""" + id: str """ A groq request ID which can be used to refer to a specific request to groq @@ -134,6 +149,10 @@ class XGroq(BaseModel): class ChatCompletion(BaseModel): + """ + Represents a chat completion response returned by model, based on the provided input. + """ + id: str """A unique identifier for the chat completion.""" diff --git a/src/groq/types/chat/chat_completion_assistant_message_param.py b/src/groq/types/chat/chat_completion_assistant_message_param.py index e96242a5..b33c25be 100644 --- a/src/groq/types/chat/chat_completion_assistant_message_param.py +++ b/src/groq/types/chat/chat_completion_assistant_message_param.py @@ -12,6 +12,11 @@ class FunctionCall(TypedDict, total=False): + """Deprecated and replaced by `tool_calls`. + + The name and arguments of a function that should be called, as generated by the model. + """ + arguments: str """ The arguments to call the function with, as generated by the model in JSON diff --git a/src/groq/types/chat/chat_completion_function_call_option_param.py b/src/groq/types/chat/chat_completion_function_call_option_param.py index 2bc014af..b1ca37bf 100644 --- a/src/groq/types/chat/chat_completion_function_call_option_param.py +++ b/src/groq/types/chat/chat_completion_function_call_option_param.py @@ -8,5 +8,9 @@ class ChatCompletionFunctionCallOptionParam(TypedDict, total=False): + """ + Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + """ + name: Required[str] """The name of the function to call.""" diff --git a/src/groq/types/chat/chat_completion_message.py b/src/groq/types/chat/chat_completion_message.py index b57905ab..caad243f 100644 --- a/src/groq/types/chat/chat_completion_message.py +++ b/src/groq/types/chat/chat_completion_message.py @@ -23,6 +23,8 @@ class AnnotationDocumentCitation(BaseModel): + """A citation referencing a specific document that was provided in the request.""" + document_id: str """ The ID of the document being cited, corresponding to a document provided in the @@ -37,6 +39,8 @@ class AnnotationDocumentCitation(BaseModel): class AnnotationFunctionCitation(BaseModel): + """A citation referencing the result of a function or tool call.""" + end_index: int """The character index in the message content where this citation ends.""" @@ -51,6 +55,8 @@ class AnnotationFunctionCitation(BaseModel): class Annotation(BaseModel): + """An annotation that provides citations or references for content in a message.""" + type: Literal["document_citation", "function_citation"] """The type of annotation.""" @@ -181,6 +187,8 @@ class ExecutedToolSearchResultsResult(BaseModel): class ExecutedToolSearchResults(BaseModel): + """The search results returned by the tool, if applicable.""" + images: Optional[List[str]] = None """List of image URLs returned by the search""" @@ -212,6 +220,11 @@ class ExecutedTool(BaseModel): class FunctionCall(BaseModel): + """Deprecated and replaced by `tool_calls`. + + The name and arguments of a function that should be called, as generated by the model. + """ + arguments: str """ The arguments to call the function with, as generated by the model in JSON @@ -225,6 +238,8 @@ class FunctionCall(BaseModel): class ChatCompletionMessage(BaseModel): + """A chat completion message generated by the model.""" + content: Optional[str] = None """The contents of the message.""" diff --git a/src/groq/types/chat/chat_completion_message_tool_call.py b/src/groq/types/chat/chat_completion_message_tool_call.py index 4fec6670..7abd3e34 100644 --- a/src/groq/types/chat/chat_completion_message_tool_call.py +++ b/src/groq/types/chat/chat_completion_message_tool_call.py @@ -8,6 +8,8 @@ class Function(BaseModel): + """The function that the model called.""" + arguments: str """ The arguments to call the function with, as generated by the model in JSON diff --git a/src/groq/types/chat/chat_completion_message_tool_call_param.py b/src/groq/types/chat/chat_completion_message_tool_call_param.py index f616c363..6cc19871 100644 --- a/src/groq/types/chat/chat_completion_message_tool_call_param.py +++ b/src/groq/types/chat/chat_completion_message_tool_call_param.py @@ -8,6 +8,8 @@ class Function(TypedDict, total=False): + """The function that the model called.""" + arguments: Required[str] """ The arguments to call the function with, as generated by the model in JSON diff --git a/src/groq/types/chat/chat_completion_named_tool_choice_param.py b/src/groq/types/chat/chat_completion_named_tool_choice_param.py index 369f8b42..26b73ee9 100644 --- a/src/groq/types/chat/chat_completion_named_tool_choice_param.py +++ b/src/groq/types/chat/chat_completion_named_tool_choice_param.py @@ -13,6 +13,11 @@ class Function(TypedDict, total=False): class ChatCompletionNamedToolChoiceParam(TypedDict, total=False): + """Specifies a tool the model should use. + + Use to force the model to call a specific function. + """ + function: Required[Function] type: Required[Literal["function"]] diff --git a/src/groq/types/chat/completion_create_params.py b/src/groq/types/chat/completion_create_params.py index 13f222f4..038cbf57 100644 --- a/src/groq/types/chat/completion_create_params.py +++ b/src/groq/types/chat/completion_create_params.py @@ -305,11 +305,15 @@ class CompoundCustomModels(TypedDict, total=False): class CompoundCustomToolsWolframSettings(TypedDict, total=False): + """Configuration for the Wolfram tool integration.""" + authorization: Optional[str] """API key used to authorize requests to Wolfram services.""" class CompoundCustomTools(TypedDict, total=False): + """Configuration options for tools available to Compound.""" + enabled_tools: Optional[SequenceNotStr[str]] """A list of tool names that are enabled for the request.""" @@ -318,6 +322,8 @@ class CompoundCustomTools(TypedDict, total=False): class CompoundCustom(TypedDict, total=False): + """Custom configuration of models and tools for Compound.""" + models: Optional[CompoundCustomModels] tools: Optional[CompoundCustomTools] @@ -325,6 +331,8 @@ class CompoundCustom(TypedDict, total=False): class DocumentSourceChatCompletionDocumentSourceText(TypedDict, total=False): + """A document whose contents are provided inline as text.""" + text: Required[str] """The document contents.""" @@ -333,6 +341,8 @@ class DocumentSourceChatCompletionDocumentSourceText(TypedDict, total=False): class DocumentSourceChatCompletionDocumentSourceJson(TypedDict, total=False): + """A document whose contents are provided inline as JSON data.""" + data: Required[Dict[str, object]] """The JSON payload associated with the document.""" @@ -346,6 +356,8 @@ class DocumentSourceChatCompletionDocumentSourceJson(TypedDict, total=False): class Document(TypedDict, total=False): + """A document that can be referenced by the model while generating responses.""" + source: Required[DocumentSource] """The source of the document. Only text and JSON sources are currently supported.""" @@ -379,11 +391,15 @@ class Function(TypedDict, total=False): class ResponseFormatResponseFormatText(TypedDict, total=False): + """Default response format. Used to generate text responses.""" + type: Required[Literal["text"]] """The type of response format being defined. Always `text`.""" class ResponseFormatResponseFormatJsonSchemaJsonSchema(TypedDict, total=False): + """Structured Outputs configuration options, including a JSON Schema.""" + name: Required[str] """The name of the response format. @@ -413,6 +429,8 @@ class ResponseFormatResponseFormatJsonSchemaJsonSchema(TypedDict, total=False): class ResponseFormatResponseFormatJsonSchema(TypedDict, total=False): + """JSON Schema response format. Used to generate structured JSON responses.""" + json_schema: Required[ResponseFormatResponseFormatJsonSchemaJsonSchema] """Structured Outputs configuration options, including a JSON Schema.""" @@ -421,6 +439,11 @@ class ResponseFormatResponseFormatJsonSchema(TypedDict, total=False): class ResponseFormatResponseFormatJsonObject(TypedDict, total=False): + """JSON object response format. + + An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so. + """ + type: Required[Literal["json_object"]] """The type of response format being defined. Always `json_object`.""" @@ -431,6 +454,8 @@ class ResponseFormatResponseFormatJsonObject(TypedDict, total=False): class SearchSettings(TypedDict, total=False): + """Settings for web search functionality when the model uses a web search tool.""" + country: Optional[str] """ Name of country to prioritize search results from (e.g., "united states", diff --git a/src/groq/types/completion_usage.py b/src/groq/types/completion_usage.py index b367ea48..aed34614 100644 --- a/src/groq/types/completion_usage.py +++ b/src/groq/types/completion_usage.py @@ -8,16 +8,22 @@ class CompletionTokensDetails(BaseModel): + """Breakdown of tokens in the completion.""" + reasoning_tokens: int """Number of tokens used for reasoning (for reasoning models).""" class PromptTokensDetails(BaseModel): + """Breakdown of tokens in the prompt.""" + cached_tokens: int """Number of tokens that were cached and reused.""" class CompletionUsage(BaseModel): + """Usage statistics for the completion request.""" + completion_tokens: int """Number of tokens in the generated completion.""" diff --git a/src/groq/types/create_embedding_response.py b/src/groq/types/create_embedding_response.py index eff247a1..314a7f9a 100644 --- a/src/groq/types/create_embedding_response.py +++ b/src/groq/types/create_embedding_response.py @@ -10,6 +10,8 @@ class Usage(BaseModel): + """The usage information for the request.""" + prompt_tokens: int """The number of tokens used by the prompt.""" diff --git a/src/groq/types/embedding.py b/src/groq/types/embedding.py index 6dad3c34..867b999d 100644 --- a/src/groq/types/embedding.py +++ b/src/groq/types/embedding.py @@ -9,6 +9,8 @@ class Embedding(BaseModel): + """Represents an embedding vector returned by embedding endpoint.""" + embedding: Union[List[float], str] """The embedding vector, which is a list of floats. diff --git a/src/groq/types/file_create_response.py b/src/groq/types/file_create_response.py index bc0a0a91..930a9fe6 100644 --- a/src/groq/types/file_create_response.py +++ b/src/groq/types/file_create_response.py @@ -9,6 +9,8 @@ class FileCreateResponse(BaseModel): + """The `File` object represents a document that has been uploaded.""" + id: Optional[str] = None """The file identifier, which can be referenced in the API endpoints.""" diff --git a/src/groq/types/file_info_response.py b/src/groq/types/file_info_response.py index cfc848e6..23d8496c 100644 --- a/src/groq/types/file_info_response.py +++ b/src/groq/types/file_info_response.py @@ -9,6 +9,8 @@ class FileInfoResponse(BaseModel): + """The `File` object represents a document that has been uploaded.""" + id: Optional[str] = None """The file identifier, which can be referenced in the API endpoints.""" diff --git a/src/groq/types/file_list_response.py b/src/groq/types/file_list_response.py index b42d3d07..1782f1c5 100644 --- a/src/groq/types/file_list_response.py +++ b/src/groq/types/file_list_response.py @@ -9,6 +9,8 @@ class Data(BaseModel): + """The `File` object represents a document that has been uploaded.""" + id: Optional[str] = None """The file identifier, which can be referenced in the API endpoints.""" diff --git a/src/groq/types/model.py b/src/groq/types/model.py index 2631ee8d..6506224a 100644 --- a/src/groq/types/model.py +++ b/src/groq/types/model.py @@ -8,6 +8,8 @@ class Model(BaseModel): + """Describes an OpenAI model offering that can be used with the API.""" + id: str """The model identifier, which can be referenced in the API endpoints.""" diff --git a/src/groq/types/shared/error_object.py b/src/groq/types/shared/error_object.py index f5cd4694..a0c79edf 100644 --- a/src/groq/types/shared/error_object.py +++ b/src/groq/types/shared/error_object.py @@ -8,6 +8,11 @@ class Debug(BaseModel): + """Debug information including input and output token IDs and strings. + + Only present when debug=true in the request. + """ + input_token_ids: Optional[List[int]] = None """Token IDs for the input.""" From 79231cd108eb6aa1cf194ff68834514876d65d59 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 01:45:14 +0000 Subject: [PATCH 03/11] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5dbd77c9..08cc51bd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-72c846893a3d08d716638abd70d621c0ffc6c4b3aa9f5b8b06dde07c68fa529b.yml -openapi_spec_hash: 7d29da2abb6833f7a891a53f49449122 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-487768dc3d7c3ae3c331ed808e08673395dc6fa675eec7ba8daf59b7f4d85882.yml +openapi_spec_hash: 1deeff6ac1a5c95e1c4cf70dbb063a78 config_hash: 4719968e58eab04c8641284bcf18ef5d From ace3658e4dddb0266eed66d23a66c4b8828945b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 23:24:26 +0000 Subject: [PATCH 04/11] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 08cc51bd..df417897 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-487768dc3d7c3ae3c331ed808e08673395dc6fa675eec7ba8daf59b7f4d85882.yml -openapi_spec_hash: 1deeff6ac1a5c95e1c4cf70dbb063a78 -config_hash: 4719968e58eab04c8641284bcf18ef5d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-72c846893a3d08d716638abd70d621c0ffc6c4b3aa9f5b8b06dde07c68fa529b.yml +openapi_spec_hash: 7d29da2abb6833f7a891a53f49449122 +config_hash: 1090f7d2d65606f3557c0cab4cd99b5d From 0f6baed37a02d975f67cbb01d0032ba3d7156543 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 23:29:59 +0000 Subject: [PATCH 05/11] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index df417897..a340f663 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-72c846893a3d08d716638abd70d621c0ffc6c4b3aa9f5b8b06dde07c68fa529b.yml openapi_spec_hash: 7d29da2abb6833f7a891a53f49449122 -config_hash: 1090f7d2d65606f3557c0cab4cd99b5d +config_hash: 142e81bb5f00f3c78859fb63a2de3735 From 45295929a12a66ef2c8f73bcaa8a4b5f0718aac7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 23:32:15 +0000 Subject: [PATCH 06/11] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a340f663..3ed0be63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-72c846893a3d08d716638abd70d621c0ffc6c4b3aa9f5b8b06dde07c68fa529b.yml openapi_spec_hash: 7d29da2abb6833f7a891a53f49449122 -config_hash: 142e81bb5f00f3c78859fb63a2de3735 +config_hash: eca7e3cb24b18c605dd1bc936da8ef3e From af6e6dcc33d5ca356a22281697b066f70b2f328a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:13:09 +0000 Subject: [PATCH 07/11] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3ed0be63..6e432bb6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-72c846893a3d08d716638abd70d621c0ffc6c4b3aa9f5b8b06dde07c68fa529b.yml -openapi_spec_hash: 7d29da2abb6833f7a891a53f49449122 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-487768dc3d7c3ae3c331ed808e08673395dc6fa675eec7ba8daf59b7f4d85882.yml +openapi_spec_hash: 1deeff6ac1a5c95e1c4cf70dbb063a78 config_hash: eca7e3cb24b18c605dd1bc936da8ef3e From 7c889d73ea3b785aeec893c37c2e09289a4887b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 05:21:56 +0000 Subject: [PATCH 08/11] chore(internal): add missing files argument to base client --- src/groq/_base_client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/groq/_base_client.py b/src/groq/_base_client.py index 463c982e..dc5ddf42 100644 --- a/src/groq/_base_client.py +++ b/src/groq/_base_client.py @@ -1247,9 +1247,12 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1767,9 +1770,12 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return await self.request(cast_to, opts) async def put( From f1f83f83fb8b91599d83db9c1a17da21a3b5d19a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 17:40:17 +0000 Subject: [PATCH 09/11] feat(api): api update --- .stats.yml | 4 ++-- .../types/chat/chat_completion_assistant_message_param.py | 3 ++- src/groq/types/chat/chat_completion_message.py | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6e432bb6..43162274 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-487768dc3d7c3ae3c331ed808e08673395dc6fa675eec7ba8daf59b7f4d85882.yml -openapi_spec_hash: 1deeff6ac1a5c95e1c4cf70dbb063a78 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-2c4683b6cf3c31fe903d6b314823be4440c5f1c3db00545bca9534a816179fed.yml +openapi_spec_hash: 4fad55cf0c3fc26500f4030edf31b64d config_hash: eca7e3cb24b18c605dd1bc936da8ef3e diff --git a/src/groq/types/chat/chat_completion_assistant_message_param.py b/src/groq/types/chat/chat_completion_assistant_message_param.py index b33c25be..32412247 100644 --- a/src/groq/types/chat/chat_completion_assistant_message_param.py +++ b/src/groq/types/chat/chat_completion_assistant_message_param.py @@ -56,7 +56,8 @@ class ChatCompletionAssistantMessageParam(TypedDict, total=False): reasoning: Optional[str] """ The reasoning output by the assistant if reasoning_format was set to 'parsed'. - This field is only useable with qwen3 models. + This field is supported on + [models that support reasoning](https://console.groq.com/docs/reasoning). """ tool_calls: Iterable[ChatCompletionMessageToolCallParam] diff --git a/src/groq/types/chat/chat_completion_message.py b/src/groq/types/chat/chat_completion_message.py index caad243f..a9308a8b 100644 --- a/src/groq/types/chat/chat_completion_message.py +++ b/src/groq/types/chat/chat_completion_message.py @@ -268,8 +268,9 @@ class ChatCompletionMessage(BaseModel): reasoning: Optional[str] = None """The model's reasoning for a response. - Only available for reasoning models when requests parameter reasoning_format has - value `parsed. + Only available for + [models that support reasoning](https://console.groq.com/docs/reasoning) when + request parameter reasoning_format has value `parsed`. """ tool_calls: Optional[List[ChatCompletionMessageToolCall]] = None From 360421b88be0c9feb545ee7a2512a0af9ef53196 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 19:21:04 +0000 Subject: [PATCH 10/11] fix: use async_to_httpx_files in patch method --- src/groq/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/groq/_base_client.py b/src/groq/_base_client.py index dc5ddf42..a2348b0f 100644 --- a/src/groq/_base_client.py +++ b/src/groq/_base_client.py @@ -1774,7 +1774,7 @@ async def patch( options: RequestOptions = {}, ) -> ResponseT: opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) From f19b0b8423558658c2b528082bce6dbe1ef4849a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 19:21:21 +0000 Subject: [PATCH 11/11] release: 1.0.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 20 ++++++++++++++++++++ pyproject.toml | 2 +- src/groq/_version.py | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 69508b72..fea34540 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.37.1" + ".": "1.0.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d76bbab..98b25829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 1.0.0 (2025-12-17) + +Full Changelog: [v0.37.1...v1.0.0](https://github.com/groq/groq-python/compare/v0.37.1...v1.0.0) + +### Features + +* **api:** api update ([f1f83f8](https://github.com/groq/groq-python/commit/f1f83f83fb8b91599d83db9c1a17da21a3b5d19a)) + + +### Bug Fixes + +* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([4847b77](https://github.com/groq/groq-python/commit/4847b77d575ee800a28b02c8e01165a0c8931ceb)) +* use async_to_httpx_files in patch method ([360421b](https://github.com/groq/groq-python/commit/360421b88be0c9feb545ee7a2512a0af9ef53196)) + + +### Chores + +* add missing docstrings ([047ce99](https://github.com/groq/groq-python/commit/047ce99d97d4085227849a3f293411e1c6fe348b)) +* **internal:** add missing files argument to base client ([7c889d7](https://github.com/groq/groq-python/commit/7c889d73ea3b785aeec893c37c2e09289a4887b6)) + ## 0.37.1 (2025-12-04) Full Changelog: [v0.37.0...v0.37.1](https://github.com/groq/groq-python/compare/v0.37.0...v0.37.1) diff --git a/pyproject.toml b/pyproject.toml index 1e5aea6f..b54bdb25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "groq" -version = "0.37.1" +version = "1.0.0" description = "The official Python library for the groq API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/groq/_version.py b/src/groq/_version.py index 4671b72b..7520d111 100644 --- a/src/groq/_version.py +++ b/src/groq/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "groq" -__version__ = "0.37.1" # x-release-please-version +__version__ = "1.0.0" # x-release-please-version