|
71 | 71 | " \"name\": \"Zava SwiftCoat Satin\",\n", |
72 | 72 | " \"inventory\": 142\n", |
73 | 73 | " }\n", |
| 74 | + " tool_definitions = [\n", |
| 75 | + " {\n", |
| 76 | + " \"type\": \"function\",\n", |
| 77 | + " \"name\": \"inventory_lookup\",\n", |
| 78 | + " \"description\": \"Fetches inventory details for a specific product category and finish.\",\n", |
| 79 | + " \"parameters\": {\n", |
| 80 | + " \"type\": \"object\",\n", |
| 81 | + " \"properties\": {\n", |
| 82 | + " \"product_type\": {\n", |
| 83 | + " \"type\": \"string\",\n", |
| 84 | + " \"description\": \"Product category name to search.\"\n", |
| 85 | + " },\n", |
| 86 | + " \"finish\": {\n", |
| 87 | + " \"type\": \"string\",\n", |
| 88 | + " \"description\": \"Desired paint finish (e.g., satin, matte).\"\n", |
| 89 | + " }\n", |
| 90 | + " },\n", |
| 91 | + " \"required\": [\"product_type\"]\n", |
| 92 | + " }\n", |
| 93 | + " }\n", |
| 94 | + " ]\n", |
74 | 95 | " input_messages = [\n", |
75 | 96 | " {\n", |
76 | 97 | " \"role\": \"system\",\n", |
|
133 | 154 | " span.set_attribute(\"gen_ai.usage.output_tokens\", 41)\n", |
134 | 155 | " span.set_attribute(\"gen_ai.conversation.id\", conversation_id)\n", |
135 | 156 | " span.set_attribute(\"gen_ai.system_instructions\", system_prompt)\n", |
| 157 | + " span.set_attribute(\"gen_ai.tool.definitions\", json.dumps(tool_definitions, ensure_ascii=False))\n", |
136 | 158 | " span.set_attribute(\"gen_ai.input.messages\", json.dumps(input_messages, ensure_ascii=False))\n", |
137 | 159 | " span.set_attribute(\"gen_ai.output.messages\", json.dumps(output_messages, ensure_ascii=False))\n", |
138 | 160 | " span.set_attribute(\"server.address\", \"cora-agents.eastus2.inference.ai.azure.com\")\n", |
|
0 commit comments