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.
[OpenAI-Assistants] Fixing examples and avocado related CI issues (Az…
…ure#29499) * cleaned up config file * reverted name * Restored names and verified example adding behaviour for openapi2 emitter * Added example JSON files and the readme file * Added examples for past releases * Added more documentation to the script * Readme corrections * More readme corrections * Renamed retrieveAssistants examples to getAssistants to match TSP definition * Removed some swagger files * create_assistants json corrections * wip * Get Assistants * WIP * File operations * Files JSON examples * wip * wip * More various fixes * wip * wip * wip * removing bodyRoot decorator * Checking if things are actually fixed * Made expandable nullable enum into 'null' instead of null * Revert "Made expandable nullable enum into 'null' instead of null" This reverts commit 03d2bf5. * WIP * wip * Possible solution to bad @Body usage * Found better solution for version added mismatch createMessage * wip * WIP * Started with vector store stuff * More fixes for vector store stuff * More fixes * Last fixes for vector store batch files * Using string 'null' instread of JSON null * Revert "Using string 'null' instread of JSON null" This reverts commit 39fdbc6. * Corrected operationId * trying out null as a string * Revert "trying out null as a string" This reverts commit ab876a1. * Stringified nulls to make CI happy * Changed the value of instructions for ThreadRun examples. Field not nullable nor optional * Addressing metadata issue * Revert "Stringified nulls to make CI happy" This reverts commit 3dbb723. * Reverting left over stuff * TSP formatter * Prettified JSON * Added suppresion to work around bug * Removed unnecessary example files * Removed convenience scripts * Using bodyRoot again * Revert "Using bodyRoot again" This reverts commit a31f2a0. * Using BodyParameter in createMessage op * The CI seems stuck
- Loading branch information
1 parent
876c4ba
commit b195dd7
Showing
148 changed files
with
5,420 additions
and
11,711 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
specification/ai/OpenAI.Assistants/examples/2024-02-15-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,38 @@ | ||
{ | ||
"title": "Cancels a run that is `in_progress`.\n", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"threadId": "thread_eRNwflE3ncDYak1np6MdMHJh", | ||
"runId": "run_HsO8tYM4K5AAMAHgK0J3om8Q" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "run_HsO8tYM4K5AAMAHgK0J3om8Q", | ||
"object": "thread.run", | ||
"created_at": 1699076126, | ||
"assistant_id": "asst_BUf53eW0aua3EjHTyO3P3evb", | ||
"thread_id": "thread_eRNwflE3ncDYak1np6MdMHJh", | ||
"status": "cancelling", | ||
"started_at": 1699076126, | ||
"expires_at": 1699076726, | ||
"cancelled_at": null, | ||
"failed_at": null, | ||
"completed_at": null, | ||
"last_error": null, | ||
"model": "gpt-4-1106", | ||
"instructions": "You solve math problems.", | ||
"tools": [ | ||
{ | ||
"type": "code_interpreter" | ||
} | ||
], | ||
"incomplete_details": null, | ||
"metadata": {}, | ||
"usage": null | ||
} | ||
} | ||
}, | ||
"operationId": "CancelRun" | ||
} |
37 changes: 35 additions & 2 deletions
37
specification/ai/OpenAI.Assistants/examples/2024-02-15-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 |
---|---|---|
@@ -1,4 +1,37 @@ | ||
{ | ||
"title": "Assistants_CreateAssistant", | ||
"operationId": "Assistants_CreateAssistant" | ||
"title": "Create an assistant with a model and instructions.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-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_4lMdCUN4lS2SQcHEy9CM1QIt", | ||
"object": "assistant", | ||
"created_at": 1718875084, | ||
"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" | ||
} | ||
], | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateAssistant" | ||
} |
40 changes: 40 additions & 0 deletions
40
specification/ai/OpenAI.Assistants/examples/2024-02-15-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,40 @@ | ||
{ | ||
"title": "Create a message.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-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, | ||
"thread_id": "thread_v7V4csrNOxtNmgcwGg496Smx", | ||
"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, | ||
"assistant_id": null, | ||
"run_id": null, | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateMessage" | ||
} |
36 changes: 36 additions & 0 deletions
36
specification/ai/OpenAI.Assistants/examples/2024-02-15-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,36 @@ | ||
{ | ||
"title": "Create a run.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"threadId": "thread_2CTH1wOJezLOA3QRefyO3wyk", | ||
"body": { | ||
"assistant_id": "asst_w35g5ODgBl2U3KW417deY1QI" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "run_dmC5IgLBfaK8gBy0FKIXGtpr", | ||
"object": "thread.run", | ||
"created_at": 1707301142, | ||
"assistant_id": "asst_w35g5ODgBl2U3KW417deY1QI", | ||
"thread_id": "thread_2CTH1wOJezLOA3QRefyO3wyk", | ||
"status": "queued", | ||
"incomplete_details": null, | ||
"usage": null, | ||
"started_at": null, | ||
"expires_at": 1707301742, | ||
"cancelled_at": null, | ||
"failed_at": null, | ||
"completed_at": null, | ||
"last_error": null, | ||
"model": "gpt-4-1106-preview", | ||
"instructions": "You are an AI model that empowers every person and every organization on the planet to achieve more.", | ||
"tools": [], | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateRun" | ||
} |
19 changes: 19 additions & 0 deletions
19
specification/ai/OpenAI.Assistants/examples/2024-02-15-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,19 @@ | ||
{ | ||
"title": "Creates a thread.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"body": {} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "thread_v7V4csrNOxtNmgcwGg496Smx", | ||
"object": "thread", | ||
"created_at": 1707297136, | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateThread" | ||
} |
35 changes: 35 additions & 0 deletions
35
specification/ai/OpenAI.Assistants/examples/2024-02-15-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,35 @@ | ||
{ | ||
"title": "Create a thread and run it in one request.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"body": { | ||
"assistant_id": "{{assistants.id}}" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "run_jwY1tMUeOjSpq0Swwm6JqSi6", | ||
"object": "thread.run", | ||
"created_at": 1707300252, | ||
"assistant_id": "asst_se10QpYqDv7RQx13zdpskKlz", | ||
"thread_id": "thread_7CJfaYBtuRIOSksocRrYNQGV", | ||
"status": "queued", | ||
"started_at": null, | ||
"expires_at": 1707300852, | ||
"cancelled_at": null, | ||
"failed_at": null, | ||
"completed_at": null, | ||
"last_error": null, | ||
"model": "gpt-4-1106-preview", | ||
"instructions": "You are an AI model that empowers every person and every organization on the planet to achieve more.", | ||
"tools": [], | ||
"usage": null, | ||
"incomplete_details": null, | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "CreateThreadAndRun" | ||
} |
18 changes: 18 additions & 0 deletions
18
specification/ai/OpenAI.Assistants/examples/2024-02-15-preview/delete_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,18 @@ | ||
{ | ||
"title": "Deletes an assistant.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"assistantId": "asst_4nsG2qgNzimRPE7MazXTXbU7" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "asst_4nsG2qgNzimRPE7MazXTXbU7", | ||
"object": "assistant.deleted", | ||
"deleted": true | ||
} | ||
} | ||
}, | ||
"operationId": "DeleteAssistant" | ||
} |
18 changes: 18 additions & 0 deletions
18
specification/ai/OpenAI.Assistants/examples/2024-02-15-preview/delete_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,18 @@ | ||
{ | ||
"title": "Delete a previously uploaded file.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"object": "file", | ||
"deleted": true, | ||
"id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" | ||
} | ||
} | ||
}, | ||
"operationId": "DeleteFile" | ||
} |
18 changes: 18 additions & 0 deletions
18
specification/ai/OpenAI.Assistants/examples/2024-02-15-preview/delete_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,18 @@ | ||
{ | ||
"title": "Deletes a thread.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"threadId": "thread_v7V4csrNOxtNmgcwGg496Smx" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "thread_v7V4csrNOxtNmgcwGg496Smx", | ||
"object": "thread.deleted", | ||
"deleted": true | ||
} | ||
} | ||
}, | ||
"operationId": "DeleteThread" | ||
} |
28 changes: 28 additions & 0 deletions
28
specification/ai/OpenAI.Assistants/examples/2024-02-15-preview/get_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,28 @@ | ||
{ | ||
"title": "Retrieves an assistant.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"assistantId": "asst_4nsG2qgNzimRPE7MazXTXbU7" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "asst_4lMdCUN4lS2SQcHEy9CM1QIt", | ||
"object": "assistant", | ||
"created_at": 1718875084, | ||
"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" | ||
} | ||
], | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "GetAssistant" | ||
} |
21 changes: 21 additions & 0 deletions
21
specification/ai/OpenAI.Assistants/examples/2024-02-15-preview/get_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,21 @@ | ||
{ | ||
"title": "Returns a file", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"object": "file", | ||
"id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3", | ||
"purpose": "assistants", | ||
"filename": "test78686269-a3d7-4c96-be67-fecdf3f39de8.txt", | ||
"bytes": 4, | ||
"created_at": 1718886199 | ||
} | ||
} | ||
}, | ||
"operationId": "GetFile" | ||
} |
14 changes: 14 additions & 0 deletions
14
specification/ai/OpenAI.Assistants/examples/2024-02-15-preview/get_file_content.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,14 @@ | ||
{ | ||
"title": "Returns the content of a file", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": "file content" | ||
} | ||
}, | ||
"operationId": "GetFileContent" | ||
} |
37 changes: 37 additions & 0 deletions
37
specification/ai/OpenAI.Assistants/examples/2024-02-15-preview/get_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,37 @@ | ||
{ | ||
"title": "Retrieve a message.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-02-15-preview", | ||
"threadId": "thread_v7V4csrNOxtNmgcwGg496Smx", | ||
"messageId": "msg_as3XIk1tpVP3hdHjWBGg3uG4" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "msg_as3XIk1tpVP3hdHjWBGg3uG4", | ||
"object": "thread.message", | ||
"created_at": 1707298421, | ||
"thread_id": "thread_v7V4csrNOxtNmgcwGg496Smx", | ||
"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, | ||
"assistant_id": null, | ||
"run_id": null, | ||
"metadata": {} | ||
} | ||
} | ||
}, | ||
"operationId": "GetMessage" | ||
} |
Oops, something went wrong.