Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure.AI.Projects TypeSpec #30733

Closed
wants to merge 75 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
5bbedbd
First version of `endpoints` TypeSpec
dargilco Sep 25, 2024
53d8227
Fix typos
dargilco Sep 25, 2024
a68bcb4
Fix swagger
dargilco Sep 25, 2024
fa158c4
rename folder to assistants (plural)
dargilco Sep 25, 2024
449e4aa
Renaming
dargilco Sep 26, 2024
7e2c177
Evaluation TypeSpec (#30757)
singankit Sep 26, 2024
9ce2560
Add hostName to client constructor. Use placeholder endpoint
dargilco Oct 2, 2024
5792edd
Forgot this file
dargilco Oct 2, 2024
e64174b
Rename hostName to endpoint
dargilco Oct 3, 2024
a0c1d9e
Updating Evaluation Typespec and Renaming Client using typespec (#30857)
singankit Oct 4, 2024
99a462a
Add auto-created Swagger examples
dargilco Oct 4, 2024
980986a
Update examples to have unique titles
dargilco Oct 4, 2024
b8f5db4
Add data-plane\Azure.AI.Client\readme.md
dargilco Oct 4, 2024
a09e1f3
Fix example to use real value from authType
dargilco Oct 4, 2024
9757a28
Fix again...
dargilco Oct 4, 2024
e67333d
Fix missing category and target in endpoint swagger examples
dargilco Oct 4, 2024
0bbacd0
Suppress AvoidAnonymousParameter error
dargilco Oct 7, 2024
afceb22
Recreated examples
dargilco Oct 7, 2024
22168f4
Patch examples
dargilco Oct 7, 2024
4073ccb
Try again...
dargilco Oct 7, 2024
74f4281
Patch samples (again)...
dargilco Oct 7, 2024
5c16c71
Try again
dargilco Oct 7, 2024
a1a10a8
Refresh examples
dargilco Oct 7, 2024
4a40134
Try again
dargilco Oct 7, 2024
955f3f9
Refresh examples
dargilco Oct 7, 2024
029de78
Manual fix to examples
dargilco Oct 7, 2024
e98ce4c
Another manual fix to swagger
dargilco Oct 7, 2024
c2955aa
Update examples again
dargilco Oct 7, 2024
6252dd5
Jhakulin/azure ai client agents (#30878)
jhakulin Oct 7, 2024
211f581
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 7, 2024
39e54f3
Now with Agents
dargilco Oct 7, 2024
60dae37
Remove new line
dargilco Oct 7, 2024
8d310c6
Add examples for Agents
dargilco Oct 7, 2024
0070435
Update model.tsp (#30890)
singankit Oct 7, 2024
a94b3dd
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 7, 2024
075ca68
Updating Evaluation Schedule Typespec using typespec (#30908)
saikmicro Oct 8, 2024
b55f94e
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 9, 2024
4820691
Turn off generated samples and test. Explicitly make some endpoint mo…
dargilco Oct 10, 2024
1d1a3f2
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 10, 2024
f881dc0
Rename workspaceName to projectName, (#30960)
dargilco Oct 11, 2024
152f307
Update request URL for agents (#30985)
ShivangiReja Oct 11, 2024
10b1f40
Add configuration to disable the generation of C# samples (#30987)
ShivangiReja Oct 12, 2024
8dfcd47
[AI Client] add new tool definitions for Agents (#31003)
glharper Oct 14, 2024
a509fa0
Evaluation API Review Feedback (#31039)
singankit Oct 16, 2024
d61fa2d
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 16, 2024
74829bc
Fix some swagger files failing validation in Azure AI Client TypeSpec…
dargilco Oct 17, 2024
55eb232
Rename 'connections' back to 'endpoints' (#31089)
dargilco Oct 18, 2024
7059720
Add typescript configuration options for JS SDK (#31007)
ganeshyb Oct 18, 2024
7f3b4e5
Update the configuration for C# to disable model namespace generation…
ShivangiReja Oct 18, 2024
4319512
change new tool name to bing grounding (#31106)
glharper Oct 19, 2024
5e47aaf
Update model.tsp (#31110)
singankit Oct 21, 2024
8d465c6
Updates to `list` and `listSecrets` APIs. Add new `get` API. (#31105)
dargilco Oct 21, 2024
0c04c10
Add ID to connection properties
dargilco Oct 21, 2024
c136fdf
add optional parameters and changes to evaluation schedule (#31126)
saikmicro Oct 22, 2024
1e1d5f6
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 22, 2024
2c0c065
Copy to Azure.AI.Project
dargilco Oct 22, 2024
e035343
npx tsv . change
dargilco Oct 22, 2024
962042a
Update package name
dargilco Oct 22, 2024
271f7fa
more of the same
dargilco Oct 22, 2024
1267192
remove old recurrence and add optional in correct recurrence object (…
saikmicro Oct 23, 2024
389165c
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 23, 2024
6c50f70
Switch to azure-ai-projects
dargilco Oct 23, 2024
f5b9531
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 24, 2024
ce86987
Azure.AI.Projects TypeSpec updates to support making two REST API cal…
dargilco Oct 25, 2024
eea29f0
Fix docstrings (#31251)
nick863 Oct 28, 2024
b072c8c
Update model name to InternalConnectionProperties
dargilco Oct 29, 2024
2e4d6c3
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 29, 2024
3fc4e7a
deleteSchedule to disableSchedule and remove samplingRate (#31309)
saikmicro Oct 29, 2024
c906adc
Jhakulin/azure ai client agents get file content update (#31318)
jhakulin Oct 29, 2024
72be7e5
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Oct 30, 2024
727ae08
make getFileContent internal Python (#31333)
jhakulin Oct 30, 2024
fc8aca8
Rename "diagnostics" to "telemetry" (#31335)
dargilco Oct 30, 2024
72ef759
Add a connection type enum for Azure AI Search (#31350)
dargilco Oct 31, 2024
bf15d77
Glharper/ai projects new tools service changes (#31340)
glharper Nov 1, 2024
a585574
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-client
dargilco Nov 4, 2024
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
278 changes: 278 additions & 0 deletions specification/ai/Azure.AI.Projects/agents/client.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;

namespace Azure.AI.Projects.Agents {
// Trivial response value containers should treat these containers as internal details and instead surface a shimmed
// operation that exposes the underlying data directly.
@@clientName(AgentDeletionStatus, "InternalAgentDeletionStatus", "csharp");
@@access(deleteAgent, Access.internal, "csharp");
@@clientName(deleteAgent, "InternalDeleteAgent", "csharp");
@@access(deleteThread, Access.internal, "csharp");
@@clientName(deleteThread, "InternalDeleteThread", "csharp");
@@access(listAgents, Access.internal, "csharp");
@@clientName(listAgents, "InternalGetAgents", "csharp");
@@access(listRunSteps, Access.internal, "csharp");
@@clientName(listRunSteps, "InternalGetRunSteps", "csharp");
@@access(listMessages, Access.internal, "csharp");
@@clientName(listMessages, "InternalGetMessages", "csharp");
@@access(listRuns, Access.internal, "csharp");
@@clientName(listRuns, "InternalGetRuns", "csharp");
@@access(FileListResponse, Access.internal, "csharp");
@@clientName(FileListResponse, "InternalFileListResponse", "csharp");
@@access(listFiles, Access.internal, "csharp");
@@clientName(listFiles, "InternalListFiles", "csharp");
@@access(FileDeletionStatus, Access.internal, "csharp");
@@clientName(FileDeletionStatus, "InternalFileDeletionStatus", "csharp");
@@access(deleteFile, Access.internal, "csharp");
@@clientName(deleteFile, "InternalDeleteFile", "csharp");

// In addition to top-level response value containers, trivial intermediate structure -- levels of single-use model
// hierarchy that don't convey explanatory or functional benefit to consumers of the surface -- should also be
// internalized and merged into the more useful top-level type.

// FunctionToolDefinition: merge FunctionDefinition structure to recast e.g. toolDefinition.function.name into
// toolDefinition.name

@@access(FunctionDefinition, Access.internal);
@@clientName(FunctionDefinition, "InternalFunctionDefinition", "csharp");
@@clientName(FunctionToolDefinition.function, "InternalFunction", "csharp");

// SubmitToolOutputsAction: include .tool_calls directly rather than via an intermediate .details.

@@access(SubmitToolOutputsDetails, Access.internal);
@@clientName(SubmitToolOutputsDetails,
"InternalSubmitToolOutputsDetails",
"csharp"
);
@@clientName(SubmitToolOutputsAction.submitToolOutputs,
"InternalDetails",
"csharp"
);

// RequiredFunctionToolCall, RunStepFunctionToolCall: include name/arguments/output directly

@@access(RunStepFunctionToolCallDetails, Access.internal);
@@clientName(RunStepFunctionToolCallDetails,
"InternalRunStepFunctionToolCallDetails",
"csharp"
);
@@clientName(RequiredFunctionToolCall.function, "InternalDetails", "csharp");
@@access(RequiredFunctionToolCallDetails, Access.internal);
@@clientName(RequiredFunctionToolCallDetails,
"InternalRequiredFunctionToolCallDetails",
"csharp"
);
@@clientName(RunStepFunctionToolCall.function, "InternalDetails", "csharp");

// RunStepCodeInterpreterToolCall: include input/outputs directly

@@access(RunStepCodeInterpreterToolCallDetails, Access.internal);
@@clientName(RunStepCodeInterpreterToolCallDetails,
"InternalCodeInterpreterToolCallDetails",
"csharp"
);
@@clientName(RunStepCodeInterpreterToolCall.codeInterpreter,
"InternalDetails",
"csharp"
);

// MessageTextContent: text/annotations can also merge

@@access(MessageTextDetails, Access.internal);
@@clientName(MessageTextDetails, "InternalMessageTextDetails", "csharp");
@@clientName(MessageTextContent.text, "InternalDetails", "csharp");

// MessageTextFileCitationAnnotation: file_id/quote don't need another type

@@access(MessageTextFileCitationDetails, Access.internal);
@@clientName(MessageTextFileCitationDetails,
"InternalMessageTextFileCitationDetails",
"csharp"
);
@@clientName(MessageTextFileCitationAnnotation.fileCitation,
"InternalDetails",
"csharp"
);

// MessageTextFilePathAnnotation: file_id doesn't need a separate details client type

@@access(MessageTextFilePathDetails, Access.internal);
@@clientName(MessageTextFilePathDetails,
"InternalMessageTextFilePathDetails",
"csharp"
);
@@clientName(MessageTextFilePathAnnotation.filePath,
"InternalDetails",
"csharp"
);

// MessageImageFileContent: *two* levels of intermediate structure can be squashed to bring file_id to the parent
// type. Per earlier precedent with image generation, even the introduction of more image file representations (e.g.
// base64) are better accomplished via another approach at the client layer.

@@access(MessageImageFileDetails, Access.internal);
@@clientName(MessageImageFileDetails,
"InternalMessageImageFileDetails",
"csharp"
);
@@clientName(MessageImageFileContent.imageFile, "InternalDetails", "csharp");
@@clientName(MessageImageFileDetails.fileId, "InternalDetails", "csharp");

// Several of the content item types are not intended to be used as input

@@usage(MessageTextContent, Usage.output);
@@usage(MessageImageFileContent, Usage.output);
@@usage(MessageTextContent, Usage.output);
@@usage(MessageTextFileCitationAnnotation, Usage.output);
@@usage(MessageTextFilePathAnnotation, Usage.output);

// Ensure some shared types remain public despite interaction with previously internalized details

// Ensure generator inclusion of streaming "leaf" types not yet referenced by a route

@@usage(MessageDeltaTextFileCitationAnnotation, Usage.output);
@@access(MessageDeltaTextFileCitationAnnotation, Access.public);

@@usage(MessageDeltaTextFileCitationAnnotationObject, Usage.output);
@@access(MessageDeltaTextFileCitationAnnotationObject, Access.public);

@@usage(MessageDeltaTextFilePathAnnotation, Usage.output);
@@access(MessageDeltaTextFilePathAnnotation, Access.public);

@@usage(MessageDeltaTextFilePathAnnotationObject, Usage.output);
@@access(MessageDeltaTextFilePathAnnotationObject, Access.public);

@@usage(MessageDeltaImageFileContent, Usage.output);
@@access(MessageDeltaImageFileContent, Access.public);

@@usage(MessageDeltaImageFileContentObject, Usage.output);
@@access(MessageDeltaImageFileContentObject, Access.public);

@@usage(MessageDeltaTextContent, Usage.output);
@@access(MessageDeltaTextContent, Access.public);

@@usage(MessageDeltaTextContentObject, Usage.output);
@@access(MessageDeltaTextContentObject, Access.public);

@@usage(RunStepDeltaMessageCreationObject, Usage.output);
@@access(RunStepDeltaMessageCreationObject, Access.public);

@@usage(RunStepDeltaFunction, Usage.output);
@@access(RunStepDeltaFunction, Access.public);

@@usage(RunStepDeltaCodeInterpreterLogOutput, Usage.output);
@@access(RunStepDeltaCodeInterpreterLogOutput, Access.public);

@@usage(RunStepDeltaCodeInterpreterImageOutputObject, Usage.output);
@@access(RunStepDeltaCodeInterpreterImageOutputObject, Access.public);

@@usage(RunStepDeltaChunk, Usage.output);
@@access(RunStepDeltaChunk, Access.public);

@@usage(MessageDeltaChunk, Usage.output);
@@access(MessageDeltaChunk, Access.public);

@@usage(MessageDelta, Usage.output);
@@access(MessageDelta, Access.public);

@@usage(MessageDeltaContent, Usage.output);
@@access(MessageDeltaContent, Access.public);

// Stream events : made public to expose documentation and make class casting for strongly typed languages easier

@@usage(AgentStreamEvent, Usage.output);
@@access(AgentStreamEvent, Access.public);

@@usage(ThreadStreamEvent, Usage.output);
@@access(ThreadStreamEvent, Access.public);

@@usage(RunStreamEvent, Usage.output);
@@access(RunStreamEvent, Access.public);

@@usage(RunStepStreamEvent, Usage.output);
@@access(RunStepStreamEvent, Access.public);

@@usage(MessageStreamEvent, Usage.output);
@@access(MessageStreamEvent, Access.public);

@@usage(ErrorEvent, Usage.output);
@@access(ErrorEvent, Access.public);

@@usage(DoneEvent, Usage.output);
@@access(DoneEvent, Access.public);

// Tool resources
@@usage(ToolResources, Usage.output);
@@access(ToolResources, Access.public);

@@usage(CodeInterpreterToolResource, Usage.output);
@@access(CodeInterpreterToolResource, Access.public);

@@usage(FileSearchToolResource, Usage.output);
@@access(FileSearchToolResource, Access.public);

// Ensure some shared types remain public despite interaction with previously internalized details
@@access(MessageTextFilePathAnnotation, Access.public);
@@access(MessageTextFileCitationAnnotation, Access.public);
@@access(ListSortOrder, Access.public);
@@access(RequiredToolCall, Access.public);
@@usage(FilePurpose, Usage.input | Usage.output);
@@usage(ListSortOrder, Usage.input | Usage.output);

// Make getFileContent internal method in Python (override with get_file_content_stream)
@@access(getFileContent, Access.internal, "python");

// Additional, language-specific idiomatic renames

@@clientName(OpenAIFile, "OpenAIFile", "csharp");
@@clientName(OpenAIFile.bytes, "Size", "csharp");
@@clientName(FilePurpose, "OpenAIFilePurpose", "csharp");
@@clientName(ThreadMessage.content, "ContentItems", "csharp");
@@clientName(MessageTextDetails.value, "Text", "csharp");
@@clientName(CreateRunOptions.`model`, "OverrideModelName", "csharp");
@@clientName(CreateRunOptions.instructions, "OverrideInstructions", "csharp");
@@clientName(CreateRunOptions.tools, "OverrideTools", "csharp");
@@clientName(CreateAndRunThreadOptions.`model`,
"OverrideModelName",
"csharp"
);
@@clientName(CreateAndRunThreadOptions.instructions,
"OverrideInstructions",
"csharp"
);
@@clientName(CreateAndRunThreadOptions.tools, "OverrideTools", "csharp");
// From https://platform.openai.com/docs/agents/how-it-works
// "Note that deleting an AgentFile doesn’t delete the original File object, it simply deletes the association
// between that File and the Agent."

//@override(Azure.AI.Agents.createAgent, "java")
//op createAgentCustomization(createAgentOptions: CreateAgentOptions): Agent;

//@@clientName(updateAgent::parameters.body,
// "updateAgentOptions",
// "java"
//);
//@@clientName(createThreadAndRun::parameters.body,
// "createAndRunThreadOptions",
// "java"
//);
//@@clientName(createThread::parameters.body,
// "agentThreadCreationOptions",
// "java"
//);
///@@clientName(updateThread::parameters.body,
// "updateAgentThreadOptions",
// "java"
//);
//@@clientName(createVectorStore::parameters.body,
// "vectorStoreOptions",
// "java"
//);
//@@clientName(modifyVectorStore::parameters.body,
// "vectorStoreUpdateOptions",
// "java"
//);
//@@clientName(createRun::parameters.body, "createRunOptions", "java");
//@@clientName(createMessage::parameters.body, "threadMessageOptions", "java");
}
Loading
Loading