Skip to content

Commit

Permalink
Azure OpenAI Typespec definition for v2024-09-01-preview and v2024-10…
Browse files Browse the repository at this point in the history
…-01-preview service releases (#30909)

* inital baseline commit to introduce new label for diff

* non-uploads changes

* CI-uncovered fixes (primarily examples)

* uploads additions

* Update specification/cognitiveservices/OpenAI.Inference/models/completions/chat_messages.tsp

Co-authored-by: Shawn Fang <[email protected]>

* Update specification/cognitiveservices/OpenAI.Inference/models/completions/chat_messages.tsp

Co-authored-by: Jose Alvarez <[email protected]>

* [OpenAI] providing feedback in the form of a PR for the `v2024_08_01_preview` release (#30749)

* ci checks and compile

* Adding Completions/options fields

* fixed nullability

* Added missing refusal field

* Adding MongoDB index_name

* Changed types for bytes in upload object

* Adding visibility for new uploadFile Parts ops

* Added supression for mp/df op

* removing auto sample gen for java

* Restoring for older versions ChatMessageContent

* Adding nullability for refusal in response chat message

* Adding release entries in the  file

* Another past type correction to prevent unnecessary CI redflags

* Adding nullable refusal to check

* formatter

* Example corrections

* Added missing examples for new file operations

* renamed body field

* Added missing azure_block_id to part upload and corrected examples

* Specified UploadPurpose and corrected comment

* Adjusted documentation for CreateUploadRequestPurpose

* Ran formatters and re-compiled

* Moved authentication field out of OnYourDataCommonChatExtensionConfiguration

* Specified authetincation type for MongoDB

* Updated docs for max_tokens and added new max_completion_tokens

* Tsp compile

* Added deprecated directive to max_tokens field

* Added back streamOptions to completion and chatcompletion options

* Tsp compile

* added parallel_tool_calls field to ThreadRun and ChatCompletions

* tsp compile for assistants and inference

* Added parallel_tool_calls to all assistants classes

* Added changes for reasoning token in completion usage

* ran formatter

* Fixed optionality of inline model and deprecation typo

* ThreadRun.parallelToolCalls is mandatory in OpenAI

* Added examples and readme entry for Assistants for new version

* compiled assistants

* Corrected json

* Added examples for v2024-09-01-preview and readme entry inference

* Adding TSP project files

* TSP compile

* CI checks and readme entry for generated file

* Update specification/cognitiveservices/OpenAI.Inference/models/completions/azure_content_filtering.tsp

Co-authored-by: Deyaaeldeen Almahallawi <[email protected]>

* TSP compile

* Removed default from response model

* ci check for tsp validation

* Added 2024-10-01-preview to assistants service version

* Added missing entry for 10-01-preview assistants

* Corrected readme file

* Update specification/ai/OpenAI.Assistants/main.tsp

Co-authored-by: Johan Stenberg (MSFT) <[email protected]>

---------

Co-authored-by: Travis Wilson <[email protected]>
Co-authored-by: Travis Wilson <[email protected]>
Co-authored-by: Shawn Fang <[email protected]>
Co-authored-by: Deyaaeldeen Almahallawi <[email protected]>
Co-authored-by: Johan Stenberg (MSFT) <[email protected]>
  • Loading branch information
6 people authored Nov 14, 2024
1 parent 01791fc commit 85d5b0a
Show file tree
Hide file tree
Showing 292 changed files with 45,442 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"title": "Cancels a run that is `in_progress`.\n",
"parameters": {
"endpoint": "{endpoint}",
"api-version": "2024-09-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,
"parallel_tool_calls": true,
"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"
}
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-09-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"
}
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-09-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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"title": "Create a message.",
"parameters": {
"endpoint": "{endpoint}",
"api-version": "2024-09-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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"title": "Create a run.",
"parameters": {
"endpoint": "{endpoint}",
"api-version": "2024-09-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,
"parallel_tool_calls": true,
"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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"title": "Creates a thread.",
"parameters": {
"endpoint": "{endpoint}",
"api-version": "2024-09-01-preview",
"body": {}
},
"responses": {
"200": {
"body": {
"id": "thread_v7V4csrNOxtNmgcwGg496Smx",
"object": "thread",
"created_at": 1707297136,
"tool_resources": {},
"metadata": {}
}
}
},
"operationId": "CreateThread"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"title": "Create a thread and run it in one request.",
"parameters": {
"endpoint": "{endpoint}",
"api-version": "2024-09-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,
"parallel_tool_calls": true,
"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"
}
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-09-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"
}
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-09-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"
}
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-09-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"
}
Loading

0 comments on commit 85d5b0a

Please sign in to comment.