forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure OpenAI: 2024-07-01-preview TypeSpec project updates (Azure#29785)
* (incomplete) some initial definitions * chunking strategy + examples * examples * readme+fixing examples * file examples for inference * different model for request/response * Fixing inference readme + bing search tool * format * updated the batches routes * no warnings for batches! * added batch examples * [OpenAI] `v2024_07_01_preview` service release remaining points (Azure#29967) * TSP changes * Compilation related swagger gen * Removed unused comment section * post-merge: format/compile and address example JSON warnings * prettier, spellcheck, example fixes * npx tsp format **/*tsp * more example and validation fixes * one more fix * Added mismatched code block marker * Commented out service team entry in the readme * remove deferred parallel_tool_calls * defer 'browser' tool to future version (removing it) * Uncommented entry for service release * Recompiled project * Adding the only method that works * Adding model to be emitted in the custom model subpackage * Updated useDependency version for client and removed nullability from constant * Added compiler warning supressions * format fixes for assistants * Using OpenAIPageableListOf type as in assistants * remove stream_options * TSP validtion check * Update specification/cognitiveservices/OpenAI.Inference/routes/batches.tsp Verified against service spec and OpenAI spec Co-authored-by: Shawn Fang <45607042+mssfang@users.noreply.github.com> * make license optional * Adding missing documentation to query params in get batches list * Made page of data fields optional * Project compile * Added request object for batches as full model instead of spreading it * Reverted statusCode 201 change for batches create op * Example fix and statusCode correct swagger gen * Reformat * reformat --------- Co-authored-by: Gerardo Lecaros <10088504+glecaros@users.noreply.github.com> Co-authored-by: Chris Schraer <chris_schraer@users.noreply.github.com> Co-authored-by: Jose Alvarez <jpalvarezl@users.noreply.github.com> Co-authored-by: Jose Alvarez <jp.alvarezl@gmail.com> Co-authored-by: Jose Alvarez <josealvar@microsoft.com> Co-authored-by: Shawn Fang <45607042+mssfang@users.noreply.github.com> Co-authored-by: Minh-Anh Phan <111523473+minhanh-phan@users.noreply.github.com>
- Loading branch information
1 parent
0e24997
commit cd41ba3
Showing
150 changed files
with
18,282 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
specification/ai/OpenAI.Assistants/examples/2024-07-01-preview/cancel_run.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"title": "Cancels a run that is `in_progress`.\n", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"threadId": "thread_abc123", | ||
"runId": "run_abc123" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "run_abc123", | ||
"object": "thread.run", | ||
"created_at": 1699076126, | ||
"assistant_id": "asst_abc123", | ||
"thread_id": "thread_abc123", | ||
"status": "cancelling", | ||
"started_at": 1699076126, | ||
"expires_at": 1699076726, | ||
"cancelled_at": null, | ||
"failed_at": null, | ||
"completed_at": null, | ||
"last_error": null, | ||
"model": "gpt-4-turbo", | ||
"instructions": "You summarize books.", | ||
"tools": [ | ||
{ | ||
"type": "file_search" | ||
} | ||
], | ||
"tool_choice": "auto", | ||
"truncation_strategy": { | ||
"type": "auto", | ||
"last_messages": null | ||
}, | ||
"max_completion_tokens": 1000, | ||
"max_prompt_tokens": 1000, | ||
"incomplete_details": null, | ||
"metadata": {}, | ||
"usage": null, | ||
"temperature": 1.0, | ||
"top_p": 1.0, | ||
"response_format": "auto" | ||
} | ||
} | ||
}, | ||
"operationId": "CancelRun" | ||
} |
28 changes: 28 additions & 0 deletions
28
...tion/ai/OpenAI.Assistants/examples/2024-07-01-preview/cancel_vector_store_file_batch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"title": "Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"vectorStoreId": "vs_abc123", | ||
"batchId": "vsfb_abc123" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "vsfb_abc123", | ||
"object": "vector_store.files_batch", | ||
"created_at": 1699061776, | ||
"vector_store_id": "vs_abc123", | ||
"status": "cancelling", | ||
"file_counts": { | ||
"in_progress": 12, | ||
"completed": 3, | ||
"failed": 0, | ||
"cancelled": 0, | ||
"total": 15 | ||
} | ||
} | ||
} | ||
}, | ||
"operationId": "CancelVectorStoreFileBatch" | ||
} |
41 changes: 41 additions & 0 deletions
41
specification/ai/OpenAI.Assistants/examples/2024-07-01-preview/create_assistant.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"title": "Create an assistant with a model and instructions.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"body": { | ||
"name": "Math Tutor", | ||
"instructions": "When a customer asks about a specific math problem, use Python to evaluate their query.", | ||
"tools": [ | ||
{ | ||
"type": "code_interpreter" | ||
} | ||
], | ||
"model": "gpt-4-1106-preview" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "asst_4nsG2qgNzimRPE7MazXTXbU7", | ||
"object": "assistant", | ||
"created_at": 1707295707, | ||
"name": "Math Tutor", | ||
"description": null, | ||
"model": "gpt-4-1106-preview", | ||
"instructions": "When a customer asks about a specific math problem, use Python to evaluate their query.", | ||
"tools": [ | ||
{ | ||
"type": "code_interpreter" | ||
} | ||
], | ||
"tool_resources": {}, | ||
"metadata": {}, | ||
"top_p": 1.0, | ||
"temperature": 1.0, | ||
"response_format": "auto" | ||
} | ||
} | ||
}, | ||
"operationId": "CreateAssistant" | ||
} |
41 changes: 41 additions & 0 deletions
41
specification/ai/OpenAI.Assistants/examples/2024-07-01-preview/create_message.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"title": "Create a message.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"threadId": "thread_v7V4csrNOxtNmgcwGg496Smx", | ||
"body": { | ||
"role": "user", | ||
"content": "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces." | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "msg_as3XIk1tpVP3hdHjWBGg3uG4", | ||
"object": "thread.message", | ||
"created_at": 1707298421, | ||
"assistant_id": null, | ||
"thread_id": "thread_v7V4csrNOxtNmgcwGg496Smx", | ||
"run_id": null, | ||
"role": "user", | ||
"content": [ | ||
{ | ||
"type": "text", | ||
"text": { | ||
"value": "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces.", | ||
"annotations": [] | ||
} | ||
} | ||
], | ||
"status": "completed", | ||
"incomplete_details": null, | ||
"incomplete_at": null, | ||
"completed_at": 1707298439, | ||
"attachments": [], | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateMessage" | ||
} |
50 changes: 50 additions & 0 deletions
50
specification/ai/OpenAI.Assistants/examples/2024-07-01-preview/create_run.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"title": "Create a run.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"threadId": "thread_abc123", | ||
"body": { | ||
"assistant_id": "asst_abc123" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "run_abc123", | ||
"object": "thread.run", | ||
"created_at": 1699063290, | ||
"assistant_id": "asst_abc123", | ||
"thread_id": "thread_abc123", | ||
"status": "queued", | ||
"started_at": 1699063290, | ||
"expires_at": null, | ||
"cancelled_at": null, | ||
"failed_at": null, | ||
"completed_at": 1699063291, | ||
"last_error": null, | ||
"model": "gpt-4-turbo", | ||
"instructions": "", | ||
"incomplete_details": null, | ||
"tools": [ | ||
{ | ||
"type": "code_interpreter" | ||
} | ||
], | ||
"metadata": {}, | ||
"usage": null, | ||
"temperature": 1.0, | ||
"top_p": 1.0, | ||
"max_prompt_tokens": 1000, | ||
"max_completion_tokens": 1000, | ||
"truncation_strategy": { | ||
"type": "auto", | ||
"last_messages": null | ||
}, | ||
"response_format": "auto", | ||
"tool_choice": "auto" | ||
} | ||
} | ||
}, | ||
"operationId": "CreateRun" | ||
} |
20 changes: 20 additions & 0 deletions
20
specification/ai/OpenAI.Assistants/examples/2024-07-01-preview/create_thread.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"title": "Creates a thread.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"body": {} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "thread_v7V4csrNOxtNmgcwGg496Smx", | ||
"object": "thread", | ||
"created_at": 1707297136, | ||
"tool_resources": {}, | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateThread" | ||
} |
54 changes: 54 additions & 0 deletions
54
specification/ai/OpenAI.Assistants/examples/2024-07-01-preview/create_thread_and_run.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"title": "Create a thread and run it in one request.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"body": { | ||
"assistant_id": "asst_abc123", | ||
"thread": { | ||
"messages": [ | ||
{ | ||
"role": "user", | ||
"content": "Explain deep learning to a 5 year old." | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "run_abc123", | ||
"object": "thread.run", | ||
"created_at": 1699076792, | ||
"assistant_id": "asst_abc123", | ||
"thread_id": "thread_abc123", | ||
"status": "queued", | ||
"started_at": null, | ||
"expires_at": 1699077392, | ||
"cancelled_at": null, | ||
"failed_at": null, | ||
"completed_at": null, | ||
"required_action": null, | ||
"last_error": null, | ||
"model": "gpt-4-turbo", | ||
"instructions": "You are a helpful assistant.", | ||
"tools": [], | ||
"metadata": {}, | ||
"temperature": 1.0, | ||
"top_p": 1.0, | ||
"max_completion_tokens": null, | ||
"max_prompt_tokens": null, | ||
"truncation_strategy": { | ||
"type": "auto", | ||
"last_messages": null | ||
}, | ||
"incomplete_details": null, | ||
"usage": null, | ||
"response_format": "auto", | ||
"tool_choice": "auto" | ||
} | ||
} | ||
}, | ||
"operationId": "CreateThreadAndRun" | ||
} |
32 changes: 32 additions & 0 deletions
32
specification/ai/OpenAI.Assistants/examples/2024-07-01-preview/create_vector_store.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"title": "Creates a vector store.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"body": { | ||
"name": "Support FAQ" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "vs_abc123", | ||
"object": "vector_store", | ||
"created_at": 1699061776, | ||
"name": "Support FAQ", | ||
"usage_bytes": 139920, | ||
"status": "completed", | ||
"last_active_at": 1699061776, | ||
"metadata": {}, | ||
"file_counts": { | ||
"in_progress": 0, | ||
"completed": 3, | ||
"failed": 0, | ||
"cancelled": 0, | ||
"total": 3 | ||
} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateVectorStore" | ||
} |
28 changes: 28 additions & 0 deletions
28
specification/ai/OpenAI.Assistants/examples/2024-07-01-preview/create_vector_store_file.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"title": "Create a vector store file by attaching a File to a vector store.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"vectorStoreId": "vs_abc123", | ||
"body": { | ||
"file_id": "file-abc123" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "file-abc123", | ||
"object": "vector_store.file", | ||
"created_at": 1699061776, | ||
"usage_bytes": 1234, | ||
"vector_store_id": "vs_abcd", | ||
"status": "completed", | ||
"last_error": null, | ||
"chunking_strategy": { | ||
"type": "other" | ||
} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateVectorStoreFile" | ||
} |
33 changes: 33 additions & 0 deletions
33
...tion/ai/OpenAI.Assistants/examples/2024-07-01-preview/create_vector_store_file_batch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"title": "Create a vector store file batch.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-07-01-preview", | ||
"vectorStoreId": "vs_abc123", | ||
"body": { | ||
"file_ids": [ | ||
"file-abc123", | ||
"file-abc456" | ||
] | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "vsfb_abc123", | ||
"object": "vector_store.files_batch", | ||
"created_at": 1699061776, | ||
"vector_store_id": "vs_abc123", | ||
"status": "in_progress", | ||
"file_counts": { | ||
"in_progress": 1, | ||
"completed": 1, | ||
"failed": 0, | ||
"cancelled": 0, | ||
"total": 0 | ||
} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateVectorStoreFileBatch" | ||
} |
Oops, something went wrong.