Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2bc4a5f
Go back to `parameters?: unknown` in FunctionDefinition model
dargilco Aug 19, 2024
4a29832
Merge remote-tracking branch 'origin/main' into dargilco/ai-model-inf…
dargilco Aug 19, 2024
d68a383
Add missing CompletionsFinishReason comments. Update tool choice rela…
dargilco Aug 19, 2024
adeddf3
Update JSON examples. Fix client.tsp after previous commit to rename …
dargilco Aug 19, 2024
3e95e57
Add ID back to EmbeddingsResult model. Add comment to getModelInfo th…
dargilco Aug 23, 2024
dedab7a
Update comments about hand-written operator methods
dargilco Aug 29, 2024
7507aaf
Update teh ModelInfo enum
dargilco Sep 12, 2024
e71bdd9
Merge branch 'main' into dargilco/ai-model-inference
trangevi Dec 10, 2024
6a1a4bc
Merge remote-tracking branch 'origin/main' into dargilco/ai-model-inf…
dargilco Dec 23, 2024
3e647af
Rename EmbeddingInput to ImageEmbeddingInput (#31953)
dargilco Dec 24, 2024
76224a0
Add Structured Outputs (#31962)
trangevi Dec 26, 2024
84764b1
Naming consistency (#31966)
trangevi Dec 27, 2024
55390d1
Merge remote-tracking branch 'origin/main' into dargilco/ai-model-inf…
dargilco Dec 27, 2024
53f0524
Fixes following `npx tsp format **\*.tsp`
dargilco Dec 27, 2024
f1954ee
Fix a couple of errors from `npx tsv .`
dargilco Dec 27, 2024
ee954ff
Add missing class description. Add updated swagger file
dargilco Dec 27, 2024
be57da7
Update description
dargilco Dec 27, 2024
a2bc8a2
Remove the in-line definition
dargilco Dec 27, 2024
e194ad7
Merge remote-tracking branch 'origin/main' into dargilco/ai-model-inf…
dargilco Jan 3, 2025
3409632
Make all response format models internal (#32005)
dargilco Jan 9, 2025
a4f5d74
Merge branch 'dargilco/ai-model-inference' into trangevi/structured-o…
trangevi Jan 9, 2025
1ae1ba1
Merge branch 'dargilco/ai-model-inference' into trangevi/structured-o…
trangevi Jan 9, 2025
2ade2db
Merge branch 'glharper-inference-ts-dpg' into trangevi/structured-out…
trangevi Jan 9, 2025
3b509f8
Update client.tsp - alias ChatCompletionsResponseFormatJsonObject in …
glharper Jan 13, 2025
51389f8
Update chat_completions.tsp
glharper Jan 13, 2025
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
Prev Previous commit
Next Next commit
Add missing CompletionsFinishReason comments. Update tool choice rela…
…ted models to use the work `choice` instead of selection, similar to OAI TypeSpec
  • Loading branch information
dargilco committed Aug 19, 2024
commit d68a383d4c0a765a77ad4a580e0f4f2b6fac0b45
14 changes: 6 additions & 8 deletions specification/ai/ModelClient/models/chat_completions.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ alias ChatCompletionsOptions = {
@doc("""
If specified, the model will configure which of the provided tools it can use for the chat completions response.
""")
toolChoice?: ChatCompletionsToolSelection;
toolChoice?: ChatCompletionsToolChoice;

@doc("""
If specified, the system will make a best effort to sample deterministically such that repeated requests with the
Expand Down Expand Up @@ -389,13 +389,11 @@ model ChatResponseMessage {
toolCalls?: ChatCompletionsToolCall[];
}

// tool_choice: "auto" | "none" | "required" | {"type": "function", "function": {"name": string}}

#suppress "@azure-tools/typespec-autorest/union-unsupported" "External API shape is defined in OpenAPI 3.0 as oneOf."
alias ChatCompletionsToolSelection = ChatCompletionsToolSelectionPreset | ChatCompletionsNamedToolSelection;
alias ChatCompletionsToolChoice = ChatCompletionsToolChoicePreset | ChatCompletionsNamedToolChoice;

@doc("Represents a generic policy for how a chat completions tool may be selected.")
union ChatCompletionsToolSelectionPreset {
union ChatCompletionsToolChoicePreset {
string,

@doc("""
Expand All @@ -417,16 +415,16 @@ union ChatCompletionsToolSelectionPreset {
}

@doc("A tool selection of a specific, named function tool that will limit chat completions to using the named function.")
model ChatCompletionsNamedToolSelection {
model ChatCompletionsNamedToolChoice {
@doc("The type of the tool. Currently, only `function` is supported.")
type: "function";

@doc("The function that should be called.")
function: ChatCompletionsFunctionToolSelection;
function: ChatCompletionsNamedToolChoiceFunction;
}

@doc("A tool selection of a specific, named function tool that will limit chat completions to using the named function.")
model ChatCompletionsFunctionToolSelection {
model ChatCompletionsNamedToolChoiceFunction {
@doc("The name of the function that should be called.")
name: string;
}
Expand Down
6 changes: 3 additions & 3 deletions specification/ai/ModelClient/models/common.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace AI.Model;
union EmbeddingInputType {
string,

@doc("to do")
@doc("Indicates the input is a general text input.")
text: "text",

@doc("to do")
@doc("Indicates the input represents a search query to find the most relevant documents in your vector database.")
query: "query",

@doc("to do")
@doc("Indicates the input represents a document that is stored in a vector database.")
document: "document",
}

Expand Down