Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fa346cd
Translated to typespec the json for whisper (PR pending)
jpalvarezl Aug 24, 2023
0f8e412
TSP compile updates to gened files
jpalvarezl Aug 30, 2023
5629f9f
First round of PR comments
jpalvarezl Aug 30, 2023
4f52b58
Extracted common structures into whisper.common.tsp source file
jpalvarezl Aug 30, 2023
8ab710a
Improved documentation a bit
jpalvarezl Aug 30, 2023
2c95a24
Added examples
jpalvarezl Aug 30, 2023
fcc5366
Corrected small issue with docs
jpalvarezl Aug 30, 2023
17f7628
More PR feedback, mainly adjusted types and removed redundant model
jpalvarezl Aug 31, 2023
2612005
Merge branch 'main' into jpalvarezl/whisper_tsp_definitions
jpalvarezl Aug 31, 2023
4a7a831
Adding error definition after merging main
jpalvarezl Aug 31, 2023
a1774cc
Regened swagger
jpalvarezl Aug 31, 2023
ccdc8ec
Corrected badly generated paths
jpalvarezl Aug 31, 2023
2b49764
Added examples in the TSP definition folder too
jpalvarezl Aug 31, 2023
03e9605
Extracted RequestHeaderTrait into a reusable alias
jpalvarezl Aug 31, 2023
b30446d
Splitted routes.tsp into individual files, optimized imports, split m…
jpalvarezl Sep 1, 2023
bd63134
Renamed and grouped models by functionality
jpalvarezl Sep 1, 2023
2b80885
Restored ServiceVersions to its original place
jpalvarezl Sep 1, 2023
f54c52e
Removed commented out import
jpalvarezl Sep 1, 2023
23f2094
Renamed commons file
jpalvarezl Sep 1, 2023
5522abe
Trying out sharedRoutes for content negotiation
jpalvarezl Sep 1, 2023
918fc52
Added a multipart data to the transaltion example
jpalvarezl Sep 1, 2023
5a7f34b
Merge branch 'main' into jpalvarezl/whisper_tsp_definitions
trrwilson Sep 2, 2023
eab0747
squash/reset/rebase (#25641)
jpalvarezl Sep 4, 2023
079bbf6
User/travisw/jose update in fork (#25684)
jpalvarezl Sep 6, 2023
90600ba
Removed unused dependencies and re-compiled/emitted swagger
jpalvarezl Sep 6, 2023
89ee481
Added content-length as it is required by the service
jpalvarezl Sep 7, 2023
53f2828
Added classes related to format types to implementation.models instead
jpalvarezl Sep 7, 2023
17ef0ef
Corrected typo in header name
jpalvarezl Sep 7, 2023
7beb47a
Code gen work better with java for multipart
jpalvarezl Sep 7, 2023
e8e3300
Added new alias for plain text returning multipart requests
jpalvarezl Sep 7, 2023
7f0465b
Using the correct version of the resource according to deprecation no…
jpalvarezl Sep 7, 2023
d33d47d
Removed request trait and embedded the headers in the OptionsCommons …
jpalvarezl Sep 7, 2023
82c07f9
small update to add 'model' and versioning tags
trrwilson Sep 7, 2023
12baae1
Updated docs
jpalvarezl Sep 8, 2023
9c7f16c
Added missing examples
jpalvarezl Sep 8, 2023
fb4f558
Removed hardcoded boundary
jpalvarezl Sep 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions specification/cognitiveservices/OpenAI.Inference/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ using Azure.ClientGenerator.Core;
// configuration options on the request payload options model.
@@internal(Azure.OpenAI.getChatCompletionsWithAzureExtensions);

// The disparate possible formats for transcription and translation should be unified into a common surface by the
// client.
// We are alternatively emitting this in as custom types in a package that is private from the perspective of the user
@@internal(Azure.OpenAI.getAudioTranscriptionSimpleJson)
@@internal(Azure.OpenAI.getAudioTranscriptionVerboseJson)
@@internal(Azure.OpenAI.getAudioTranscriptionPlainText)
@@internal(Azure.OpenAI.getAudioTranscriptionSrt)
@@internal(Azure.OpenAI.getAudioTranscriptionVtt)
@@internal(Azure.OpenAI.getAudioTranslationSimpleJson)
@@internal(Azure.OpenAI.getAudioTranslationVerboseJson)
@@internal(Azure.OpenAI.getAudioTranslationPlainText)
@@internal(Azure.OpenAI.getAudioTranslationSrt)
@@internal(Azure.OpenAI.getAudioTranslationVtt)

// Some models from routes with suppressed visibility are still desired for custom public surface.
@@include(Azure.OpenAI.ImageGenerationOptions);
@@include(Azure.OpenAI.ImageLocation);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"operationId": "GetChatCompletions",
"title": "Creates a completion for the provided prompt, parameters and chosen model.",
"parameters": {
"endpoint": "{endpoint}",
"api-version": "2023-09-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",
"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!"
}
}
],
"usage": {
"completion_tokens": 557,
"prompt_tokens": 33,
"total_tokens": 590
}
}
}
}
}
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": "2023-09-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
}
}
}
}
}
Loading