Skip to content

Commit 8562a82

Browse files
committed
feedback
Change-Id: I63f11ca8081f71b55b793ec88f35ef64bbace8e6 Co-developed-by: Cursor <[email protected]>
1 parent 2c76210 commit 8562a82

File tree

3 files changed

+53
-44
lines changed

3 files changed

+53
-44
lines changed

docs/gen-ai/gen-ai-tool-definitions.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$defs": {
33
"ToolDefinition": {
44
"additionalProperties": true,
5+
"description": "Represents a tool definition.",
56
"properties": {
67
"type": {
78
"anyOf": [
@@ -13,7 +14,7 @@
1314
}
1415
],
1516
"description": "Type of the tool.",
16-
"title": "ToolType"
17+
"title": "Type"
1718
},
1819
"name": {
1920
"description": "Name of the tool.",
@@ -26,17 +27,20 @@
2627
"type": "string"
2728
},
2829
"parameters": {
29-
"description": "Format of the tool parameters. Maybe it is a JSON schema.",
30+
"default": null,
31+
"description": "Schema that defines the parameters accepted by the tool. The RECOMMENDED format is JSON Schema.",
3032
"title": "Parameters"
3133
},
3234
"response": {
33-
"description": "Format of the tool response. Maybe it is a JSON schema.",
35+
"default": null,
36+
"description": "Schema that defines the response returned by the tool. The RECOMMENDED format is JSON Schema.",
3437
"title": "Response"
3538
}
3639
},
3740
"required": [
3841
"type",
39-
"name"
42+
"name",
43+
"description"
4044
],
4145
"title": "ToolDefinition",
4246
"type": "object"
@@ -50,7 +54,7 @@
5054
"type": "string"
5155
}
5256
},
53-
"description": "Represents the list of tool definitions sent to the model.",
57+
"description": "Represents the list of tool definitions available to the GenAI agent or model.",
5458
"items": {
5559
"$ref": "#/$defs/ToolDefinition"
5660
},

docs/gen-ai/non-normative/examples-llm-calls.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ They are likely to be siblings if there is an encompassing span.
248248
| `gen_ai.usage.output_tokens` | `17` |
249249
| `gen_ai.usage.input_tokens` | `47` |
250250
| `gen_ai.response.finish_reasons`| `["tool_calls"]` |
251+
| `gen_ai.tool.definitions` | [`gen_ai.tool.definitions`](#gen-ai-tool-definitions-tool-call-span-0) |
252+
253+
<span id="gen-ai-tool-definitions-tool-call-span-0">`gen_ai.tool.definitions` value</span>
254+
255+
```json
256+
[
257+
{
258+
"type": "function",
259+
"name": "get_weather"
260+
}
261+
]
262+
```
251263

252264
**Tool call:**
253265

docs/gen-ai/non-normative/models.ipynb

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
" type: Literal[\"tool_call\"] = Field(description=\"The type of the content captured in this part.\")\n",
6969
" id: Optional[str] = Field(default=None, description=\"Unique identifier for the tool call.\")\n",
7070
" 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",
7272
"\n",
7373
" class Config:\n",
7474
" extra = \"allow\"\n",
@@ -139,42 +139,6 @@
139139
"metadata": {},
140140
"outputs": [],
141141
"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",
178142
"class InputMessages(RootModel[List[ChatMessage]]):\n",
179143
" \"\"\"\n",
180144
" Represents the list of input messages sent to the model.\n",
@@ -277,6 +241,35 @@
277241
"metadata": {},
278242
"outputs": [],
279243
"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",
280273
"class ToolDefinitions(RootModel[List[ToolDefinition]]):\n",
281274
" \"\"\"\n",
282275
" Represents the list of tool definitions available to the GenAI agent or model.\n",
@@ -290,7 +283,7 @@
290283
],
291284
"metadata": {
292285
"kernelspec": {
293-
"display_name": "Python 3",
286+
"display_name": "semconv",
294287
"language": "python",
295288
"name": "python3"
296289
},
@@ -304,7 +297,7 @@
304297
"name": "python",
305298
"nbconvert_exporter": "python",
306299
"pygments_lexer": "ipython3",
307-
"version": "3.13.5"
300+
"version": "3.13.7"
308301
}
309302
},
310303
"nbformat": 4,

0 commit comments

Comments
 (0)