Skip to content

Commit 047ce99

Browse files
chore: add missing docstrings
1 parent 4847b77 commit 047ce99

21 files changed

Lines changed: 112 additions & 0 deletions

src/groq/types/audio/transcription.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66

77

88
class Transcription(BaseModel):
9+
"""
10+
Represents a transcription response returned by model, based on the provided input.
11+
"""
12+
913
text: str
1014
"""The transcribed text."""

src/groq/types/batch_cancel_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class Errors(BaseModel):
3131

3232

3333
class RequestCounts(BaseModel):
34+
"""The request counts for different statuses within the batch."""
35+
3436
completed: int
3537
"""Number of requests that have been completed successfully."""
3638

src/groq/types/batch_create_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class Errors(BaseModel):
3131

3232

3333
class RequestCounts(BaseModel):
34+
"""The request counts for different statuses within the batch."""
35+
3436
completed: int
3537
"""Number of requests that have been completed successfully."""
3638

src/groq/types/batch_list_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class DataErrors(BaseModel):
3131

3232

3333
class DataRequestCounts(BaseModel):
34+
"""The request counts for different statuses within the batch."""
35+
3436
completed: int
3537
"""Number of requests that have been completed successfully."""
3638

src/groq/types/batch_retrieve_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class Errors(BaseModel):
3131

3232

3333
class RequestCounts(BaseModel):
34+
"""The request counts for different statuses within the batch."""
35+
3436
completed: int
3537
"""Number of requests that have been completed successfully."""
3638

src/groq/types/chat/chat_completion.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424

2525
class ChoiceLogprobs(BaseModel):
26+
"""Log probability information for the choice."""
27+
2628
content: Optional[List[ChatCompletionTokenLogprob]] = None
2729
"""A list of message content tokens with log probability information."""
2830

@@ -84,11 +86,20 @@ class UsageBreakdownModel(BaseModel):
8486

8587

8688
class UsageBreakdown(BaseModel):
89+
"""
90+
Detailed usage breakdown by model when multiple models are used in the request for compound AI systems.
91+
"""
92+
8793
models: List[UsageBreakdownModel]
8894
"""List of models used in the request and their individual usage statistics"""
8995

9096

9197
class XGroqDebug(BaseModel):
98+
"""Debug information including input and output token IDs and strings.
99+
100+
Only present when debug=true in the request.
101+
"""
102+
92103
input_token_ids: Optional[List[int]] = None
93104
"""Token IDs for the input."""
94105

@@ -103,6 +114,8 @@ class XGroqDebug(BaseModel):
103114

104115

105116
class XGroqUsage(BaseModel):
117+
"""Additional Groq-specific usage metrics (hardware cache statistics)."""
118+
106119
dram_cached_tokens: Optional[int] = None
107120
"""Number of tokens served from DRAM cache."""
108121

@@ -111,6 +124,8 @@ class XGroqUsage(BaseModel):
111124

112125

113126
class XGroq(BaseModel):
127+
"""Groq-specific metadata for non-streaming chat completion responses."""
128+
114129
id: str
115130
"""
116131
A groq request ID which can be used to refer to a specific request to groq
@@ -134,6 +149,10 @@ class XGroq(BaseModel):
134149

135150

136151
class ChatCompletion(BaseModel):
152+
"""
153+
Represents a chat completion response returned by model, based on the provided input.
154+
"""
155+
137156
id: str
138157
"""A unique identifier for the chat completion."""
139158

src/groq/types/chat/chat_completion_assistant_message_param.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313

1414
class FunctionCall(TypedDict, total=False):
15+
"""Deprecated and replaced by `tool_calls`.
16+
17+
The name and arguments of a function that should be called, as generated by the model.
18+
"""
19+
1520
arguments: str
1621
"""
1722
The arguments to call the function with, as generated by the model in JSON

src/groq/types/chat/chat_completion_function_call_option_param.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88

99

1010
class ChatCompletionFunctionCallOptionParam(TypedDict, total=False):
11+
"""
12+
Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.
13+
"""
14+
1115
name: Required[str]
1216
"""The name of the function to call."""

src/groq/types/chat/chat_completion_message.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424

2525
class AnnotationDocumentCitation(BaseModel):
26+
"""A citation referencing a specific document that was provided in the request."""
27+
2628
document_id: str
2729
"""
2830
The ID of the document being cited, corresponding to a document provided in the
@@ -37,6 +39,8 @@ class AnnotationDocumentCitation(BaseModel):
3739

3840

3941
class AnnotationFunctionCitation(BaseModel):
42+
"""A citation referencing the result of a function or tool call."""
43+
4044
end_index: int
4145
"""The character index in the message content where this citation ends."""
4246

@@ -51,6 +55,8 @@ class AnnotationFunctionCitation(BaseModel):
5155

5256

5357
class Annotation(BaseModel):
58+
"""An annotation that provides citations or references for content in a message."""
59+
5460
type: Literal["document_citation", "function_citation"]
5561
"""The type of annotation."""
5662

@@ -181,6 +187,8 @@ class ExecutedToolSearchResultsResult(BaseModel):
181187

182188

183189
class ExecutedToolSearchResults(BaseModel):
190+
"""The search results returned by the tool, if applicable."""
191+
184192
images: Optional[List[str]] = None
185193
"""List of image URLs returned by the search"""
186194

@@ -212,6 +220,11 @@ class ExecutedTool(BaseModel):
212220

213221

214222
class FunctionCall(BaseModel):
223+
"""Deprecated and replaced by `tool_calls`.
224+
225+
The name and arguments of a function that should be called, as generated by the model.
226+
"""
227+
215228
arguments: str
216229
"""
217230
The arguments to call the function with, as generated by the model in JSON
@@ -225,6 +238,8 @@ class FunctionCall(BaseModel):
225238

226239

227240
class ChatCompletionMessage(BaseModel):
241+
"""A chat completion message generated by the model."""
242+
228243
content: Optional[str] = None
229244
"""The contents of the message."""
230245

src/groq/types/chat/chat_completion_message_tool_call.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99

1010
class Function(BaseModel):
11+
"""The function that the model called."""
12+
1113
arguments: str
1214
"""
1315
The arguments to call the function with, as generated by the model in JSON

0 commit comments

Comments
 (0)