Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions specification/ai/ModelClient/models/chat_completions.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ using Azure.ClientGenerator.Core;

namespace AI.Model;

alias ChatCompletionsOptions = {
@doc("""
The configuration information for a chat completions request.
Completions support a wide variety of tasks and generate text that continues from or "completes"
provided prompt data.
""")
model ChatCompletionsOptions {
@doc("""
The collection of context messages associated with this chat completions request.
Typical usage begins with a chat message for the System role that provides instructions for
Expand Down Expand Up @@ -120,7 +125,7 @@ alias ChatCompletionsOptions = {
`model`?: string;

...Record<unknown>;
};
}

alias ChatCompletionsCommon = {
@doc("A unique identifier associated with this chat completions response.")
Expand Down
7 changes: 5 additions & 2 deletions specification/ai/ModelClient/models/embeddings.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ using TypeSpec.Http;

namespace AI.Model;

alias EmbeddingsOptions = {
@doc("""
The configuration information for an embeddings request.
""")
model EmbeddingsOptions {
@doc("""
Input text to embed, encoded as a string or array of tokens.
To embed multiple inputs in a single request, pass an array
Expand Down Expand Up @@ -38,4 +41,4 @@ alias EmbeddingsOptions = {
`model`?: string;

...Record<unknown>;
};
}
7 changes: 5 additions & 2 deletions specification/ai/ModelClient/models/image_embeddings.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ using TypeSpec.Http;

namespace AI.Model;

alias ImageEmbeddingsOptions = {
@doc("""
The configuration information for an image embeddings request.
""")
model ImageEmbeddingsOptions {
@doc("""
Input image to embed. To embed multiple inputs in a single request, pass an array.
The input must not exceed the max input tokens for the model.
Expand Down Expand Up @@ -39,7 +42,7 @@ alias ImageEmbeddingsOptions = {
`model`?: string;

...Record<unknown>;
};
}

@doc("Represents an image with optional text.")
model ImageEmbeddingInput {
Expand Down
21 changes: 18 additions & 3 deletions specification/ai/ModelClient/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ namespace AI.Model;
@route("chat/completions")
op getChatCompletions is Azure.Core.RpcOperation<
{
...ChatCompletionsOptions;
/**
* The options for chat completions.
*/
@bodyRoot
body: ChatCompletionsOptions;

...AdditionalRequestHeaders;
},
ChatCompletions
Expand All @@ -39,7 +44,12 @@ op getChatCompletions is Azure.Core.RpcOperation<
@route("embeddings")
op getEmbeddings is Azure.Core.RpcOperation<
{
...EmbeddingsOptions;
/**
* The body of the request containing the options for generating embeddings.
*/
@bodyRoot
body: EmbeddingsOptions;

...AdditionalRequestHeaders;
},
EmbeddingsResult
Expand All @@ -53,7 +63,12 @@ op getEmbeddings is Azure.Core.RpcOperation<
@route("images/embeddings")
op getImageEmbeddings is Azure.Core.RpcOperation<
{
...ImageEmbeddingsOptions;
/**
* The body of the request containing options for image embeddings.
*/
@bodyRoot
body: ImageEmbeddingsOptions;

...AdditionalRequestHeaders;
},
EmbeddingsResult
Expand Down
Loading