Skip to content

Commit

Permalink
Update client with typespec changes. (#31633)
Browse files Browse the repository at this point in the history
Update with latest typespec RLC client generation
  • Loading branch information
ganeshyb authored Nov 5, 2024
1 parent 73aaa66 commit f37382a
Show file tree
Hide file tree
Showing 15 changed files with 1,376 additions and 1,409 deletions.
4 changes: 4 additions & 0 deletions sdk/ai/ai-projects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,22 @@
"./package.json": "./package.json",
".": {
"browser": {
"source": "./src/index.ts",
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"source": "./src/index.ts",
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"source": "./src/index.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"source": "./src/index.ts",
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
Expand Down
81 changes: 40 additions & 41 deletions sdk/ai/ai-projects/review/ai-projects.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,63 @@ import { TokenCredential } from '@azure/core-auth';

// @public (undocumented)
export interface AgentsOperations {
// Warning: (ae-forgotten-export) The symbol "AgentsCancelRunParameters" needs to be exported by the entry point index.d.ts
cancelRun: (threadId: string, runId: string, options?: AgentsCancelRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "CancelRunParameters" needs to be exported by the entry point index.d.ts
cancelRun: (threadId: string, runId: string, options?: CancelRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "CreateAgentOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "AgentOutput" needs to be exported by the entry point index.d.ts
createAgent: (options: CreateAgentOptions) => Promise<AgentOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsCreateMessageParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "CreateMessageParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ThreadMessageOutput" needs to be exported by the entry point index.d.ts
createMessage: (threadId: string, options: AgentsCreateMessageParameters) => Promise<ThreadMessageOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsCreateRunParameters" needs to be exported by the entry point index.d.ts
createMessage: (threadId: string, options: CreateMessageParameters) => Promise<ThreadMessageOutput>;
// Warning: (ae-forgotten-export) The symbol "CreateRunParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ThreadRunOutput" needs to be exported by the entry point index.d.ts
createRun: (threadId: string, options: AgentsCreateRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsCreateThreadParameters" needs to be exported by the entry point index.d.ts
createRun: (threadId: string, options: CreateRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "CreateThreadParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "AgentThreadOutput" needs to be exported by the entry point index.d.ts
createThread: (options: AgentsCreateThreadParameters) => Promise<AgentThreadOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsCreateThreadAndRunParameters" needs to be exported by the entry point index.d.ts
createThreadAndRun: (options: AgentsCreateThreadAndRunParameters) => Promise<ThreadRunOutput>;
createThread: (options: CreateThreadParameters) => Promise<AgentThreadOutput>;
// Warning: (ae-forgotten-export) The symbol "CreateThreadAndRunParameters" needs to be exported by the entry point index.d.ts
createThreadAndRun: (options: CreateThreadAndRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentDeletionStatusOutput" needs to be exported by the entry point index.d.ts
deleteAgent: (assistantId: string) => Promise<AgentDeletionStatusOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsDeleteFileParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DeleteFileParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FileDeletionStatusOutput" needs to be exported by the entry point index.d.ts
deleteFile: (fileId: string, options?: AgentsDeleteFileParameters) => Promise<FileDeletionStatusOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsDeleteThreadParameters" needs to be exported by the entry point index.d.ts
deleteFile: (fileId: string, options?: DeleteFileParameters) => Promise<FileDeletionStatusOutput>;
// Warning: (ae-forgotten-export) The symbol "DeleteThreadParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ThreadDeletionStatusOutput" needs to be exported by the entry point index.d.ts
deleteThread: (threadId: string, options?: AgentsDeleteThreadParameters) => Promise<ThreadDeletionStatusOutput>;
deleteThread: (threadId: string, options?: DeleteThreadParameters) => Promise<ThreadDeletionStatusOutput>;
getAgent: (assistantId: string) => Promise<AgentOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsGetFileParameters" needs to be exported by the entry point index.d.ts
getFile: (fileId: string, options?: AgentsGetFileParameters) => Promise<OpenAIFileOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsGetFileContentParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FileContentResponseOutput" needs to be exported by the entry point index.d.ts
getFileContent: (fileId: string, options?: AgentsGetFileContentParameters) => Promise<FileContentResponseOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsGetRunParameters" needs to be exported by the entry point index.d.ts
getRun: (threadId: string, runId: string, options?: AgentsGetRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsGetThreadParameters" needs to be exported by the entry point index.d.ts
getThread: (threadId: string, options?: AgentsGetThreadParameters) => Promise<AgentThreadOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsListAgentsQueryParamProperties" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "GetFileParameters" needs to be exported by the entry point index.d.ts
getFile: (fileId: string, options?: GetFileParameters) => Promise<OpenAIFileOutput>;
// Warning: (ae-forgotten-export) The symbol "GetFileContentParameters" needs to be exported by the entry point index.d.ts
getFileContent: (fileId: string, options?: GetFileContentParameters) => Promise<string>;
// Warning: (ae-forgotten-export) The symbol "GetRunParameters" needs to be exported by the entry point index.d.ts
getRun: (threadId: string, runId: string, options?: GetRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "GetThreadParameters" needs to be exported by the entry point index.d.ts
getThread: (threadId: string, options?: GetThreadParameters) => Promise<AgentThreadOutput>;
// Warning: (ae-forgotten-export) The symbol "ListAgentsQueryParamProperties" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "OpenAIPageableListOfAgentOutput" needs to be exported by the entry point index.d.ts
listAgents: (options?: AgentsListAgentsQueryParamProperties) => Promise<OpenAIPageableListOfAgentOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsListFilesParameters" needs to be exported by the entry point index.d.ts
listAgents: (options?: ListAgentsQueryParamProperties) => Promise<OpenAIPageableListOfAgentOutput>;
// Warning: (ae-forgotten-export) The symbol "ListFilesParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FileListResponseOutput" needs to be exported by the entry point index.d.ts
listFiles: (options?: AgentsListFilesParameters) => Promise<FileListResponseOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsListMessagesParameters" needs to be exported by the entry point index.d.ts
listMessages: (threadId: string, options?: AgentsListMessagesParameters) => Promise<ThreadMessageOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsListRunsParameters" needs to be exported by the entry point index.d.ts
listFiles: (options?: ListFilesParameters) => Promise<FileListResponseOutput>;
// Warning: (ae-forgotten-export) The symbol "ListMessagesParameters" needs to be exported by the entry point index.d.ts
listMessages: (threadId: string, options?: ListMessagesParameters) => Promise<ThreadMessageOutput>;
// Warning: (ae-forgotten-export) The symbol "ListRunsParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "OpenAIPageableListOfThreadRunOutput" needs to be exported by the entry point index.d.ts
listRuns: (threadId: string, options?: AgentsListRunsParameters) => Promise<OpenAIPageableListOfThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsSubmitToolOutputsToRunParameters" needs to be exported by the entry point index.d.ts
submitToolOutputsToRun: (threadId: string, runId: string, options: AgentsSubmitToolOutputsToRunParameters) => Promise<ThreadRunOutput>;
listRuns: (threadId: string, options?: ListRunsParameters) => Promise<OpenAIPageableListOfThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "SubmitToolOutputsToRunParameters" needs to be exported by the entry point index.d.ts
submitToolOutputsToRun: (threadId: string, runId: string, options: SubmitToolOutputsToRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "UpdateAgentOptions" needs to be exported by the entry point index.d.ts
updateAgent: (assistantId: string, options: UpdateAgentOptions) => Promise<AgentOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsUpdateMessageParameters" needs to be exported by the entry point index.d.ts
updateMessage: (threadId: string, messageId: string, options: AgentsUpdateMessageParameters) => Promise<ThreadMessageOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsUpdateRunParameters" needs to be exported by the entry point index.d.ts
updateRun: (threadId: string, runId: string, options: AgentsUpdateRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsUpdateThreadParameters" needs to be exported by the entry point index.d.ts
updateThread: (threadId: string, options: AgentsUpdateThreadParameters) => Promise<AgentThreadOutput>;
// Warning: (ae-forgotten-export) The symbol "AgentsUploadFileParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "UpdateMessageParameters" needs to be exported by the entry point index.d.ts
updateMessage: (threadId: string, messageId: string, options: UpdateMessageParameters) => Promise<ThreadMessageOutput>;
// Warning: (ae-forgotten-export) The symbol "UpdateRunParameters" needs to be exported by the entry point index.d.ts
updateRun: (threadId: string, runId: string, options: UpdateRunParameters) => Promise<ThreadRunOutput>;
// Warning: (ae-forgotten-export) The symbol "UpdateThreadParameters" needs to be exported by the entry point index.d.ts
updateThread: (threadId: string, options: UpdateThreadParameters) => Promise<AgentThreadOutput>;
// Warning: (ae-forgotten-export) The symbol "UploadFileParameters" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "OpenAIFileOutput" needs to be exported by the entry point index.d.ts
uploadFile: (options: AgentsUploadFileParameters) => Promise<OpenAIFileOutput>;
uploadFile: (options: UploadFileParameters) => Promise<OpenAIFileOutput>;
}

// @public (undocumented)
Expand Down
12 changes: 6 additions & 6 deletions sdk/ai/ai-projects/src/agents/assistants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

import { Client, createRestError } from "@azure-rest/core-client";
import { AgentDeletionStatusOutput, AgentOutput, OpenAIPageableListOfAgentOutput } from "../generated/src/outputModels.js";
import { AgentsCreateAgentParameters, AgentsDeleteAgentParameters, AgentsGetAgentParameters, AgentsListAgentsParameters, AgentsUpdateAgentParameters } from "../generated/src/parameters.js";
import { CreateAgentParameters, DeleteAgentParameters, GetAgentParameters, UpdateAgentParameters, ListAgentsParameters } from "../generated/src/parameters.js";


const expectedStatuses = ["200"];

/** Creates a new agent. */
export async function createAgent(
context: Client,
options: AgentsCreateAgentParameters,
options: CreateAgentParameters,
): Promise<AgentOutput> {
const result = await context.path("/assistants").post(options);

Expand All @@ -24,7 +24,7 @@ export async function createAgent(
/** Gets a list of agents that were previously created. */
export async function listAgents(
context: Client,
options?: AgentsListAgentsParameters,
options?: ListAgentsParameters,
): Promise<OpenAIPageableListOfAgentOutput> {
const result = await context
.path("/assistants")
Expand All @@ -39,7 +39,7 @@ export async function createAgent(
export async function getAgent(
context: Client,
assistantId: string,
options?: AgentsGetAgentParameters,
options?: GetAgentParameters,
): Promise<AgentOutput> {
const result = await context
.path("/assistants/{assistantId}", assistantId)
Expand All @@ -54,7 +54,7 @@ export async function getAgent(
export async function updateAgent(
context: Client,
assistantId: string,
options?: AgentsUpdateAgentParameters,
options?: UpdateAgentParameters,
): Promise<AgentOutput> {
const result = await context
.path("/assistants/{assistantId}", assistantId)
Expand All @@ -70,7 +70,7 @@ export async function updateAgent(
export async function deleteAgent(
context: Client,
assistantId: string,
options?: AgentsDeleteAgentParameters,
options?: DeleteAgentParameters,
): Promise<AgentDeletionStatusOutput> {
const result = await context
.path("/assistants/{assistantId}", assistantId)
Expand Down
16 changes: 8 additions & 8 deletions sdk/ai/ai-projects/src/agents/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Licensed under the MIT License.

import { Client, createRestError } from "@azure-rest/core-client";
import { FileContentResponseOutput, FileDeletionStatusOutput, FileListResponseOutput, OpenAIFileOutput } from "../generated/src/outputModels.js";
import { AgentsDeleteFileParameters, AgentsGetFileContentParameters, AgentsGetFileParameters, AgentsListFilesParameters, AgentsUploadFileParameters } from "../generated/src/parameters.js";
import { FileDeletionStatusOutput, FileListResponseOutput, OpenAIFileOutput } from "../generated/src/outputModels.js";
import { DeleteFileParameters, GetFileContentParameters, GetFileParameters, ListFilesParameters, UploadFileParameters } from "../generated/src/parameters.js";

const expectedStatuses = ["200"];

/** Gets a list of previously uploaded files. */
export async function listFiles(
context: Client,
options?: AgentsListFilesParameters,
options?: ListFilesParameters,
): Promise<FileListResponseOutput> {
const result = await context.path("/files").get(options);
if (!expectedStatuses.includes(result.status)) {
Expand All @@ -22,7 +22,7 @@ export async function listFiles(
/** Uploads a file for use by other operations. */
export async function uploadFile(
context: Client,
options: AgentsUploadFileParameters,
options: UploadFileParameters,
): Promise<OpenAIFileOutput> {
const result = await context.path("/files").post(options);
if (!expectedStatuses.includes(result.status)) {
Expand All @@ -35,7 +35,7 @@ export async function uploadFile(
export async function deleteFile(
context: Client,
fileId: string,
options?: AgentsDeleteFileParameters,
options?: DeleteFileParameters,
): Promise<FileDeletionStatusOutput> {
const result = await context
.path("/files/{fileId}", fileId)
Expand All @@ -50,7 +50,7 @@ export async function deleteFile(
export async function getFile(
context: Client,
fileId: string,
options?: AgentsGetFileParameters,
options?: GetFileParameters,
): Promise<OpenAIFileOutput> {
const result = await context
.path("/files/{fileId}", fileId)
Expand All @@ -65,8 +65,8 @@ export async function getFile(
export async function getFileContent(
context: Client,
fileId: string,
options?: AgentsGetFileContentParameters,
): Promise<FileContentResponseOutput> {
options?: GetFileContentParameters,
): Promise<string> {
const result = await context
.path("/files/{fileId}", fileId)
.get(options);
Expand Down
Loading

0 comments on commit f37382a

Please sign in to comment.