Skip to content

Commit 9ac1364

Browse files
chore: add missing docstrings
1 parent b400d38 commit 9ac1364

File tree

119 files changed

+432
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+432
-0
lines changed

src/gradient/types/agent_create_response.py

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

1111

1212
class AgentCreateResponse(BaseModel):
13+
"""Information about a newly created Agent"""
14+
1315
agent: Optional["APIAgent"] = None
1416
"""An Agent"""
1517

src/gradient/types/agent_delete_response.py

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

1111

1212
class AgentDeleteResponse(BaseModel):
13+
"""Info about a deleted agent"""
14+
1315
agent: Optional["APIAgent"] = None
1416
"""An Agent"""
1517

src/gradient/types/agent_list_response.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525

2626
class AgentChatbot(BaseModel):
27+
"""A Chatbot"""
28+
2729
allowed_domains: Optional[List[str]] = None
2830

2931
button_background_color: Optional[str] = None
@@ -41,11 +43,15 @@ class AgentChatbot(BaseModel):
4143

4244

4345
class AgentChatbotIdentifier(BaseModel):
46+
"""Agent Chatbot Identifier"""
47+
4448
agent_chatbot_identifier: Optional[str] = None
4549
"""Agent chatbot identifier"""
4650

4751

4852
class AgentDeployment(BaseModel):
53+
"""Description of deployment"""
54+
4955
created_at: Optional[datetime] = None
5056
"""Creation date / time"""
5157

@@ -98,6 +104,8 @@ class AgentTemplateGuardrail(BaseModel):
98104

99105

100106
class AgentTemplate(BaseModel):
107+
"""Represents an AgentTemplate entity"""
108+
101109
created_at: Optional[datetime] = None
102110
"""The agent template's creation date"""
103111

@@ -157,6 +165,8 @@ class AgentTemplate(BaseModel):
157165

158166

159167
class Agent(BaseModel):
168+
"""A GenAI Agent's configuration"""
169+
160170
chatbot: Optional[AgentChatbot] = None
161171
"""A Chatbot"""
162172

@@ -266,6 +276,8 @@ class Agent(BaseModel):
266276

267277

268278
class AgentListResponse(BaseModel):
279+
"""List of Agents"""
280+
269281
agents: Optional[List[Agent]] = None
270282
"""Agents"""
271283

src/gradient/types/agent_retrieve_response.py

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

1111

1212
class AgentRetrieveResponse(BaseModel):
13+
"""One Agent"""
14+
1315
agent: Optional["APIAgent"] = None
1416
"""An Agent"""
1517

src/gradient/types/agent_retrieve_usage_response.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99

1010

1111
class LogInsightsUsageMeasurement(BaseModel):
12+
"""Usage Measurement Description"""
13+
1214
tokens: Optional[int] = None
1315

1416
usage_type: Optional[str] = None
1517

1618

1719
class LogInsightsUsage(BaseModel):
20+
"""Resource Usage Description"""
21+
1822
measurements: Optional[List[LogInsightsUsageMeasurement]] = None
1923

2024
resource_uuid: Optional[str] = None
@@ -25,12 +29,16 @@ class LogInsightsUsage(BaseModel):
2529

2630

2731
class UsageMeasurement(BaseModel):
32+
"""Usage Measurement Description"""
33+
2834
tokens: Optional[int] = None
2935

3036
usage_type: Optional[str] = None
3137

3238

3339
class Usage(BaseModel):
40+
"""Resource Usage Description"""
41+
3442
measurements: Optional[List[UsageMeasurement]] = None
3543

3644
resource_uuid: Optional[str] = None
@@ -41,6 +49,8 @@ class Usage(BaseModel):
4149

4250

4351
class AgentRetrieveUsageResponse(BaseModel):
52+
"""Agent usage"""
53+
4454
log_insights_usage: Optional[LogInsightsUsage] = None
4555
"""Resource Usage Description"""
4656

src/gradient/types/agent_update_response.py

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

1111

1212
class AgentUpdateResponse(BaseModel):
13+
"""Information about an updated agent"""
14+
1315
agent: Optional["APIAgent"] = None
1416
"""An Agent"""
1517

src/gradient/types/agent_update_status_response.py

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

1111

1212
class AgentUpdateStatusResponse(BaseModel):
13+
"""UpdateAgentDeploymentVisbilityOutput description"""
14+
1315
agent: Optional["APIAgent"] = None
1416
"""An Agent"""
1517

src/gradient/types/agents/api_link_knowledge_base_output.py

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

1111

1212
class APILinkKnowledgeBaseOutput(BaseModel):
13+
"""Information about a linked knowledge base"""
14+
1315
agent: Optional["APIAgent"] = None
1416
"""An Agent"""
1517

src/gradient/types/agents/chat/completion_create_params.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ class CompletionCreateParamsBase(TypedDict, total=False):
166166

167167

168168
class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False):
169+
"""Content part with type and text"""
170+
169171
text: Required[str]
170172
"""The text content"""
171173

@@ -179,6 +181,11 @@ class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMem
179181

180182

181183
class MessageChatCompletionRequestSystemMessage(TypedDict, total=False):
184+
"""
185+
System-provided instructions that the model should follow, regardless of
186+
messages sent by the user.
187+
"""
188+
182189
content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart]]]
183190
"""The contents of the system message."""
184191

@@ -187,6 +194,8 @@ class MessageChatCompletionRequestSystemMessage(TypedDict, total=False):
187194

188195

189196
class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False):
197+
"""Content part with type and text"""
198+
190199
text: Required[str]
191200
"""The text content"""
192201

@@ -200,6 +209,11 @@ class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnion
200209

201210

202211
class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False):
212+
"""
213+
Developer-provided instructions that the model should follow, regardless of
214+
messages sent by the user.
215+
"""
216+
203217
content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart]]]
204218
"""The contents of the developer message."""
205219

@@ -208,6 +222,8 @@ class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False):
208222

209223

210224
class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False):
225+
"""Content part with type and text"""
226+
211227
text: Required[str]
212228
"""The text content"""
213229

@@ -221,6 +237,11 @@ class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMembe
221237

222238

223239
class MessageChatCompletionRequestUserMessage(TypedDict, total=False):
240+
"""
241+
Messages sent by an end user, containing prompts or additional context
242+
information.
243+
"""
244+
224245
content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart]]]
225246
"""The contents of the user message."""
226247

@@ -229,6 +250,8 @@ class MessageChatCompletionRequestUserMessage(TypedDict, total=False):
229250

230251

231252
class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False):
253+
"""Content part with type and text"""
254+
232255
text: Required[str]
233256
"""The text content"""
234257

@@ -242,6 +265,8 @@ class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnion
242265

243266

244267
class MessageChatCompletionRequestAssistantMessageToolCallFunction(TypedDict, total=False):
268+
"""The function that the model called."""
269+
245270
arguments: Required[str]
246271
"""
247272
The arguments to call the function with, as generated by the model in JSON
@@ -266,6 +291,8 @@ class MessageChatCompletionRequestAssistantMessageToolCall(TypedDict, total=Fals
266291

267292

268293
class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False):
294+
"""Messages sent by the model in response to user messages."""
295+
269296
role: Required[Literal["assistant"]]
270297
"""The role of the messages author, in this case `assistant`."""
271298

@@ -297,6 +324,8 @@ class MessageChatCompletionRequestToolMessage(TypedDict, total=False):
297324

298325

299326
class StreamOptions(TypedDict, total=False):
327+
"""Options for streaming response. Only set this when you set `stream: true`."""
328+
300329
include_usage: bool
301330
"""If set, an additional chunk will be streamed before the `data: [DONE]` message.
302331
@@ -315,6 +344,11 @@ class ToolChoiceChatCompletionNamedToolChoiceFunction(TypedDict, total=False):
315344

316345

317346
class ToolChoiceChatCompletionNamedToolChoice(TypedDict, total=False):
347+
"""Specifies a tool the model should use.
348+
349+
Use to force the model to call a specific function.
350+
"""
351+
318352
function: Required[ToolChoiceChatCompletionNamedToolChoiceFunction]
319353

320354
type: Required[Literal["function"]]

src/gradient/types/agents/chat/completion_create_response.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919

2020
class ChoiceLogprobs(BaseModel):
21+
"""Log probability information for the choice."""
22+
2123
content: Optional[List[ChatCompletionTokenLogprob]] = None
2224
"""A list of message content tokens with log probability information."""
2325

@@ -26,6 +28,8 @@ class ChoiceLogprobs(BaseModel):
2628

2729

2830
class ChoiceMessageToolCallFunction(BaseModel):
31+
"""The function that the model called."""
32+
2933
arguments: str
3034
"""
3135
The arguments to call the function with, as generated by the model in JSON
@@ -50,6 +54,8 @@ class ChoiceMessageToolCall(BaseModel):
5054

5155

5256
class ChoiceMessage(BaseModel):
57+
"""A chat completion message generated by the model."""
58+
5359
content: Optional[str] = None
5460
"""The contents of the message."""
5561

@@ -86,6 +92,10 @@ class Choice(BaseModel):
8692

8793

8894
class CompletionCreateResponse(BaseModel):
95+
"""
96+
Represents a chat completion response returned by model, based on the provided input.
97+
"""
98+
8999
id: str
90100
"""A unique identifier for the chat completion."""
91101

0 commit comments

Comments
 (0)