|
68 | 68 | " type: Literal[\"tool_call\"] = Field(description=\"The type of the content captured in this part.\")\n", |
69 | 69 | " id: Optional[str] = Field(default=None, description=\"Unique identifier for the tool call.\")\n", |
70 | 70 | " name: str = Field(description=\"Name of the tool.\")\n", |
71 | | - " arguments: Any = Field(None, description=\"Arguments for the tool call.\")\n", |
| 71 | + " arguments: Any = Field(deafult=None, description=\"Arguments for the tool call.\")\n", |
72 | 72 | "\n", |
73 | 73 | " class Config:\n", |
74 | 74 | " extra = \"allow\"\n", |
|
139 | 139 | "metadata": {}, |
140 | 140 | "outputs": [], |
141 | 141 | "source": [ |
142 | | - "class ToolType(str, Enum):\n", |
143 | | - " FUNCTION = \"function\"\n", |
144 | | - " CUSTOM = \"custom\"\n", |
145 | | - "\n", |
146 | | - "class JSONSchema(BaseModel):\n", |
147 | | - " \"\"\"\n", |
148 | | - " Represents a JSON schema to define the format of the tool parameters or response.\n", |
149 | | - " \"\"\"\n", |
150 | | - " type: str = Field(description=\"Type of the overall data.\")\n", |
151 | | - "\n", |
152 | | - " class Config:\n", |
153 | | - " extra = \"allow\"\n", |
154 | | - "\n", |
155 | | - "class ToolDefinition(BaseModel):\n", |
156 | | - " \"\"\"\n", |
157 | | - " Represents a tool definition.\n", |
158 | | - " \"\"\"\n", |
159 | | - " type: Union[ToolType, str] = Field(description=\"Type of the tool.\")\n", |
160 | | - " name: str = Field(description=\"Name of the tool.\")\n", |
161 | | - " description: str = Field(description=\"Description of the tool.\")\n", |
162 | | - " parameters: Optional[Union[JSONSchema, Any]] = Field(\n", |
163 | | - " description=(\n", |
164 | | - " \"Format of the tool parameters the function expects. \"\n", |
165 | | - " \"The RECOMMENDED data type is JSON Schema. \"\n", |
166 | | - " )\n", |
167 | | - " )\n", |
168 | | - " response: Optional[Union[JSONSchema, Any]] = Field(\n", |
169 | | - " description=(\n", |
170 | | - " \"Format of the tool response the function returns. \"\n", |
171 | | - " \"The RECOMMENDED data type is JSON Schema. \"\n", |
172 | | - " )\n", |
173 | | - " )\n", |
174 | | - "\n", |
175 | | - " class Config:\n", |
176 | | - " extra = \"allow\"\n", |
177 | | - "\n", |
178 | 142 | "class InputMessages(RootModel[List[ChatMessage]]):\n", |
179 | 143 | " \"\"\"\n", |
180 | 144 | " Represents the list of input messages sent to the model.\n", |
|
277 | 241 | "metadata": {}, |
278 | 242 | "outputs": [], |
279 | 243 | "source": [ |
| 244 | + "class ToolType(str, Enum):\n", |
| 245 | + " FUNCTION = \"function\"\n", |
| 246 | + " CUSTOM = \"custom\"\n", |
| 247 | + "\n", |
| 248 | + "class ToolDefinition(BaseModel):\n", |
| 249 | + " \"\"\"\n", |
| 250 | + " Represents a tool definition.\n", |
| 251 | + " \"\"\"\n", |
| 252 | + " type: Union[ToolType, str] = Field(description=\"Type of the tool.\")\n", |
| 253 | + " name: str = Field(description=\"Name of the tool.\")\n", |
| 254 | + " description: str = Field(description=\"Description of the tool.\")\n", |
| 255 | + " parameters: Any = Field(\n", |
| 256 | + " default=None,\n", |
| 257 | + " description=(\n", |
| 258 | + " \"Schema that defines the parameters accepted by the tool. \"\n", |
| 259 | + " \"The RECOMMENDED format is JSON Schema.\"\n", |
| 260 | + " )\n", |
| 261 | + " )\n", |
| 262 | + " response: Any = Field(\n", |
| 263 | + " default=None,\n", |
| 264 | + " description=(\n", |
| 265 | + " \"Schema that defines the response returned by the tool. \"\n", |
| 266 | + " \"The RECOMMENDED format is JSON Schema.\"\n", |
| 267 | + " )\n", |
| 268 | + " )\n", |
| 269 | + "\n", |
| 270 | + " class Config:\n", |
| 271 | + " extra = \"allow\"\n", |
| 272 | + "\n", |
280 | 273 | "class ToolDefinitions(RootModel[List[ToolDefinition]]):\n", |
281 | 274 | " \"\"\"\n", |
282 | 275 | " Represents the list of tool definitions available to the GenAI agent or model.\n", |
|
290 | 283 | ], |
291 | 284 | "metadata": { |
292 | 285 | "kernelspec": { |
293 | | - "display_name": "Python 3", |
| 286 | + "display_name": "semconv", |
294 | 287 | "language": "python", |
295 | 288 | "name": "python3" |
296 | 289 | }, |
|
304 | 297 | "name": "python", |
305 | 298 | "nbconvert_exporter": "python", |
306 | 299 | "pygments_lexer": "ipython3", |
307 | | - "version": "3.13.5" |
| 300 | + "version": "3.13.7" |
308 | 301 | } |
309 | 302 | }, |
310 | 303 | "nbformat": 4, |
|
0 commit comments