perplexityai 0.7.2__py3-none-any.whl → 0.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of perplexityai might be problematic. Click here for more details.

Files changed (37) hide show
  1. perplexity/_client.py +1 -9
  2. perplexity/_models.py +10 -4
  3. perplexity/_version.py +1 -1
  4. perplexity/resources/__init__.py +0 -14
  5. perplexity/resources/async_/chat/completions.py +90 -76
  6. perplexity/resources/chat/completions.py +174 -80
  7. perplexity/resources/search.py +2 -60
  8. perplexity/types/__init__.py +4 -5
  9. perplexity/types/async_/chat/__init__.py +1 -1
  10. perplexity/types/async_/chat/completion_create_params.py +185 -40
  11. perplexity/types/async_/chat/completion_create_response.py +13 -13
  12. perplexity/types/async_/chat/completion_get_params.py +23 -0
  13. perplexity/types/async_/chat/completion_get_response.py +13 -13
  14. perplexity/types/async_/chat/completion_list_response.py +1 -1
  15. perplexity/types/chat/completion_create_params.py +180 -40
  16. perplexity/types/chat/completion_create_response.py +13 -10
  17. perplexity/types/search_create_params.py +0 -24
  18. perplexity/types/search_create_response.py +0 -7
  19. perplexity/types/shared/__init__.py +4 -3
  20. perplexity/types/shared/{search_result.py → api_public_search_result.py} +6 -2
  21. perplexity/types/shared/chat_message_input.py +212 -0
  22. perplexity/types/shared/chat_message_output.py +212 -0
  23. perplexity/types/shared/{chat_choice.py → choice.py} +6 -4
  24. perplexity/types/shared/usage_info.py +19 -1
  25. perplexity/types/shared_params/__init__.py +2 -1
  26. perplexity/types/shared_params/api_public_search_result.py +20 -0
  27. perplexity/types/shared_params/chat_message_input.py +216 -0
  28. {perplexityai-0.7.2.dist-info → perplexityai-0.9.0.dist-info}/METADATA +4 -4
  29. {perplexityai-0.7.2.dist-info → perplexityai-0.9.0.dist-info}/RECORD +31 -32
  30. perplexity/resources/content.py +0 -167
  31. perplexity/types/async_/chat/completion_list_params.py +0 -15
  32. perplexity/types/content_create_params.py +0 -14
  33. perplexity/types/content_create_response.py +0 -29
  34. perplexity/types/shared/chat_message.py +0 -31
  35. perplexity/types/shared_params/chat_message.py +0 -31
  36. {perplexityai-0.7.2.dist-info → perplexityai-0.9.0.dist-info}/WHEEL +0 -0
  37. {perplexityai-0.7.2.dist-info → perplexityai-0.9.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,89 +2,229 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Iterable, Optional
6
- from typing_extensions import Literal, Required, TypedDict
5
+ from typing import Dict, Union, Iterable, Optional
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
7
 
8
8
  from ..._types import SequenceNotStr
9
- from ..shared_params.chat_message import ChatMessage
10
-
11
- __all__ = ["CompletionCreateParams", "WebSearchOptions", "WebSearchOptionsUserLocation"]
9
+ from ..shared_params.chat_message_input import ChatMessageInput
10
+
11
+ __all__ = [
12
+ "CompletionCreateParams",
13
+ "DebugParams",
14
+ "ResponseFormat",
15
+ "ResponseFormatResponseFormatText",
16
+ "ResponseFormatResponseFormatJsonSchema",
17
+ "ResponseFormatResponseFormatJsonSchemaJsonSchema",
18
+ "ResponseFormatResponseFormatRegex",
19
+ "ResponseFormatResponseFormatRegexRegex",
20
+ "Tool",
21
+ "ToolFunction",
22
+ "ToolFunctionParameters",
23
+ "WebSearchOptions",
24
+ "WebSearchOptionsUserLocation",
25
+ ]
12
26
 
13
27
 
14
28
  class CompletionCreateParams(TypedDict, total=False):
15
- messages: Required[Iterable[ChatMessage]]
16
- """A list of messages comprising the conversation so far"""
29
+ messages: Required[Iterable[ChatMessageInput]]
30
+
31
+ model: Required[str]
32
+
33
+ _debug_pro_search: bool
34
+
35
+ _inputs: Optional[Iterable[int]]
36
+
37
+ _is_browser_agent: Optional[bool]
38
+
39
+ _prompt_token_length: Optional[int]
40
+
41
+ best_of: Optional[int]
42
+
43
+ country: Optional[str]
44
+
45
+ cum_logprobs: Optional[bool]
17
46
 
18
- model: Required[Literal["sonar", "sonar-pro", "sonar-deep-research", "sonar-reasoning", "sonar-reasoning-pro"]]
19
- """The name of the model that will complete your prompt"""
47
+ debug_params: Optional[DebugParams]
20
48
 
21
- disable_search: bool
22
- """Disables web search completely - model uses only training data"""
49
+ disable_search: Optional[bool]
23
50
 
24
- enable_search_classifier: bool
25
- """Enables classifier that decides if web search is needed"""
51
+ diverse_first_token: Optional[bool]
52
+
53
+ enable_search_classifier: Optional[bool]
54
+
55
+ file_workspace_id: Optional[str]
56
+
57
+ frequency_penalty: Optional[float]
58
+
59
+ has_image_url: bool
60
+
61
+ image_domain_filter: Optional[SequenceNotStr[str]]
62
+
63
+ image_format_filter: Optional[SequenceNotStr[str]]
26
64
 
27
65
  last_updated_after_filter: Optional[str]
28
- """Only include content last updated after this date (YYYY-MM-DD)"""
29
66
 
30
67
  last_updated_before_filter: Optional[str]
31
- """Only include content last updated before this date (YYYY-MM-DD)"""
32
68
 
33
- reasoning_effort: Optional[Literal["low", "medium", "high"]]
34
- """Controls computational effort for sonar-deep-research model.
69
+ latitude: Optional[float]
70
+
71
+ logprobs: Optional[bool]
72
+
73
+ longitude: Optional[float]
74
+
75
+ max_tokens: Optional[int]
76
+
77
+ n: Optional[int]
78
+
79
+ num_images: int
80
+
81
+ num_search_results: int
82
+
83
+ parallel_tool_calls: Optional[bool]
84
+
85
+ presence_penalty: Optional[float]
86
+
87
+ ranking_model: Optional[str]
88
+
89
+ reasoning_effort: Optional[Literal["minimal", "low", "medium", "high"]]
90
+
91
+ response_format: Optional[ResponseFormat]
92
+
93
+ response_metadata: Optional[Dict[str, object]]
35
94
 
36
- Higher effort = more thorough but more tokens
37
- """
95
+ return_images: Optional[bool]
38
96
 
39
- return_images: bool
40
- """Whether to include images in search results"""
97
+ return_related_questions: Optional[bool]
41
98
 
42
- return_related_questions: bool
43
- """Whether to return related questions"""
99
+ safe_search: Optional[bool]
44
100
 
45
101
  search_after_date_filter: Optional[str]
46
- """Only include content published after this date (YYYY-MM-DD)"""
47
102
 
48
103
  search_before_date_filter: Optional[str]
49
- """Only include content published before this date (YYYY-MM-DD)"""
50
104
 
51
105
  search_domain_filter: Optional[SequenceNotStr[str]]
52
- """List of domains to limit search results to. Use '-' prefix to exclude domains"""
106
+
107
+ search_internal_properties: Optional[Dict[str, object]]
53
108
 
54
109
  search_mode: Optional[Literal["web", "academic", "sec"]]
55
- """
56
- Type of search: 'web' for general, 'academic' for scholarly, 'sec' for SEC
57
- filings
58
- """
59
110
 
60
111
  search_recency_filter: Optional[Literal["hour", "day", "week", "month", "year"]]
61
- """Filter results by how recently they were published"""
112
+
113
+ search_tenant: Optional[str]
114
+
115
+ stop: Union[str, SequenceNotStr[str], None]
116
+
117
+ stream: Optional[bool]
118
+
119
+ temperature: Optional[float]
120
+
121
+ tool_choice: Optional[Literal["none", "auto", "required"]]
122
+
123
+ tools: Optional[Iterable[Tool]]
124
+
125
+ top_k: Optional[int]
126
+
127
+ top_logprobs: Optional[int]
128
+
129
+ top_p: Optional[float]
130
+
131
+ updated_after_timestamp: Optional[int]
132
+
133
+ updated_before_timestamp: Optional[int]
62
134
 
63
135
  web_search_options: WebSearchOptions
64
136
 
65
137
 
138
+ class DebugParams(TypedDict, total=False):
139
+ summarizer_model_override: Optional[str]
140
+
141
+ summarizer_prompt_override: Optional[str]
142
+
143
+
144
+ class ResponseFormatResponseFormatText(TypedDict, total=False):
145
+ type: Required[Literal["text"]]
146
+
147
+
148
+ class ResponseFormatResponseFormatJsonSchemaJsonSchema(TypedDict, total=False):
149
+ schema: Required[Dict[str, object]]
150
+
151
+ description: Optional[str]
152
+
153
+ name: Optional[str]
154
+
155
+ strict: Optional[bool]
156
+
157
+
158
+ class ResponseFormatResponseFormatJsonSchema(TypedDict, total=False):
159
+ json_schema: Required[ResponseFormatResponseFormatJsonSchemaJsonSchema]
160
+
161
+ type: Required[Literal["json_schema"]]
162
+
163
+
164
+ class ResponseFormatResponseFormatRegexRegex(TypedDict, total=False):
165
+ regex: Required[str]
166
+
167
+ description: Optional[str]
168
+
169
+ name: Optional[str]
170
+
171
+ strict: Optional[bool]
172
+
173
+
174
+ class ResponseFormatResponseFormatRegex(TypedDict, total=False):
175
+ regex: Required[ResponseFormatResponseFormatRegexRegex]
176
+
177
+ type: Required[Literal["regex"]]
178
+
179
+
180
+ ResponseFormat: TypeAlias = Union[
181
+ ResponseFormatResponseFormatText, ResponseFormatResponseFormatJsonSchema, ResponseFormatResponseFormatRegex
182
+ ]
183
+
184
+
185
+ class ToolFunctionParameters(TypedDict, total=False):
186
+ properties: Required[Dict[str, object]]
187
+
188
+ type: Required[str]
189
+
190
+ additional_properties: Optional[bool]
191
+
192
+ required: Optional[SequenceNotStr[str]]
193
+
194
+
195
+ class ToolFunction(TypedDict, total=False):
196
+ description: Required[str]
197
+
198
+ name: Required[str]
199
+
200
+ parameters: Required[ToolFunctionParameters]
201
+
202
+ strict: Optional[bool]
203
+
204
+
205
+ class Tool(TypedDict, total=False):
206
+ function: Required[ToolFunction]
207
+
208
+ type: Required[Literal["function"]]
209
+
210
+
66
211
  class WebSearchOptionsUserLocation(TypedDict, total=False):
67
212
  city: Optional[str]
68
213
 
69
214
  country: Optional[str]
70
- """Two-letter ISO country code"""
71
215
 
72
216
  latitude: Optional[float]
73
217
 
74
218
  longitude: Optional[float]
75
219
 
76
220
  region: Optional[str]
77
- """State/province name"""
78
221
 
79
222
 
80
223
  class WebSearchOptions(TypedDict, total=False):
81
- image_search_relevance_enhanced: bool
82
- """Improves relevance of image search results"""
224
+ image_results_enhanced_relevance: bool
83
225
 
84
226
  search_context_size: Literal["low", "medium", "high"]
85
- """
86
- Amount of search context retrieved: low (cost-saving), medium (balanced), high
87
- (comprehensive)
88
- """
89
227
 
90
- user_location: WebSearchOptionsUserLocation
228
+ search_type: Literal["fast", "pro", "auto"]
229
+
230
+ user_location: Optional[WebSearchOptionsUserLocation]
@@ -1,30 +1,33 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import List, Optional
4
+ from typing_extensions import Literal
4
5
 
5
6
  from ..._models import BaseModel
7
+ from ..shared.choice import Choice
6
8
  from ..shared.usage_info import UsageInfo
7
- from ..shared.chat_choice import ChatChoice
8
- from ..shared.search_result import SearchResult
9
+ from ..shared.api_public_search_result import APIPublicSearchResult
9
10
 
10
11
  __all__ = ["CompletionCreateResponse"]
11
12
 
12
13
 
13
14
  class CompletionCreateResponse(BaseModel):
14
15
  id: str
15
- """Unique identifier for the chat completion"""
16
16
 
17
- choices: List[ChatChoice]
17
+ choices: List[Choice]
18
18
 
19
19
  created: int
20
- """Unix timestamp of creation"""
21
20
 
22
21
  model: str
23
- """The model used"""
24
-
25
- object: str
26
22
 
27
23
  usage: UsageInfo
28
24
 
29
- search_results: Optional[List[SearchResult]] = None
30
- """Search results used in generating the response"""
25
+ citations: Optional[List[str]] = None
26
+
27
+ object: Optional[str] = None
28
+
29
+ search_results: Optional[List[APIPublicSearchResult]] = None
30
+
31
+ status: Optional[Literal["PENDING", "COMPLETED"]] = None
32
+
33
+ type: Optional[Literal["message", "info", "end_of_stream"]] = None
@@ -12,51 +12,27 @@ __all__ = ["SearchCreateParams"]
12
12
 
13
13
  class SearchCreateParams(TypedDict, total=False):
14
14
  query: Required[Union[str, SequenceNotStr[str]]]
15
- """Search query string or array of query strings to search for"""
16
15
 
17
16
  country: Optional[str]
18
- """Country code to bias search results towards (e.g., 'US', 'GB', 'CA')"""
19
17
 
20
18
  last_updated_after_filter: Optional[str]
21
- """Only include results last updated after this date (ISO 8601 format: YYYY-MM-DD)"""
22
19
 
23
20
  last_updated_before_filter: Optional[str]
24
- """
25
- Only include results last updated before this date (ISO 8601 format: YYYY-MM-DD)
26
- """
27
21
 
28
22
  max_results: int
29
- """Maximum number of search results to return"""
30
23
 
31
24
  max_tokens: int
32
- """Maximum number of tokens to return across all results"""
33
25
 
34
26
  max_tokens_per_page: int
35
- """Maximum number of tokens to return per individual search result"""
36
27
 
37
28
  safe_search: Optional[bool]
38
- """Enable safe search filtering to exclude adult content"""
39
29
 
40
30
  search_after_date_filter: Optional[str]
41
- """Only include results published after this date (ISO 8601 format: YYYY-MM-DD)"""
42
31
 
43
32
  search_before_date_filter: Optional[str]
44
- """Only include results published before this date (ISO 8601 format: YYYY-MM-DD)"""
45
33
 
46
34
  search_domain_filter: Optional[SequenceNotStr[str]]
47
- """
48
- List of domains to restrict search results to (e.g., ['example.com',
49
- 'another.com'])
50
- """
51
35
 
52
36
  search_mode: Optional[Literal["web", "academic", "sec"]]
53
- """
54
- Type of search to perform: 'web' for general web search, 'academic' for
55
- scholarly articles, 'sec' for SEC filings
56
- """
57
37
 
58
38
  search_recency_filter: Optional[Literal["hour", "day", "week", "month", "year"]]
59
- """
60
- Filter results by how recently they were published (hour, day, week, month, or
61
- year)
62
- """
@@ -9,24 +9,17 @@ __all__ = ["SearchCreateResponse", "Result"]
9
9
 
10
10
  class Result(BaseModel):
11
11
  snippet: str
12
- """A brief excerpt or summary of the page content"""
13
12
 
14
13
  title: str
15
- """The title of the search result page"""
16
14
 
17
15
  url: str
18
- """The URL of the search result page"""
19
16
 
20
17
  date: Optional[str] = None
21
- """The publication date of the content (if available)"""
22
18
 
23
19
  last_updated: Optional[str] = None
24
- """When the content was last updated (if available)"""
25
20
 
26
21
 
27
22
  class SearchCreateResponse(BaseModel):
28
23
  id: str
29
- """Unique identifier for this search request"""
30
24
 
31
25
  results: List[Result]
32
- """Array of search result pages matching the query"""
@@ -1,6 +1,7 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ from .choice import Choice as Choice
3
4
  from .usage_info import UsageInfo as UsageInfo
4
- from .chat_choice import ChatChoice as ChatChoice
5
- from .chat_message import ChatMessage as ChatMessage
6
- from .search_result import SearchResult as SearchResult
5
+ from .chat_message_input import ChatMessageInput as ChatMessageInput
6
+ from .chat_message_output import ChatMessageOutput as ChatMessageOutput
7
+ from .api_public_search_result import APIPublicSearchResult as APIPublicSearchResult
@@ -4,12 +4,16 @@ from typing import Optional
4
4
 
5
5
  from ..._models import BaseModel
6
6
 
7
- __all__ = ["SearchResult"]
7
+ __all__ = ["APIPublicSearchResult"]
8
8
 
9
9
 
10
- class SearchResult(BaseModel):
10
+ class APIPublicSearchResult(BaseModel):
11
11
  title: str
12
12
 
13
13
  url: str
14
14
 
15
15
  date: Optional[str] = None
16
+
17
+ last_updated: Optional[str] = None
18
+
19
+ snippet: Optional[str] = None
@@ -0,0 +1,212 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Union, Optional
4
+ from typing_extensions import Literal, TypeAlias
5
+
6
+ from ..._models import BaseModel
7
+ from .api_public_search_result import APIPublicSearchResult
8
+
9
+ __all__ = [
10
+ "ChatMessageInput",
11
+ "ContentStructuredContent",
12
+ "ContentStructuredContentChatMessageContentTextChunk",
13
+ "ContentStructuredContentChatMessageContentImageChunk",
14
+ "ContentStructuredContentChatMessageContentImageChunkImageURL",
15
+ "ContentStructuredContentChatMessageContentImageChunkImageURLURL",
16
+ "ContentStructuredContentChatMessageContentFileChunk",
17
+ "ContentStructuredContentChatMessageContentFileChunkFileURL",
18
+ "ContentStructuredContentChatMessageContentFileChunkFileURLURL",
19
+ "ContentStructuredContentChatMessageContentPdfChunk",
20
+ "ContentStructuredContentChatMessageContentPdfChunkPdfURL",
21
+ "ContentStructuredContentChatMessageContentPdfChunkPdfURLURL",
22
+ "ContentStructuredContentChatMessageContentVideoChunk",
23
+ "ContentStructuredContentChatMessageContentVideoChunkVideoURL",
24
+ "ContentStructuredContentChatMessageContentVideoChunkVideoURLVideoURL",
25
+ "ReasoningStep",
26
+ "ReasoningStepAgentProgress",
27
+ "ReasoningStepBrowserAgent",
28
+ "ReasoningStepBrowserToolExecution",
29
+ "ReasoningStepExecutePython",
30
+ "ReasoningStepFetchURLContent",
31
+ "ReasoningStepFileAttachmentSearch",
32
+ "ReasoningStepWebSearch",
33
+ "ToolCall",
34
+ "ToolCallFunction",
35
+ ]
36
+
37
+
38
+ class ContentStructuredContentChatMessageContentTextChunk(BaseModel):
39
+ text: str
40
+
41
+ type: Literal["text"]
42
+
43
+
44
+ class ContentStructuredContentChatMessageContentImageChunkImageURLURL(BaseModel):
45
+ url: str
46
+
47
+
48
+ ContentStructuredContentChatMessageContentImageChunkImageURL: TypeAlias = Union[
49
+ ContentStructuredContentChatMessageContentImageChunkImageURLURL, str
50
+ ]
51
+
52
+
53
+ class ContentStructuredContentChatMessageContentImageChunk(BaseModel):
54
+ image_url: ContentStructuredContentChatMessageContentImageChunkImageURL
55
+
56
+ type: Literal["image_url"]
57
+
58
+
59
+ class ContentStructuredContentChatMessageContentFileChunkFileURLURL(BaseModel):
60
+ url: str
61
+
62
+
63
+ ContentStructuredContentChatMessageContentFileChunkFileURL: TypeAlias = Union[
64
+ ContentStructuredContentChatMessageContentFileChunkFileURLURL, str
65
+ ]
66
+
67
+
68
+ class ContentStructuredContentChatMessageContentFileChunk(BaseModel):
69
+ file_url: ContentStructuredContentChatMessageContentFileChunkFileURL
70
+
71
+ type: Literal["file_url"]
72
+
73
+ file_name: Optional[str] = None
74
+
75
+
76
+ class ContentStructuredContentChatMessageContentPdfChunkPdfURLURL(BaseModel):
77
+ url: str
78
+
79
+
80
+ ContentStructuredContentChatMessageContentPdfChunkPdfURL: TypeAlias = Union[
81
+ ContentStructuredContentChatMessageContentPdfChunkPdfURLURL, str
82
+ ]
83
+
84
+
85
+ class ContentStructuredContentChatMessageContentPdfChunk(BaseModel):
86
+ pdf_url: ContentStructuredContentChatMessageContentPdfChunkPdfURL
87
+
88
+ type: Literal["pdf_url"]
89
+
90
+
91
+ class ContentStructuredContentChatMessageContentVideoChunkVideoURLVideoURL(BaseModel):
92
+ url: str
93
+
94
+ frame_interval: Union[str, int, None] = None
95
+
96
+
97
+ ContentStructuredContentChatMessageContentVideoChunkVideoURL: TypeAlias = Union[
98
+ ContentStructuredContentChatMessageContentVideoChunkVideoURLVideoURL, str
99
+ ]
100
+
101
+
102
+ class ContentStructuredContentChatMessageContentVideoChunk(BaseModel):
103
+ type: Literal["video_url"]
104
+
105
+ video_url: ContentStructuredContentChatMessageContentVideoChunkVideoURL
106
+
107
+
108
+ ContentStructuredContent: TypeAlias = Union[
109
+ ContentStructuredContentChatMessageContentTextChunk,
110
+ ContentStructuredContentChatMessageContentImageChunk,
111
+ ContentStructuredContentChatMessageContentFileChunk,
112
+ ContentStructuredContentChatMessageContentPdfChunk,
113
+ ContentStructuredContentChatMessageContentVideoChunk,
114
+ ]
115
+
116
+
117
+ class ReasoningStepAgentProgress(BaseModel):
118
+ action: Optional[str] = None
119
+
120
+ screenshot: Optional[str] = None
121
+
122
+ url: Optional[str] = None
123
+
124
+
125
+ class ReasoningStepBrowserAgent(BaseModel):
126
+ result: str
127
+
128
+ url: str
129
+
130
+
131
+ class ReasoningStepBrowserToolExecution(BaseModel):
132
+ tool: Dict[str, object]
133
+
134
+
135
+ class ReasoningStepExecutePython(BaseModel):
136
+ code: str
137
+
138
+ result: str
139
+
140
+
141
+ class ReasoningStepFetchURLContent(BaseModel):
142
+ contents: List[APIPublicSearchResult]
143
+
144
+
145
+ class ReasoningStepFileAttachmentSearch(BaseModel):
146
+ attachment_urls: List[str]
147
+
148
+
149
+ class ReasoningStepWebSearch(BaseModel):
150
+ search_keywords: List[str]
151
+
152
+ search_results: List[APIPublicSearchResult]
153
+
154
+
155
+ class ReasoningStep(BaseModel):
156
+ thought: str
157
+
158
+ type: Literal[
159
+ "web_search",
160
+ "fetch_url_content",
161
+ "execute_python",
162
+ "agent_progress",
163
+ "browser_agent",
164
+ "browser_tool_execution",
165
+ "file_attachment_search",
166
+ ]
167
+
168
+ agent_progress: Optional[ReasoningStepAgentProgress] = None
169
+ """Agent progress class for live-browsing updates"""
170
+
171
+ browser_agent: Optional[ReasoningStepBrowserAgent] = None
172
+ """Browser agent step summary class"""
173
+
174
+ browser_tool_execution: Optional[ReasoningStepBrowserToolExecution] = None
175
+ """Tool input for kicking off browser tool automation"""
176
+
177
+ execute_python: Optional[ReasoningStepExecutePython] = None
178
+ """Code generation step details wrapper class"""
179
+
180
+ fetch_url_content: Optional[ReasoningStepFetchURLContent] = None
181
+ """Fetch url content step details wrapper class"""
182
+
183
+ file_attachment_search: Optional[ReasoningStepFileAttachmentSearch] = None
184
+ """File attachment search step details wrapper class"""
185
+
186
+ web_search: Optional[ReasoningStepWebSearch] = None
187
+ """Web search step details wrapper class"""
188
+
189
+
190
+ class ToolCallFunction(BaseModel):
191
+ arguments: Optional[str] = None
192
+
193
+ name: Optional[str] = None
194
+
195
+
196
+ class ToolCall(BaseModel):
197
+ id: Optional[str] = None
198
+
199
+ function: Optional[ToolCallFunction] = None
200
+
201
+ type: Optional[Literal["function"]] = None
202
+
203
+
204
+ class ChatMessageInput(BaseModel):
205
+ content: Union[str, List[ContentStructuredContent]]
206
+
207
+ role: Literal["system", "user", "assistant", "tool"]
208
+ """Chat roles enum"""
209
+
210
+ reasoning_steps: Optional[List[ReasoningStep]] = None
211
+
212
+ tool_calls: Optional[List[ToolCall]] = None