-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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-08-01-preview TypeSpec updates (#30377)
* 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 --------- Co-authored-by: Shawn Fang <[email protected]> Co-authored-by: Jose Alvarez <[email protected]> Co-authored-by: Jose Alvarez <[email protected]>
- Loading branch information
Showing
78 changed files
with
5,958 additions
and
757 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
43 changes: 43 additions & 0 deletions
43
...fication/cognitiveservices/OpenAI.Inference/examples/2024-08-01-preview/cancel_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,43 @@ | ||
{ | ||
"title": "Cancel an in-progress batch job", | ||
"operationId": "CancelBatch", | ||
"parameters": { | ||
"endpoint": "https://aoairesource.openai.azure.com", | ||
"api-key": "{api key}", | ||
"api-version": "2024-08-01-preview", | ||
"batchId": "batch_72a2792ef7d24ba7b82c7fe4a37e379f" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"object": "batch", | ||
"id": "batch_72a2792ef7d24ba7b82c7fe4a37e379f", | ||
"endpoint": "/chat/completions", | ||
"errors": null, | ||
"input_file_id": "file-b4fa7277f3eb4722ac18b90f46102c3f", | ||
"completion_window": "24h", | ||
"status": "cancelling", | ||
"output_file_id": null, | ||
"error_file_id": null, | ||
"created_at": 1646126127, | ||
"in_progress_at": 1646126130, | ||
"expires_at": 1646126170, | ||
"finalizing_at": null, | ||
"completed_at": null, | ||
"failed_at": null, | ||
"expired_at": null, | ||
"cancelling_at": 1646126138, | ||
"cancelled_at": null, | ||
"request_counts": { | ||
"total": 500, | ||
"completed": 100, | ||
"failed": 5 | ||
}, | ||
"metadata": { | ||
"batch_description": "Evaluation job" | ||
} | ||
} | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ification/cognitiveservices/OpenAI.Inference/examples/2024-08-01-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-08-01-preview", | ||
"fileId": "inference-uzdgnx4i8PPe96zgXQ1vJ9W3" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"object": "file", | ||
"deleted": true, | ||
"id": "inference-uzdgnx4i8PPe96zgXQ1vJ9W3" | ||
} | ||
} | ||
}, | ||
"operationId": "DeleteFile" | ||
} |
19 changes: 19 additions & 0 deletions
19
...ognitiveservices/OpenAI.Inference/examples/2024-08-01-preview/generated_audio_speech.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 @@ | ||
{ | ||
"operationId": "GenerateSpeechFromText", | ||
"title": "Generates text-to-speech audio from the input text.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-08-01-preview", | ||
"deploymentId": "<deployment-id>", | ||
"body": { | ||
"input": "The text to generate audio for", | ||
"voice": "alloy" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"content-type": "application/octet-stream", | ||
"body": "RIFF...audio.data.omitted" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...es/OpenAI.Inference/examples/2024-08-01-preview/generated_audio_transcription_object.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,17 @@ | ||
{ | ||
"operationId": "GetAudioTranscriptionAsResponseObject", | ||
"title": "Gets transcribed text and associated metadata from provided spoken audio data.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-08-01-preview", | ||
"deploymentId": "<deployment-id>", | ||
"file": "U3dhZ2dlciByb2Nrcw==" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"text": "A structured object when requesting json or verbose_json" | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...ices/OpenAI.Inference/examples/2024-08-01-preview/generated_audio_transcription_text.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,16 @@ | ||
{ | ||
"operationId": "GetAudioTranscriptionAsPlainText", | ||
"title": "Gets transcribed text and associated metadata from provided spoken audio data.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-08-01-preview", | ||
"deploymentId": "<deployment-id>", | ||
"file": "U3dhZ2dlciByb2Nrcw==" | ||
}, | ||
"responses": { | ||
"200": { | ||
"type": "string", | ||
"body": "plain text when requesting text, srt, or vtt" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ices/OpenAI.Inference/examples/2024-08-01-preview/generated_audio_translation_object.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,17 @@ | ||
{ | ||
"operationId": "GetAudioTranslationAsResponseObject", | ||
"title": "Gets English language transcribed text and associated metadata from provided spoken audio data.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-08-01-preview", | ||
"deploymentId": "<deployment-id>", | ||
"file": "U3dhZ2dlciByb2Nrcw==" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"text": "A structured object when requesting json or verbose_json" | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...rvices/OpenAI.Inference/examples/2024-08-01-preview/generated_audio_translation_text.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,16 @@ | ||
{ | ||
"operationId": "GetAudioTranslationAsPlainText", | ||
"title": "Gets English language transcribed text and associated metadata from provided spoken audio data.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-08-01-preview", | ||
"deploymentId": "<deployment-id>", | ||
"file": "U3dhZ2dlciByb2Nrcw==" | ||
}, | ||
"responses": { | ||
"200": { | ||
"type": "string", | ||
"body": "plain text when requesting text, srt, or vtt" | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...tiveservices/OpenAI.Inference/examples/2024-08-01-preview/generated_chat_completions.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,46 @@ | ||
{ | ||
"operationId": "GetChatCompletions", | ||
"title": "Creates a completion for the provided prompt, parameters and chosen model.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-08-01-preview", | ||
"deploymentId": "<deployment-id>", | ||
"body": { | ||
"messages": [ | ||
{ | ||
"role": "system", | ||
"content": "you are a helpful assistant that talks like a pirate" | ||
}, | ||
{ | ||
"role": "user", | ||
"content": "can you tell me how to care for a parrot?" | ||
} | ||
] | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "chatcmpl-7R1nGnsXO8n4oi9UPz2f3UHdgAYMn", | ||
"created": 1686676106, | ||
"choices": [ | ||
{ | ||
"index": 0, | ||
"finish_reason": "stop", | ||
"message": { | ||
"role": "assistant", | ||
"refusal": null, | ||
"content": "Ahoy matey! So ye be wantin' to care for a fine squawkin' parrot, eh? Well, shiver me timbers, let ol' Cap'n Assistant share some wisdom with ye! Here be the steps to keepin' yer parrot happy 'n healthy:\n\n1. Secure a sturdy cage: Yer parrot be needin' a comfortable place to lay anchor! Be sure ye get a sturdy cage, at least double the size of the bird's wingspan, with enough space to spread their wings, yarrrr!\n\n2. Perches 'n toys: Aye, parrots need perches of different sizes, shapes, 'n textures to keep their feet healthy. Also, a few toys be helpin' to keep them entertained 'n their minds stimulated, arrrh!\n\n3. Proper grub: Feed yer feathered friend a balanced diet of high-quality pellets, fruits, 'n veggies to keep 'em strong 'n healthy. Give 'em fresh water every day, or ye’ll have a scurvy bird on yer hands!\n\n4. Cleanliness: Swab their cage deck! Clean their cage on a regular basis: fresh water 'n food daily, the floor every couple of days, 'n a thorough scrubbing ev'ry few weeks, so the bird be livin' in a tidy haven, arrhh!\n\n5. Socialize 'n train: Parrots be a sociable lot, arrr! Exercise 'n interact with 'em daily to create a bond 'n maintain their mental 'n physical health. Train 'em with positive reinforcement, treat 'em kindly, yarrr!\n\n6. Proper rest: Yer parrot be needin' ’bout 10-12 hours o' sleep each night. Cover their cage 'n let them slumber in a dim, quiet quarter for a proper night's rest, ye scallywag!\n\n7. Keep a weather eye open for illness: Birds be hidin' their ailments, arrr! Be watchful for signs of sickness, such as lethargy, loss of appetite, puffin' up, or change in droppings, and make haste to a vet if need be.\n\n8. Provide fresh air 'n avoid toxins: Parrots be sensitive to draft and pollutants. Keep yer quarters well ventilated, but no drafts, arrr! Be mindful of toxins like Teflon fumes, candles, or air fresheners.\n\nSo there ye have it, me hearty! With proper care 'n commitment, yer parrot will be squawkin' \"Yo-ho-ho\" for many years to come! Good luck, sailor, and may the wind be at yer back!" | ||
}, | ||
"logprobs": null | ||
} | ||
], | ||
"usage": { | ||
"completion_tokens": 557, | ||
"prompt_tokens": 33, | ||
"total_tokens": 590 | ||
} | ||
} | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...cognitiveservices/OpenAI.Inference/examples/2024-08-01-preview/generated_completions.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 @@ | ||
{ | ||
"operationId": "GetCompletions", | ||
"title": "Creates a completion for the provided prompt, parameters and chosen model.", | ||
"parameters": { | ||
"endpoint": "{endpoint}", | ||
"api-version": "2024-08-01-preview", | ||
"deploymentId": "<deployment-id>", | ||
"body": { | ||
"prompt": [ | ||
"tell me a joke about mango" | ||
], | ||
"max_tokens": 32, | ||
"temperature": 1.0, | ||
"n": 1 | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "cmpl-7QmVI15qgYVllxK0FtxVGG6ywfzaq", | ||
"created": 1686617332, | ||
"choices": [ | ||
{ | ||
"text": "es\n\nWhat do you call a mango who's in charge?\n\nThe head mango.", | ||
"index": 0, | ||
"finish_reason": "stop", | ||
"logprobs": null | ||
} | ||
], | ||
"usage": { | ||
"completion_tokens": 20, | ||
"prompt_tokens": 6, | ||
"total_tokens": 26 | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.