Skip to content

Commit 9cf18b6

Browse files
authored
[AI Agents] v1.1.0b4 features (Azure#35788)
* [AI Agents] v1.1.0b4 features * add madeOptional decorator to toolOutputs member * [AI Agents] MCP tool typespec (Azure#35504) * [AI Agents] MCP tool typespec * update typespec * add mcp tool type * add submit_tool_approval required action * tsp compile output * add submitToolApprovals route * corrections from npx tsv * add version annotation to mcp agentNamedToolChoice * add mcp run step * add "always" string to requireApproval, update npx tsv * add tool_resources to CreateRunOptions * add submitToolApprovalDetails * update submit_tool_outputs route to handle approvals * Update models.tsp * npx tsv . * make createRun internal for .NET * add line break to models * Update tspconfig.yaml * Update tspconfig.yaml * review feedback * add example for upload file * add create thread json * update create thread * add json for run operations * npx tsv output * update jsons * correct runs swagger json * swagger updates * swagger updates 2 * swagger updates * swagger updates 3 * swagger updates 4 * swagger updates 5 * swagger changes 6 * swagger updates 7 * swagger updates 8 * swagger prettier * swagger prettier 2 * swagger prettier 3
1 parent 1bb4dc0 commit 9cf18b6

File tree

51 files changed

+5585
-6
lines changed

Some content is hidden

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

51 files changed

+5585
-6
lines changed

specification/ai/Azure.AI.Agents/client.tsp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ using Azure.AI.Agents;
7373
);
7474

7575
// nested Runs interface
76+
@@access(Azure.AI.Agents.Runs.createRun, Access.internal, "csharp");
77+
@@clientName(Azure.AI.Agents.Runs.createRun, "InternalCreateRun", "csharp");
7678
@@clientName(Azure.AI.Agents.Runs.createRun, "create", "python");
7779
@@clientName(Azure.AI.Agents.Runs.listRuns, "list", "python");
7880
@@clientName(Azure.AI.Agents.Runs.getRun, "get", "python");
Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
{
2+
"title": "CreateThreadAndRun_MaximumSet",
3+
"operationId": "CreateThreadAndRun",
4+
"parameters": {
5+
"api-version": "2025-05-15-preview",
6+
"body": {
7+
"assistant_id": "asst_abc123",
8+
"thread": {
9+
"messages": [
10+
{
11+
"role": "user",
12+
"content": {
13+
"text": "I need help with data analysis",
14+
"blocks": [
15+
{
16+
"type": "text",
17+
"text": "Please analyze this dataset and provide insights"
18+
},
19+
{
20+
"type": "image_file",
21+
"image_file": {
22+
"file_id": "file_abc123",
23+
"detail": "high"
24+
}
25+
}
26+
]
27+
},
28+
"attachments": [
29+
{
30+
"file_id": "file_abc123",
31+
"data_source": {
32+
"uri": "https://example.com/data.xlsx",
33+
"type": "uri_asset"
34+
},
35+
"tools": [
36+
{
37+
"type": "code_interpreter"
38+
},
39+
{
40+
"type": "file_search"
41+
}
42+
]
43+
}
44+
]
45+
}
46+
],
47+
"tool_resources": {
48+
"code_interpreter": {
49+
"file_ids": [
50+
"file_abc123",
51+
"file_def456"
52+
],
53+
"data_sources": [
54+
{
55+
"uri": "https://example.com/data1.csv",
56+
"type": "uri_asset"
57+
},
58+
{
59+
"uri": "https://example.com/data2.csv",
60+
"type": "uri_asset"
61+
}
62+
]
63+
},
64+
"file_search": {
65+
"vector_store_ids": [
66+
"vs_abc123"
67+
],
68+
"vector_stores": [
69+
{
70+
"name": "research_docs",
71+
"configuration": {
72+
"data_sources": [
73+
{
74+
"uri": "https://example.com/research.pdf",
75+
"type": "uri_asset"
76+
}
77+
]
78+
}
79+
}
80+
]
81+
},
82+
"azure_ai_search": {
83+
"indexes": [
84+
{
85+
"index_connection_id": "conn_abc123",
86+
"index_name": "product_index",
87+
"query_type": "simple",
88+
"top_k": 10,
89+
"filter": "category eq 'electronics'",
90+
"index_asset_id": "idx_abc123"
91+
}
92+
]
93+
}
94+
},
95+
"metadata": {
96+
"project": "data_analysis",
97+
"priority": "high"
98+
}
99+
},
100+
"model": "gpt-4",
101+
"instructions": "You are a data analysis expert. Provide detailed insights and recommendations.",
102+
"tools": [
103+
{
104+
"type": "code_interpreter"
105+
},
106+
{
107+
"type": "file_search"
108+
},
109+
{
110+
"type": "function",
111+
"function": {
112+
"name": "analyze_trend",
113+
"description": "Analyze data trends",
114+
"parameters": {
115+
"type": "object",
116+
"properties": {
117+
"data": {
118+
"type": "array"
119+
},
120+
"timeframe": {
121+
"type": "string"
122+
}
123+
}
124+
}
125+
}
126+
}
127+
],
128+
"tool_resources": {
129+
"code_interpreter": {
130+
"file_ids": [
131+
"file_abc123",
132+
"file_def456"
133+
],
134+
"data_sources": [
135+
{
136+
"uri": "https://example.com/global_data.csv",
137+
"type": "uri_asset"
138+
}
139+
]
140+
},
141+
"file_search": {
142+
"vector_store_ids": [
143+
"vs_abc123"
144+
]
145+
}
146+
},
147+
"stream": false,
148+
"truncation_strategy": {
149+
"type": "auto"
150+
},
151+
"tool_choice": "auto",
152+
"response_format": {
153+
"type": "text"
154+
},
155+
"parallel_tool_calls": true,
156+
"metadata": {
157+
"experiment_id": "exp_123",
158+
"session": "analysis_session_1"
159+
}
160+
}
161+
},
162+
"responses": {
163+
"200": {
164+
"body": {
165+
"id": "run_abc123",
166+
"object": "thread.run",
167+
"thread_id": "thread_abc123",
168+
"assistant_id": "asst_abc123",
169+
"status": "in_progress",
170+
"required_action": {
171+
"type": "submit_tool_outputs",
172+
"submit_tool_outputs": {
173+
"tool_calls": [
174+
{
175+
"id": "call_abc123",
176+
"type": "function",
177+
"function": {
178+
"name": "calculate_metrics",
179+
"arguments": "{\"values\": [1, 2, 3, 4, 5], \"metric_type\": \"mean\"}"
180+
}
181+
}
182+
]
183+
}
184+
},
185+
"last_error": {
186+
"code": "server_error",
187+
"message": "jadlgjrkhbhukfc"
188+
},
189+
"model": "gpt-4",
190+
"instructions": "You are a data analysis expert. Provide detailed insights and recommendations.",
191+
"tools": [
192+
{
193+
"type": "code_interpreter"
194+
},
195+
{
196+
"type": "file_search"
197+
},
198+
{
199+
"type": "function",
200+
"function": {
201+
"name": "analyze_trend",
202+
"description": "Analyze data trends",
203+
"parameters": {
204+
"type": "object",
205+
"properties": {
206+
"data": {
207+
"type": "array"
208+
},
209+
"timeframe": {
210+
"type": "string"
211+
}
212+
}
213+
}
214+
}
215+
}
216+
],
217+
"created_at": 1736869200,
218+
"expires_at": 1736872800,
219+
"started_at": 1736869201,
220+
"completed_at": 12,
221+
"cancelled_at": 18,
222+
"failed_at": 15,
223+
"incomplete_details": {
224+
"reason": "content_filter"
225+
},
226+
"usage": {
227+
"completion_tokens": 25,
228+
"prompt_tokens": 2,
229+
"total_tokens": 10
230+
},
231+
"temperature": 0.7,
232+
"top_p": 0.9,
233+
"max_prompt_tokens": 4096,
234+
"max_completion_tokens": 2048,
235+
"truncation_strategy": {
236+
"type": "auto"
237+
},
238+
"tool_choice": "auto",
239+
"response_format": {
240+
"type": "text"
241+
},
242+
"tool_resources": {
243+
"code_interpreter": {
244+
"file_ids": [
245+
"file_abc123",
246+
"file_def456"
247+
],
248+
"data_sources": [
249+
{
250+
"uri": "https://example.com/global_data.csv",
251+
"type": "uri_asset"
252+
}
253+
]
254+
},
255+
"file_search": {
256+
"vector_store_ids": [
257+
"vs_abc123"
258+
]
259+
}
260+
},
261+
"parallel_tool_calls": true,
262+
"metadata": {
263+
"experiment_id": "exp_123",
264+
"session": "analysis_session_1"
265+
}
266+
}
267+
}
268+
}
269+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"title": "CreateThreadAndRun_MinimumSet",
3+
"operationId": "CreateThreadAndRun",
4+
"parameters": {
5+
"api-version": "2025-05-15-preview",
6+
"body": {
7+
"assistant_id": "asst_abc123"
8+
}
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"id": "run_abc123",
14+
"object": "thread.run",
15+
"thread_id": "thread_abc123",
16+
"assistant_id": "asst_abc123",
17+
"status": "queued",
18+
"required_action": {
19+
"type": "submit_tool_outputs",
20+
"submit_tool_outputs": {
21+
"tool_calls": [
22+
{
23+
"id": "call_abc123",
24+
"type": "function",
25+
"function": {
26+
"name": "calculate_metrics",
27+
"arguments": "{\"values\": [1, 2, 3, 4, 5], \"metric_type\": \"mean\"}"
28+
}
29+
}
30+
]
31+
}
32+
},
33+
"last_error": {
34+
"code": "server_error",
35+
"message": "jadlgjrkhbhukfc"
36+
},
37+
"model": "gpt-4",
38+
"instructions": "You are a helpful assistant.",
39+
"tools": [
40+
null
41+
],
42+
"created_at": 1736869200,
43+
"expires_at": 1736872800,
44+
"started_at": 5,
45+
"completed_at": 12,
46+
"cancelled_at": 18,
47+
"failed_at": 15,
48+
"incomplete_details": {
49+
"reason": "content_filter"
50+
},
51+
"usage": {
52+
"completion_tokens": 25,
53+
"prompt_tokens": 2,
54+
"total_tokens": 10
55+
},
56+
"temperature": 0.7,
57+
"top_p": 0.9,
58+
"max_prompt_tokens": 4096,
59+
"max_completion_tokens": 2048,
60+
"truncation_strategy": {
61+
"type": "auto"
62+
},
63+
"tool_choice": {
64+
"type": "function",
65+
"function": {
66+
"name": "calculate_metrics"
67+
}
68+
},
69+
"response_format": {
70+
"type": "text"
71+
},
72+
"tool_resources": {},
73+
"parallel_tool_calls": true,
74+
"metadata": {}
75+
}
76+
}
77+
}
78+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"title": "Files_UploadFile_MaximumSet",
3+
"operationId": "Files_UploadFile",
4+
"parameters": {
5+
"api-version": "2025-05-15-preview",
6+
"purpose": "fine-tune",
7+
"file": [
8+
0,
9+
1,
10+
0,
11+
1,
12+
0
13+
],
14+
"filename": "q"
15+
},
16+
"responses": {
17+
"200": {
18+
"body": {
19+
"object": "file",
20+
"id": "zhbn",
21+
"bytes": 7,
22+
"filename": "q",
23+
"created_at": 17,
24+
"purpose": "fine-tune",
25+
"status": "uploaded",
26+
"status_details": "kgcllmehsrzwegmcrz"
27+
}
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)