@azure/ai-projects 1.0.0-alpha.20241230.1 → 1.0.0-alpha.20250123.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/browser/agents/customModels.d.ts +1 -1
  2. package/dist/browser/agents/customModels.js.map +1 -1
  3. package/dist/browser/agents/streamingModels.d.ts +2 -2
  4. package/dist/browser/agents/streamingModels.js.map +1 -1
  5. package/dist/browser/agents/utils.d.ts +1 -1
  6. package/dist/browser/agents/utils.js +1 -1
  7. package/dist/browser/agents/utils.js.map +1 -1
  8. package/dist/commonjs/agents/customModels.d.ts +1 -1
  9. package/dist/commonjs/agents/customModels.js.map +1 -1
  10. package/dist/commonjs/agents/streamingModels.d.ts +2 -2
  11. package/dist/commonjs/agents/streamingModels.js.map +1 -1
  12. package/dist/commonjs/agents/utils.d.ts +1 -1
  13. package/dist/commonjs/agents/utils.js +1 -1
  14. package/dist/commonjs/agents/utils.js.map +1 -1
  15. package/dist/commonjs/tsdoc-metadata.json +1 -1
  16. package/dist/esm/agents/customModels.d.ts +1 -1
  17. package/dist/esm/agents/customModels.js.map +1 -1
  18. package/dist/esm/agents/streamingModels.d.ts +2 -2
  19. package/dist/esm/agents/streamingModels.js.map +1 -1
  20. package/dist/esm/agents/utils.d.ts +1 -1
  21. package/dist/esm/agents/utils.js +1 -1
  22. package/dist/esm/agents/utils.js.map +1 -1
  23. package/dist/react-native/agents/customModels.d.ts +1 -1
  24. package/dist/react-native/agents/customModels.js.map +1 -1
  25. package/dist/react-native/agents/streamingModels.d.ts +2 -2
  26. package/dist/react-native/agents/streamingModels.js.map +1 -1
  27. package/dist/react-native/agents/utils.d.ts +1 -1
  28. package/dist/react-native/agents/utils.js +1 -1
  29. package/dist/react-native/agents/utils.js.map +1 -1
  30. package/package.json +22 -26
@@ -39,7 +39,7 @@ export interface PollingOptions {
39
39
  */
40
40
  sleepIntervalInMs?: number;
41
41
  /**
42
- * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.
42
+ * An AbortSignalLike object (as defined by \@azure/abort-controller) that can be used to cancel the polling operation.
43
43
  */
44
44
  abortSignal?: AbortSignalLike;
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
1
+ {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by \\@azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
@@ -3,10 +3,10 @@ import type { AgentThreadOutput, RunStepOutput, ThreadMessageOutput, ThreadRunOu
3
3
  /**
4
4
  Each event in a server-sent events stream has an `event` and `data` property:
5
5
 
6
- ```
6
+ ```
7
7
  event: thread.created
8
8
  data: {"id": "thread_123", "object": "thread", ...}
9
- ```
9
+ ```
10
10
 
11
11
  We emit events whenever a new object is created, transitions to a new state, or is being
12
12
  streamed in parts (deltas). For example, we emit `thread.run.created` when a new run
@@ -1 +1 @@
1
- {"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/agents/streamingModels.ts"],"names":[],"m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qD,CAAA;AACvD,CAAC,EAfW,kBAAkB,KAAlB,kBAAkB,QAe7B;AAED,qEAAqE;AACrE,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sFAAsF;IACtF,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,gEAAgE;AAChE,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,0CAA0C;IAC1C,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MessageDeltaChunk, RunStepDeltaChunk } from \"../customization/streamingModels.js\";\nimport type {\n AgentThreadOutput,\n RunStepOutput,\n ThreadMessageOutput,\n ThreadRunOutput,\n} from \"../customization/outputModels.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n \n ```\n event: thread.created\n data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n ```\n \n We emit events whenever a new object is created, transitions to a new state, or is being\n streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n to create a message during a run, we emit a `thread.message.created event`, a\n `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n `thread.message.completed` event.\n \n We may add additional events over time, so we recommend handling unknown events gracefully\n in your code.**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamDataOutput;\n /** The type of the event. */\n event: AgentStreamEventType | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamDataOutput =\n | AgentThreadOutput\n | ThreadRunOutput\n | RunStepOutput\n | ThreadMessageOutput\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Thread operation related streaming events */\nexport enum ThreadStreamEvent {\n /** Event sent when a new thread is created. The data of this event is of type AgentThread */\n ThreadCreated = \"thread.created\",\n}\n\n/** Run operation related streaming events */\nexport enum RunStreamEvent {\n /** Event sent when a new run is created. The data of this event is of type ThreadRun */\n ThreadRunCreated = \"thread.run.created\",\n\n /** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */\n ThreadRunQueued = \"thread.run.queued\",\n\n /** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */\n ThreadRunInProgress = \"thread.run.in_progress\",\n\n /** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */\n ThreadRunRequiresAction = \"thread.run.requires_action\",\n\n /** Event sent when a run is completed. The data of this event is of type ThreadRun */\n ThreadRunCompleted = \"thread.run.completed\",\n\n /** Event sent when a run fails. The data of this event is of type ThreadRun */\n ThreadRunFailed = \"thread.run.failed\",\n\n /** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */\n ThreadRunCancelling = \"thread.run.cancelling\",\n\n /** Event sent when a run is cancelled. The data of this event is of type ThreadRun */\n ThreadRunCancelled = \"thread.run.cancelled\",\n\n /** Event sent when a run is expired. The data of this event is of type ThreadRun */\n ThreadRunExpired = \"thread.run.expired\",\n}\n\n/** Run step operation related streaming events */\nexport enum RunStepStreamEvent {\n /** Event sent when a new thread run step is created. The data of this event is of type RunStep */\n ThreadRunStepCreated = \"thread.run.step.created\",\n\n /** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */\n ThreadRunStepInProgress = \"thread.run.step.in_progress\",\n\n /** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */\n ThreadRunStepDelta = \"thread.run.step.delta\",\n\n /** Event sent when a run step is completed. The data of this event is of type RunStep */\n ThreadRunStepCompleted = \"thread.run.step.completed\",\n\n /** Event sent when a run step fails. The data of this event is of type RunStep */\n ThreadRunStepFailed = \"thread.run.step.failed\",\n\n /** Event sent when a run step is cancelled. The data of this event is of type RunStep */\n ThreadRunStepCancelled = \"thread.run.step.cancelled\",\n\n /** Event sent when a run step is expired. The data of this event is of type RunStep */\n ThreadRunStepExpired = \"thread.run.step.expired\",\n}\n\n/** Message operation related streaming events */\nexport enum MessageStreamEvent {\n /** Event sent when a new message is created. The data of this event is of type ThreadMessage */\n ThreadMessageCreated = \"thread.message.created\",\n\n /** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */\n ThreadMessageInProgress = \"thread.message.in_progress\",\n\n /** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */\n ThreadMessageDelta = \"thread.message.delta\",\n\n /** Event sent when a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageCompleted = \"thread.message.completed\",\n\n /** Event sent before a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageIncomplete = \"thread.message.incomplete\",\n}\n\n/** Terminal event indicating a server side error while streaming. */\nexport enum ErrorEvent {\n /** Event sent when an error occurs, such as an internal server error or a timeout. */\n Error = \"error\",\n}\n\n/** Terminal event indicating the successful end of a stream. */\nexport enum DoneEvent {\n /** Event sent when the stream is done. */\n Done = \"done\",\n}\n\n/**\n Represents the type of an agent stream event.\n */\nexport type AgentStreamEventType =\n | ThreadStreamEvent\n | RunStreamEvent\n | RunStepStreamEvent\n | MessageStreamEvent\n | ErrorEvent\n | DoneEvent;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n"]}
1
+ {"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/agents/streamingModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4ClC,gDAAgD;AAChD,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,6FAA6F;IAC7F,qDAAgC,CAAA;AAClC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,6CAA6C;AAC7C,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,wFAAwF;IACxF,yDAAuC,CAAA;IAEvC,kGAAkG;I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AHW,SAAS,KAAT,SAAS,QAGpB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MessageDeltaChunk, RunStepDeltaChunk } from \"../customization/streamingModels.js\";\nimport type {\n AgentThreadOutput,\n RunStepOutput,\n ThreadMessageOutput,\n ThreadRunOutput,\n} from \"../customization/outputModels.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n \n```\n event: thread.created\n data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n```\n \n We emit events whenever a new object is created, transitions to a new state, or is being\n streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n to create a message during a run, we emit a `thread.message.created event`, a\n `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n `thread.message.completed` event.\n \n We may add additional events over time, so we recommend handling unknown events gracefully\n in your code.**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamDataOutput;\n /** The type of the event. */\n event: AgentStreamEventType | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamDataOutput =\n | AgentThreadOutput\n | ThreadRunOutput\n | RunStepOutput\n | ThreadMessageOutput\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Thread operation related streaming events */\nexport enum ThreadStreamEvent {\n /** Event sent when a new thread is created. The data of this event is of type AgentThread */\n ThreadCreated = \"thread.created\",\n}\n\n/** Run operation related streaming events */\nexport enum RunStreamEvent {\n /** Event sent when a new run is created. The data of this event is of type ThreadRun */\n ThreadRunCreated = \"thread.run.created\",\n\n /** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */\n ThreadRunQueued = \"thread.run.queued\",\n\n /** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */\n ThreadRunInProgress = \"thread.run.in_progress\",\n\n /** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */\n ThreadRunRequiresAction = \"thread.run.requires_action\",\n\n /** Event sent when a run is completed. The data of this event is of type ThreadRun */\n ThreadRunCompleted = \"thread.run.completed\",\n\n /** Event sent when a run fails. The data of this event is of type ThreadRun */\n ThreadRunFailed = \"thread.run.failed\",\n\n /** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */\n ThreadRunCancelling = \"thread.run.cancelling\",\n\n /** Event sent when a run is cancelled. The data of this event is of type ThreadRun */\n ThreadRunCancelled = \"thread.run.cancelled\",\n\n /** Event sent when a run is expired. The data of this event is of type ThreadRun */\n ThreadRunExpired = \"thread.run.expired\",\n}\n\n/** Run step operation related streaming events */\nexport enum RunStepStreamEvent {\n /** Event sent when a new thread run step is created. The data of this event is of type RunStep */\n ThreadRunStepCreated = \"thread.run.step.created\",\n\n /** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */\n ThreadRunStepInProgress = \"thread.run.step.in_progress\",\n\n /** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */\n ThreadRunStepDelta = \"thread.run.step.delta\",\n\n /** Event sent when a run step is completed. The data of this event is of type RunStep */\n ThreadRunStepCompleted = \"thread.run.step.completed\",\n\n /** Event sent when a run step fails. The data of this event is of type RunStep */\n ThreadRunStepFailed = \"thread.run.step.failed\",\n\n /** Event sent when a run step is cancelled. The data of this event is of type RunStep */\n ThreadRunStepCancelled = \"thread.run.step.cancelled\",\n\n /** Event sent when a run step is expired. The data of this event is of type RunStep */\n ThreadRunStepExpired = \"thread.run.step.expired\",\n}\n\n/** Message operation related streaming events */\nexport enum MessageStreamEvent {\n /** Event sent when a new message is created. The data of this event is of type ThreadMessage */\n ThreadMessageCreated = \"thread.message.created\",\n\n /** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */\n ThreadMessageInProgress = \"thread.message.in_progress\",\n\n /** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */\n ThreadMessageDelta = \"thread.message.delta\",\n\n /** Event sent when a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageCompleted = \"thread.message.completed\",\n\n /** Event sent before a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageIncomplete = \"thread.message.incomplete\",\n}\n\n/** Terminal event indicating a server side error while streaming. */\nexport enum ErrorEvent {\n /** Event sent when an error occurs, such as an internal server error or a timeout. */\n Error = \"error\",\n}\n\n/** Terminal event indicating the successful end of a stream. */\nexport enum DoneEvent {\n /** Event sent when the stream is done. */\n Done = \"done\",\n}\n\n/**\n Represents the type of an agent stream event.\n */\nexport type AgentStreamEventType =\n | ThreadStreamEvent\n | RunStreamEvent\n | RunStepStreamEvent\n | MessageStreamEvent\n | ErrorEvent\n | DoneEvent;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n"]}
@@ -2,7 +2,7 @@ import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSe
2
2
  /**
3
3
  * Determines if the given output is of the specified type.
4
4
  *
5
- * @template T - The type to check against, which extends one of the possible output parent types.
5
+ * @typeparam T - The type to check against, which extends one of the possible output parent types.
6
6
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
7
7
  * @param type - The type to check the action against.
8
8
  * @returns A boolean indicating whether the action is of the specified type.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Determines if the given output is of the specified type.
5
5
  *
6
- * @template T - The type to check against, which extends one of the possible output parent types.
6
+ * @typeparam T - The type to check against, which extends one of the possible output parent types.
7
7
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
8
8
  * @param type - The type to check the action against.
9
9
  * @returns A boolean indicating whether the action is of the specified type.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,k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IAAI,GAAG,WAAW,CAAC,oBAAoB,CAAC,cAAc,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;QAC/F,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,sBAAsB,CACpB,OAAkB,EAClB,WAA0C;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,yBAAyB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,oBAAoB,CAClB,iBAAyB,EACzB,SAAiB;QAEjB,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;QAC/E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @template T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;AAC9C,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B;AAED,MAAM,OAAO,GAAG;IACd,cAAc,EAAE,eAAe;IAC/B,gBAAgB,EAAE,iBAAiB;IACnC,oBAAoB,EAAE,qBAAqB;CAC5C,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAA4B,EAC5B,aAAuB;QAEvB,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;oBACnB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;iBACnF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,CACzB,cAAyB,EACzB,YAA+C,EAC/C,iBAAmD;QAEnD,OAAO;YACL,UAAU,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,E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.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @typeparam T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
@@ -39,7 +39,7 @@ export interface PollingOptions {
39
39
  */
40
40
  sleepIntervalInMs?: number;
41
41
  /**
42
- * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.
42
+ * An AbortSignalLike object (as defined by \@azure/abort-controller) that can be used to cancel the polling operation.
43
43
  */
44
44
  abortSignal?: AbortSignalLike;
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
1
+ {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by \\@azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
@@ -3,10 +3,10 @@ import type { AgentThreadOutput, RunStepOutput, ThreadMessageOutput, ThreadRunOu
3
3
  /**
4
4
  Each event in a server-sent events stream has an `event` and `data` property:
5
5
 
6
- ```
6
+ ```
7
7
  event: thread.created
8
8
  data: {"id": "thread_123", "object": "thread", ...}
9
- ```
9
+ ```
10
10
 
11
11
  We emit events whenever a new object is created, transitions to a new state, or is being
12
12
  streamed in parts (deltas). For example, we emit `thread.run.created` when a new run
@@ -1 +1 @@
1
- {"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/agents/streamingModels.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA4ClC,gDAAgD;AAChD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,6FAA6F;IAC7F,qDAAgC,CAAA;AAClC,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAED,6CAA6C;AAC7C,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,wFAAwF;IACxF,yDAAuC,CAAA;IAEvC,kGAAkG;IAClG,uDAAqC,CAAA;IAErC,uGAAuG;IACvG,gEAA8C,CAAA;IAE9C,2GAA2G;IAC3G,wEAAsD,CAAA;IAEtD,sFAAsF;IACtF,6DAA2C,CAAA;IAE3C,+EAA+E;IAC/E,uDAAqC,CAAA;IAErC,sGAAsG;IACtG,+DAA6C,CAAA;IAE7C,sFAAsF;IACtF,6DAA2C,CAAA;IAE3C,oFAAoF;IACpF,yDAAuC,CAAA;AACzC,CAAC,EA3BW,cAAc,8BAAd,cAAc,QA2BzB;AAED,kDAAkD;AAClD,IAAY,kBAqBX;AArBD,WAAY,kBAAkB;IAC5B,kGAAkG;IAClG,sEAAgD,CAAA;IAEhD,0GAA0G;IAC1G,6EAAuD,CAAA;IAEvD,wGAAwG;IACxG,kEAA4C,CAAA;IAE5C,yFAAyF;IACzF,0EAAoD,CAAA;IAEpD,kFAAkF;IAClF,oEAA8C,CAAA;IAE9C,yFAAyF;IACzF,0EAAoD,CAAA;IAEpD,uFAAuF;IACvF,sEAAgD,CAAA;AAClD,CAAC,EArBW,kBAAkB,kCAAlB,kBAAkB,QAqB7B;AAED,iDAAiD;AACjD,IAAY,kBAeX;AAfD,WAAY,kBAAkB;IAC5B,gGAAgG;IAChG,qEAA+C,CAAA;IAE/C,+GAA+G;IAC/G,4EAAsD,CAAA;IAEtD,uGAAuG;IACvG,iEAA2C,CAAA;IAE3C,8FAA8F;IAC9F,yEAAmD,CAAA;IAEnD,gGAAgG;IAChG,2EAAqD,CAAA;AACvD,CAAC,EAfW,kBAAkB,kCAAlB,kBAAkB,QAe7B;AAED,qEAAqE;AACrE,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sFAAsF;IACtF,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,gEAAgE;AAChE,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,0CAA0C;IAC1C,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MessageDeltaChunk, RunStepDeltaChunk } from \"../customization/streamingModels.js\";\nimport type {\n AgentThreadOutput,\n RunStepOutput,\n ThreadMessageOutput,\n ThreadRunOutput,\n} from \"../customization/outputModels.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n \n ```\n event: thread.created\n data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n ```\n \n We emit events whenever a new object is created, transitions to a new state, or is being\n streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n to create a message during a run, we emit a `thread.message.created event`, a\n `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n `thread.message.completed` event.\n \n We may add additional events over time, so we recommend handling unknown events gracefully\n in your code.**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamDataOutput;\n /** The type of the event. */\n event: AgentStreamEventType | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamDataOutput =\n | AgentThreadOutput\n | ThreadRunOutput\n | RunStepOutput\n | ThreadMessageOutput\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Thread operation related streaming events */\nexport enum ThreadStreamEvent {\n /** Event sent when a new thread is created. The data of this event is of type AgentThread */\n ThreadCreated = \"thread.created\",\n}\n\n/** Run operation related streaming events */\nexport enum RunStreamEvent {\n /** Event sent when a new run is created. The data of this event is of type ThreadRun */\n ThreadRunCreated = \"thread.run.created\",\n\n /** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */\n ThreadRunQueued = \"thread.run.queued\",\n\n /** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */\n ThreadRunInProgress = \"thread.run.in_progress\",\n\n /** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */\n ThreadRunRequiresAction = \"thread.run.requires_action\",\n\n /** Event sent when a run is completed. The data of this event is of type ThreadRun */\n ThreadRunCompleted = \"thread.run.completed\",\n\n /** Event sent when a run fails. The data of this event is of type ThreadRun */\n ThreadRunFailed = \"thread.run.failed\",\n\n /** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */\n ThreadRunCancelling = \"thread.run.cancelling\",\n\n /** Event sent when a run is cancelled. The data of this event is of type ThreadRun */\n ThreadRunCancelled = \"thread.run.cancelled\",\n\n /** Event sent when a run is expired. The data of this event is of type ThreadRun */\n ThreadRunExpired = \"thread.run.expired\",\n}\n\n/** Run step operation related streaming events */\nexport enum RunStepStreamEvent {\n /** Event sent when a new thread run step is created. The data of this event is of type RunStep */\n ThreadRunStepCreated = \"thread.run.step.created\",\n\n /** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */\n ThreadRunStepInProgress = \"thread.run.step.in_progress\",\n\n /** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */\n ThreadRunStepDelta = \"thread.run.step.delta\",\n\n /** Event sent when a run step is completed. The data of this event is of type RunStep */\n ThreadRunStepCompleted = \"thread.run.step.completed\",\n\n /** Event sent when a run step fails. The data of this event is of type RunStep */\n ThreadRunStepFailed = \"thread.run.step.failed\",\n\n /** Event sent when a run step is cancelled. The data of this event is of type RunStep */\n ThreadRunStepCancelled = \"thread.run.step.cancelled\",\n\n /** Event sent when a run step is expired. The data of this event is of type RunStep */\n ThreadRunStepExpired = \"thread.run.step.expired\",\n}\n\n/** Message operation related streaming events */\nexport enum MessageStreamEvent {\n /** Event sent when a new message is created. The data of this event is of type ThreadMessage */\n ThreadMessageCreated = \"thread.message.created\",\n\n /** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */\n ThreadMessageInProgress = \"thread.message.in_progress\",\n\n /** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */\n ThreadMessageDelta = \"thread.message.delta\",\n\n /** Event sent when a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageCompleted = \"thread.message.completed\",\n\n /** Event sent before a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageIncomplete = \"thread.message.incomplete\",\n}\n\n/** Terminal event indicating a server side error while streaming. */\nexport enum ErrorEvent {\n /** Event sent when an error occurs, such as an internal server error or a timeout. */\n Error = \"error\",\n}\n\n/** Terminal event indicating the successful end of a stream. */\nexport enum DoneEvent {\n /** Event sent when the stream is done. */\n Done = \"done\",\n}\n\n/**\n Represents the type of an agent stream event.\n */\nexport type AgentStreamEventType =\n | ThreadStreamEvent\n | RunStreamEvent\n | RunStepStreamEvent\n | MessageStreamEvent\n | ErrorEvent\n | DoneEvent;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n"]}
1
+ {"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/agents/streamingModels.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA4ClC,gDAAgD;AAChD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,6FAA6F;IAC7F,qDAAgC,CAAA;AAClC,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAED,6CAA6C;AAC7C,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,wFAAwF;IACxF,yDAAuC,CAAA;IAEvC,kGAAkG;IAClG,uDAAqC,CAAA;IAErC,uGAAuG;IACvG,gEAA8C,CAAA;IAE9C,2GAA2G;IAC3G,wEAAsD,CAAA;IAEtD,sFAAsF;IACtF,6DAA2C,CAAA;IAE3C,+EAA+E;IAC/E,uDAAqC,CAAA;IAErC,sGAAsG;IACtG,+DAA6C,CAAA;IAE7C,sFAAsF;IACtF,6DAA2C,CAAA;IAE3C,oFAAoF;IACpF,yDAAuC,CAAA;AACzC,CAAC,EA3BW,cAAc,8BAAd,cAAc,QA2BzB;AAED,kDAAkD;AAClD,IAAY,kBAqBX;AArBD,WAAY,kBAAkB;IAC5B,kGAAkG;IAClG,sEAAgD,CAAA;IAEhD,0GAA0G;IAC1G,6EAAuD,CAAA;IAEvD,wGAAwG;IACxG,kEAA4C,CAAA;IAE5C,yFAAyF;IACzF,0EAAoD,CAAA;IAEpD,kFAAkF;IAClF,oEAA8C,CAAA;IAE9C,yFAAyF;IACzF,0EAAoD,CAAA;IAEpD,uFAAuF;IACvF,sEAAgD,CAAA;AAClD,CAAC,EArBW,kBAAkB,kCAAlB,kBAAkB,QAqB7B;AAED,iDAAiD;AACjD,IAAY,kBAeX;AAfD,WAAY,kBAAkB;IAC5B,gGAAgG;IAChG,qEAA+C,CAAA;IAE/C,+GAA+G;IAC/G,4EAAsD,CAAA;IAEtD,uGAAuG;IACvG,iEAA2C,CAAA;IAE3C,8FAA8F;IAC9F,yEAAmD,CAAA;IAEnD,gGAAgG;IAChG,2EAAqD,CAAA;AACvD,CAAC,EAfW,kBAAkB,kCAAlB,kBAAkB,QAe7B;AAED,qEAAqE;AACrE,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sFAAsF;IACtF,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,gEAAgE;AAChE,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,0CAA0C;IAC1C,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MessageDeltaChunk, RunStepDeltaChunk } from \"../customization/streamingModels.js\";\nimport type {\n AgentThreadOutput,\n RunStepOutput,\n ThreadMessageOutput,\n ThreadRunOutput,\n} from \"../customization/outputModels.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n \n```\n event: thread.created\n data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n```\n \n We emit events whenever a new object is created, transitions to a new state, or is being\n streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n to create a message during a run, we emit a `thread.message.created event`, a\n `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n `thread.message.completed` event.\n \n We may add additional events over time, so we recommend handling unknown events gracefully\n in your code.**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamDataOutput;\n /** The type of the event. */\n event: AgentStreamEventType | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamDataOutput =\n | AgentThreadOutput\n | ThreadRunOutput\n | RunStepOutput\n | ThreadMessageOutput\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Thread operation related streaming events */\nexport enum ThreadStreamEvent {\n /** Event sent when a new thread is created. The data of this event is of type AgentThread */\n ThreadCreated = \"thread.created\",\n}\n\n/** Run operation related streaming events */\nexport enum RunStreamEvent {\n /** Event sent when a new run is created. The data of this event is of type ThreadRun */\n ThreadRunCreated = \"thread.run.created\",\n\n /** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */\n ThreadRunQueued = \"thread.run.queued\",\n\n /** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */\n ThreadRunInProgress = \"thread.run.in_progress\",\n\n /** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */\n ThreadRunRequiresAction = \"thread.run.requires_action\",\n\n /** Event sent when a run is completed. The data of this event is of type ThreadRun */\n ThreadRunCompleted = \"thread.run.completed\",\n\n /** Event sent when a run fails. The data of this event is of type ThreadRun */\n ThreadRunFailed = \"thread.run.failed\",\n\n /** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */\n ThreadRunCancelling = \"thread.run.cancelling\",\n\n /** Event sent when a run is cancelled. The data of this event is of type ThreadRun */\n ThreadRunCancelled = \"thread.run.cancelled\",\n\n /** Event sent when a run is expired. The data of this event is of type ThreadRun */\n ThreadRunExpired = \"thread.run.expired\",\n}\n\n/** Run step operation related streaming events */\nexport enum RunStepStreamEvent {\n /** Event sent when a new thread run step is created. The data of this event is of type RunStep */\n ThreadRunStepCreated = \"thread.run.step.created\",\n\n /** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */\n ThreadRunStepInProgress = \"thread.run.step.in_progress\",\n\n /** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */\n ThreadRunStepDelta = \"thread.run.step.delta\",\n\n /** Event sent when a run step is completed. The data of this event is of type RunStep */\n ThreadRunStepCompleted = \"thread.run.step.completed\",\n\n /** Event sent when a run step fails. The data of this event is of type RunStep */\n ThreadRunStepFailed = \"thread.run.step.failed\",\n\n /** Event sent when a run step is cancelled. The data of this event is of type RunStep */\n ThreadRunStepCancelled = \"thread.run.step.cancelled\",\n\n /** Event sent when a run step is expired. The data of this event is of type RunStep */\n ThreadRunStepExpired = \"thread.run.step.expired\",\n}\n\n/** Message operation related streaming events */\nexport enum MessageStreamEvent {\n /** Event sent when a new message is created. The data of this event is of type ThreadMessage */\n ThreadMessageCreated = \"thread.message.created\",\n\n /** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */\n ThreadMessageInProgress = \"thread.message.in_progress\",\n\n /** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */\n ThreadMessageDelta = \"thread.message.delta\",\n\n /** Event sent when a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageCompleted = \"thread.message.completed\",\n\n /** Event sent before a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageIncomplete = \"thread.message.incomplete\",\n}\n\n/** Terminal event indicating a server side error while streaming. */\nexport enum ErrorEvent {\n /** Event sent when an error occurs, such as an internal server error or a timeout. */\n Error = \"error\",\n}\n\n/** Terminal event indicating the successful end of a stream. */\nexport enum DoneEvent {\n /** Event sent when the stream is done. */\n Done = \"done\",\n}\n\n/**\n Represents the type of an agent stream event.\n */\nexport type AgentStreamEventType =\n | ThreadStreamEvent\n | RunStreamEvent\n | RunStepStreamEvent\n | MessageStreamEvent\n | ErrorEvent\n | DoneEvent;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n"]}
@@ -2,7 +2,7 @@ import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSe
2
2
  /**
3
3
  * Determines if the given output is of the specified type.
4
4
  *
5
- * @template T - The type to check against, which extends one of the possible output parent types.
5
+ * @typeparam T - The type to check against, which extends one of the possible output parent types.
6
6
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
7
7
  * @param type - The type to check the action against.
8
8
  * @returns A boolean indicating whether the action is of the specified type.
@@ -7,7 +7,7 @@ exports.isOutputOfType = isOutputOfType;
7
7
  /**
8
8
  * Determines if the given output is of the specified type.
9
9
  *
10
- * @template T - The type to check against, which extends one of the possible output parent types.
10
+ * @typeparam T - The type to check against, which extends one of the possible output parent types.
11
11
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
12
12
  * @param type - The type to check the action against.
13
13
  * @returns A boolean indicating whether the action is of the specified type.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA0BlC,wCAKC;AAbD;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;AAC9C,CAAC,EAPW,kBAAkB,kCAAlB,kBAAkB,QAO7B;AAED,MAAM,OAAO,GAAG;IACd,cAAc,EAAE,eAAe;IAC/B,gBAAgB,EAAE,iBAAiB;IACnC,oBAAoB,EAAE,qBAAqB;CAC5C,CAAC;AAEF;;GAEG;AACH,MAAa,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAA4B,EAC5B,aAAuB;QAEvB,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;oBACnB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;iBACnF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,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AAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/ED,0BA+EC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @template T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA0BlC,wCAKC;AAbD;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;AAC9C,CAAC,EAPW,kBAAkB,kCAAlB,kBAAkB,QAO7B;AAED,MAAM,OAAO,GAAG;IACd,cAAc,EAAE,eAAe;IAC/B,gBAAgB,EAAE,iBAAiB;IACnC,oBAAoB,EAAE,qBAAqB;CAC5C,CAAC;AAEF;;GAEG;AACH,MAAa,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAA4B,EAC5B,aAAuB;QAEvB,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,QA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;IACH,oBAAoB,CAClB,iBAAyB,EACzB,SAAiB;QAEjB,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;QAC/E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/ED,0BA+EC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @typeparam T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.48.1"
8
+ "packageVersion": "7.49.1"
9
9
  }
10
10
  ]
11
11
  }
@@ -39,7 +39,7 @@ export interface PollingOptions {
39
39
  */
40
40
  sleepIntervalInMs?: number;
41
41
  /**
42
- * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.
42
+ * An AbortSignalLike object (as defined by \@azure/abort-controller) that can be used to cancel the polling operation.
43
43
  */
44
44
  abortSignal?: AbortSignalLike;
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
1
+ {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by \\@azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
@@ -3,10 +3,10 @@ import type { AgentThreadOutput, RunStepOutput, ThreadMessageOutput, ThreadRunOu
3
3
  /**
4
4
  Each event in a server-sent events stream has an `event` and `data` property:
5
5
 
6
- ```
6
+ ```
7
7
  event: thread.created
8
8
  data: {"id": "thread_123", "object": "thread", ...}
9
- ```
9
+ ```
10
10
 
11
11
  We emit events whenever a new object is created, transitions to a new state, or is being
12
12
  streamed in parts (deltas). For example, we emit `thread.run.created` when a new run
@@ -1 +1 @@
1
- {"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/agents/streamingModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4ClC,gDAAgD;AAChD,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,6FAA6F;IAC7F,qDAAgC,CAAA;AAClC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,6CAA6C;AAC7C,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAA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,WAAY,SAAS;IACnB,0CAA0C;IAC1C,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MessageDeltaChunk, RunStepDeltaChunk } from \"../customization/streamingModels.js\";\nimport type {\n AgentThreadOutput,\n RunStepOutput,\n ThreadMessageOutput,\n ThreadRunOutput,\n} from \"../customization/outputModels.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n \n ```\n event: thread.created\n data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n ```\n \n We emit events whenever a new object is created, transitions to a new state, or is being\n streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n to create a message during a run, we emit a `thread.message.created event`, a\n `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n `thread.message.completed` event.\n \n We may add additional events over time, so we recommend handling unknown events gracefully\n in your code.**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamDataOutput;\n /** The type of the event. */\n event: AgentStreamEventType | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamDataOutput =\n | AgentThreadOutput\n | ThreadRunOutput\n | RunStepOutput\n | ThreadMessageOutput\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Thread operation related streaming events */\nexport enum ThreadStreamEvent {\n /** Event sent when a new thread is created. The data of this event is of type AgentThread */\n ThreadCreated = \"thread.created\",\n}\n\n/** Run operation related streaming events */\nexport enum RunStreamEvent {\n /** Event sent when a new run is created. The data of this event is of type ThreadRun */\n ThreadRunCreated = \"thread.run.created\",\n\n /** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */\n ThreadRunQueued = \"thread.run.queued\",\n\n /** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */\n ThreadRunInProgress = \"thread.run.in_progress\",\n\n /** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */\n ThreadRunRequiresAction = \"thread.run.requires_action\",\n\n /** Event sent when a run is completed. The data of this event is of type ThreadRun */\n ThreadRunCompleted = \"thread.run.completed\",\n\n /** Event sent when a run fails. The data of this event is of type ThreadRun */\n ThreadRunFailed = \"thread.run.failed\",\n\n /** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */\n ThreadRunCancelling = \"thread.run.cancelling\",\n\n /** Event sent when a run is cancelled. The data of this event is of type ThreadRun */\n ThreadRunCancelled = \"thread.run.cancelled\",\n\n /** Event sent when a run is expired. The data of this event is of type ThreadRun */\n ThreadRunExpired = \"thread.run.expired\",\n}\n\n/** Run step operation related streaming events */\nexport enum RunStepStreamEvent {\n /** Event sent when a new thread run step is created. The data of this event is of type RunStep */\n ThreadRunStepCreated = \"thread.run.step.created\",\n\n /** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */\n ThreadRunStepInProgress = \"thread.run.step.in_progress\",\n\n /** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */\n ThreadRunStepDelta = \"thread.run.step.delta\",\n\n /** Event sent when a run step is completed. The data of this event is of type RunStep */\n ThreadRunStepCompleted = \"thread.run.step.completed\",\n\n /** Event sent when a run step fails. The data of this event is of type RunStep */\n ThreadRunStepFailed = \"thread.run.step.failed\",\n\n /** Event sent when a run step is cancelled. The data of this event is of type RunStep */\n ThreadRunStepCancelled = \"thread.run.step.cancelled\",\n\n /** Event sent when a run step is expired. The data of this event is of type RunStep */\n ThreadRunStepExpired = \"thread.run.step.expired\",\n}\n\n/** Message operation related streaming events */\nexport enum MessageStreamEvent {\n /** Event sent when a new message is created. The data of this event is of type ThreadMessage */\n ThreadMessageCreated = \"thread.message.created\",\n\n /** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */\n ThreadMessageInProgress = \"thread.message.in_progress\",\n\n /** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */\n ThreadMessageDelta = \"thread.message.delta\",\n\n /** Event sent when a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageCompleted = \"thread.message.completed\",\n\n /** Event sent before a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageIncomplete = \"thread.message.incomplete\",\n}\n\n/** Terminal event indicating a server side error while streaming. */\nexport enum ErrorEvent {\n /** Event sent when an error occurs, such as an internal server error or a timeout. */\n Error = \"error\",\n}\n\n/** Terminal event indicating the successful end of a stream. */\nexport enum DoneEvent {\n /** Event sent when the stream is done. */\n Done = \"done\",\n}\n\n/**\n Represents the type of an agent stream event.\n */\nexport type AgentStreamEventType =\n | ThreadStreamEvent\n | RunStreamEvent\n | RunStepStreamEvent\n | MessageStreamEvent\n | ErrorEvent\n | DoneEvent;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n"]}
1
+ {"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/agents/streamingModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4ClC,gDAAgD;AAChD,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,6FAA6F;IAC7F,qDAAgC,CAAA;AAClC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,6CAA6C;AAC7C,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,wFAAwF;IACxF,yDAAuC,CAAA;IAEvC,kGAAkG;IAClG,uDAAqC,CAAA;IAErC,uGAAuG;IACvG,gEAA8C,CAAA;IAE9C,2GAA2G;IAC3G,wEAAsD,CAAA;IAEtD,sFAAsF;IACtF,6DAA2C,CAAA;IAE3C,+EAA+E;IAC/E,uDAAqC,CAAA;IAErC,sGAAsG;IACtG,+DAA6C,CAAA;IAE7C,sFAAsF;IACtF,6DAA2C,CAAA;IAE3C,oFAAoF;IACpF,yDAAuC,CAAA;AACzC,CAAC,EA3BW,cAAc,KAAd,cAAc,QA2BzB;AAED,kDAAkD;AAClD,MAAM,CAAN,IAAY,kBAqBX;AArBD,WAAY,kBAAkB;IAC5B,kGAAkG;IAClG,sEAAgD,CAAA;IAEhD,0GAA0G;IAC1G,6EAAuD,CAAA;IAEvD,wGAAwG;IACxG,kEAA4C,CAAA;IAE5C,yFAAyF;IACzF,0EAAoD,CAAA;IAEpD,kFAAkF;IAClF,oEAA8C,CAAA;IAE9C,yFAAyF;IACzF,0EAAoD,CAAA;IAEpD,uFAAuF;IACvF,sEAAgD,CAAA;AAClD,CAAC,EArBW,kBAAkB,KAAlB,kBAAkB,QAqB7B;AAED,iDAAiD;AACjD,MAAM,CAAN,IAAY,kBAeX;AAfD,WAAY,kBAAkB;IAC5B,gGAAgG;IAChG,qEAA+C,CAAA;IAE/C,+GAA+G;IAC/G,4EAAsD,CAAA;IAEtD,uGAAuG;IACvG,iEAA2C,CAAA;IAE3C,8FAA8F;IAC9F,yEAAmD,CAAA;IAEnD,gGAAgG;IAChG,2EAAqD,CAAA;AACvD,CAAC,EAfW,kBAAkB,KAAlB,kBAAkB,QAe7B;AAED,qEAAqE;AACrE,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sFAAsF;IACtF,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,gEAAgE;AAChE,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,0CAA0C;IAC1C,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MessageDeltaChunk, RunStepDeltaChunk } from \"../customization/streamingModels.js\";\nimport type {\n AgentThreadOutput,\n RunStepOutput,\n ThreadMessageOutput,\n ThreadRunOutput,\n} from \"../customization/outputModels.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n \n```\n event: thread.created\n data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n```\n \n We emit events whenever a new object is created, transitions to a new state, or is being\n streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n to create a message during a run, we emit a `thread.message.created event`, a\n `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n `thread.message.completed` event.\n \n We may add additional events over time, so we recommend handling unknown events gracefully\n in your code.**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamDataOutput;\n /** The type of the event. */\n event: AgentStreamEventType | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamDataOutput =\n | AgentThreadOutput\n | ThreadRunOutput\n | RunStepOutput\n | ThreadMessageOutput\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Thread operation related streaming events */\nexport enum ThreadStreamEvent {\n /** Event sent when a new thread is created. The data of this event is of type AgentThread */\n ThreadCreated = \"thread.created\",\n}\n\n/** Run operation related streaming events */\nexport enum RunStreamEvent {\n /** Event sent when a new run is created. The data of this event is of type ThreadRun */\n ThreadRunCreated = \"thread.run.created\",\n\n /** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */\n ThreadRunQueued = \"thread.run.queued\",\n\n /** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */\n ThreadRunInProgress = \"thread.run.in_progress\",\n\n /** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */\n ThreadRunRequiresAction = \"thread.run.requires_action\",\n\n /** Event sent when a run is completed. The data of this event is of type ThreadRun */\n ThreadRunCompleted = \"thread.run.completed\",\n\n /** Event sent when a run fails. The data of this event is of type ThreadRun */\n ThreadRunFailed = \"thread.run.failed\",\n\n /** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */\n ThreadRunCancelling = \"thread.run.cancelling\",\n\n /** Event sent when a run is cancelled. The data of this event is of type ThreadRun */\n ThreadRunCancelled = \"thread.run.cancelled\",\n\n /** Event sent when a run is expired. The data of this event is of type ThreadRun */\n ThreadRunExpired = \"thread.run.expired\",\n}\n\n/** Run step operation related streaming events */\nexport enum RunStepStreamEvent {\n /** Event sent when a new thread run step is created. The data of this event is of type RunStep */\n ThreadRunStepCreated = \"thread.run.step.created\",\n\n /** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */\n ThreadRunStepInProgress = \"thread.run.step.in_progress\",\n\n /** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */\n ThreadRunStepDelta = \"thread.run.step.delta\",\n\n /** Event sent when a run step is completed. The data of this event is of type RunStep */\n ThreadRunStepCompleted = \"thread.run.step.completed\",\n\n /** Event sent when a run step fails. The data of this event is of type RunStep */\n ThreadRunStepFailed = \"thread.run.step.failed\",\n\n /** Event sent when a run step is cancelled. The data of this event is of type RunStep */\n ThreadRunStepCancelled = \"thread.run.step.cancelled\",\n\n /** Event sent when a run step is expired. The data of this event is of type RunStep */\n ThreadRunStepExpired = \"thread.run.step.expired\",\n}\n\n/** Message operation related streaming events */\nexport enum MessageStreamEvent {\n /** Event sent when a new message is created. The data of this event is of type ThreadMessage */\n ThreadMessageCreated = \"thread.message.created\",\n\n /** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */\n ThreadMessageInProgress = \"thread.message.in_progress\",\n\n /** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */\n ThreadMessageDelta = \"thread.message.delta\",\n\n /** Event sent when a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageCompleted = \"thread.message.completed\",\n\n /** Event sent before a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageIncomplete = \"thread.message.incomplete\",\n}\n\n/** Terminal event indicating a server side error while streaming. */\nexport enum ErrorEvent {\n /** Event sent when an error occurs, such as an internal server error or a timeout. */\n Error = \"error\",\n}\n\n/** Terminal event indicating the successful end of a stream. */\nexport enum DoneEvent {\n /** Event sent when the stream is done. */\n Done = \"done\",\n}\n\n/**\n Represents the type of an agent stream event.\n */\nexport type AgentStreamEventType =\n | ThreadStreamEvent\n | RunStreamEvent\n | RunStepStreamEvent\n | MessageStreamEvent\n | ErrorEvent\n | DoneEvent;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n"]}
@@ -2,7 +2,7 @@ import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSe
2
2
  /**
3
3
  * Determines if the given output is of the specified type.
4
4
  *
5
- * @template T - The type to check against, which extends one of the possible output parent types.
5
+ * @typeparam T - The type to check against, which extends one of the possible output parent types.
6
6
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
7
7
  * @param type - The type to check the action against.
8
8
  * @returns A boolean indicating whether the action is of the specified type.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Determines if the given output is of the specified type.
5
5
  *
6
- * @template T - The type to check against, which extends one of the possible output parent types.
6
+ * @typeparam T - The type to check against, which extends one of the possible output parent types.
7
7
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
8
8
  * @param type - The type to check the action against.
9
9
  * @returns A boolean indicating whether the action is of the specified type.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IA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AClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,sBAAsB,CACpB,OAAkB,EAClB,WAA0C;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,yBAAyB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,oBAAoB,CAClB,iBAAyB,EACzB,SAAiB;QAEjB,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;QAC/E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @template T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC;;;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CAAC,oBAAoB,CAAC,cAAc,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;QAC/F,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,sBAAsB,CACpB,OAAkB,EAClB,WAA0C;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,yBAAyB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,oBAAoB,CAClB,iBAAyB,EACzB,SAAiB;QAEjB,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;QAC/E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @typeparam T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
@@ -39,7 +39,7 @@ export interface PollingOptions {
39
39
  */
40
40
  sleepIntervalInMs?: number;
41
41
  /**
42
- * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.
42
+ * An AbortSignalLike object (as defined by \@azure/abort-controller) that can be used to cancel the polling operation.
43
43
  */
44
44
  abortSignal?: AbortSignalLike;
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
1
+ {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by \\@azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
@@ -3,10 +3,10 @@ import type { AgentThreadOutput, RunStepOutput, ThreadMessageOutput, ThreadRunOu
3
3
  /**
4
4
  Each event in a server-sent events stream has an `event` and `data` property:
5
5
 
6
- ```
6
+ ```
7
7
  event: thread.created
8
8
  data: {"id": "thread_123", "object": "thread", ...}
9
- ```
9
+ ```
10
10
 
11
11
  We emit events whenever a new object is created, transitions to a new state, or is being
12
12
  streamed in parts (deltas). For example, we emit `thread.run.created` when a new run
@@ -1 +1 @@
1
- {"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/agents/streamingModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4ClC,gDAAgD;AAChD,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,6FAA6F;IAC7F,qDAAgC,CAAA;AAClC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,6CAA6C;AAC7C,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,wFAAwF;IACxF,yDAAuC,CAAA;IAEvC,kGAAkG;IAClG,uDAAqC,CAAA;IAErC,uGAAuG;IACvG,gEAA8C,CAAA;IAE9C,2GAA2G;IAC3G,wEAAsD,CAAA;IAEtD,sFAAsF;IACtF,6DAA2C,CAAA;IAE3C,+EAA+E;IAC/E,uDAAqC,CAAA;IAErC,sGAAsG;IACtG,+DAA6C,CAAA;IAE7C,sFAAsF;IACtF,6DAA2C,CAAA;IAE3C,oFAAoF;IACpF,yDAAuC,CAAA;AACzC,CAAC,EA3BW,cAAc,KAAd,cAAc,QA2BzB;AAED,kDAAkD;AAClD,MAAM,CAAN,IAAY,kBAqBX;AArBD,WAAY,kBAAkB;IAC5B,kGAAkG;IAClG,sEAAgD,CAAA;IAEhD,0GAA0G;IAC1G,6EAAuD,CAAA;IAEvD,wGAAwG;IACxG,kEAA4C,CAAA;IAE5C,yFAAyF;IACzF,0EAAoD,CAAA;IAEpD,kFAAkF;IAClF,oEAA8C,CAAA;IAE9C,yFAAyF;IACzF,0EAAoD,CAAA;IAEpD,uFAAuF;IACvF,sEAAgD,CAAA;AAClD,CAAC,EArBW,kBAAkB,KAAlB,kBAAkB,QAqB7B;AAED,iDAAiD;AACjD,MAAM,CAAN,IAAY,kBAeX;AAfD,WAAY,kBAAkB;IAC5B,gGAAgG;IAChG,qEAA+C,CAAA;IAE/C,+GAA+G;IAC/G,4EAAsD,CAAA;IAEtD,uGAAuG;IACvG,iEAA2C,CAAA;IAE3C,8FAA8F;IAC9F,yEAAmD,CAAA;IAEnD,gGAAgG;IAChG,2EAAqD,CAAA;AACvD,CAAC,EAfW,kBAAkB,KAAlB,kBAAkB,QAe7B;AAED,qEAAqE;AACrE,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sFAAsF;IACtF,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,gEAAgE;AAChE,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,0CAA0C;IAC1C,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MessageDeltaChunk, RunStepDeltaChunk } from \"../customization/streamingModels.js\";\nimport type {\n AgentThreadOutput,\n RunStepOutput,\n ThreadMessageOutput,\n ThreadRunOutput,\n} from \"../customization/outputModels.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n \n ```\n event: thread.created\n data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n ```\n \n We emit events whenever a new object is created, transitions to a new state, or is being\n streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n to create a message during a run, we emit a `thread.message.created event`, a\n `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n `thread.message.completed` event.\n \n We may add additional events over time, so we recommend handling unknown events gracefully\n in your code.**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamDataOutput;\n /** The type of the event. */\n event: AgentStreamEventType | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamDataOutput =\n | AgentThreadOutput\n | ThreadRunOutput\n | RunStepOutput\n | ThreadMessageOutput\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Thread operation related streaming events */\nexport enum ThreadStreamEvent {\n /** Event sent when a new thread is created. The data of this event is of type AgentThread */\n ThreadCreated = \"thread.created\",\n}\n\n/** Run operation related streaming events */\nexport enum RunStreamEvent {\n /** Event sent when a new run is created. The data of this event is of type ThreadRun */\n ThreadRunCreated = \"thread.run.created\",\n\n /** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */\n ThreadRunQueued = \"thread.run.queued\",\n\n /** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */\n ThreadRunInProgress = \"thread.run.in_progress\",\n\n /** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */\n ThreadRunRequiresAction = \"thread.run.requires_action\",\n\n /** Event sent when a run is completed. The data of this event is of type ThreadRun */\n ThreadRunCompleted = \"thread.run.completed\",\n\n /** Event sent when a run fails. The data of this event is of type ThreadRun */\n ThreadRunFailed = \"thread.run.failed\",\n\n /** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */\n ThreadRunCancelling = \"thread.run.cancelling\",\n\n /** Event sent when a run is cancelled. The data of this event is of type ThreadRun */\n ThreadRunCancelled = \"thread.run.cancelled\",\n\n /** Event sent when a run is expired. The data of this event is of type ThreadRun */\n ThreadRunExpired = \"thread.run.expired\",\n}\n\n/** Run step operation related streaming events */\nexport enum RunStepStreamEvent {\n /** Event sent when a new thread run step is created. The data of this event is of type RunStep */\n ThreadRunStepCreated = \"thread.run.step.created\",\n\n /** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */\n ThreadRunStepInProgress = \"thread.run.step.in_progress\",\n\n /** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */\n ThreadRunStepDelta = \"thread.run.step.delta\",\n\n /** Event sent when a run step is completed. The data of this event is of type RunStep */\n ThreadRunStepCompleted = \"thread.run.step.completed\",\n\n /** Event sent when a run step fails. The data of this event is of type RunStep */\n ThreadRunStepFailed = \"thread.run.step.failed\",\n\n /** Event sent when a run step is cancelled. The data of this event is of type RunStep */\n ThreadRunStepCancelled = \"thread.run.step.cancelled\",\n\n /** Event sent when a run step is expired. The data of this event is of type RunStep */\n ThreadRunStepExpired = \"thread.run.step.expired\",\n}\n\n/** Message operation related streaming events */\nexport enum MessageStreamEvent {\n /** Event sent when a new message is created. The data of this event is of type ThreadMessage */\n ThreadMessageCreated = \"thread.message.created\",\n\n /** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */\n ThreadMessageInProgress = \"thread.message.in_progress\",\n\n /** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */\n ThreadMessageDelta = \"thread.message.delta\",\n\n /** Event sent when a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageCompleted = \"thread.message.completed\",\n\n /** Event sent before a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageIncomplete = \"thread.message.incomplete\",\n}\n\n/** Terminal event indicating a server side error while streaming. */\nexport enum ErrorEvent {\n /** Event sent when an error occurs, such as an internal server error or a timeout. */\n Error = \"error\",\n}\n\n/** Terminal event indicating the successful end of a stream. */\nexport enum DoneEvent {\n /** Event sent when the stream is done. */\n Done = \"done\",\n}\n\n/**\n Represents the type of an agent stream event.\n */\nexport type AgentStreamEventType =\n | ThreadStreamEvent\n | RunStreamEvent\n | RunStepStreamEvent\n | MessageStreamEvent\n | ErrorEvent\n | DoneEvent;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n"]}
1
+ {"version":3,"file":"streamingModels.js","sourceRoot":"","sources":["../../../src/agents/streamingModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4ClC,gDAAgD;AAChD,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAA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GX;AAHD,WAAY,UAAU;IACpB,sFAAsF;IACtF,6BAAe,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,gEAAgE;AAChE,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,0CAA0C;IAC1C,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MessageDeltaChunk, RunStepDeltaChunk } from \"../customization/streamingModels.js\";\nimport type {\n AgentThreadOutput,\n RunStepOutput,\n ThreadMessageOutput,\n ThreadRunOutput,\n} from \"../customization/outputModels.js\";\n\n/**\nEach event in a server-sent events stream has an `event` and `data` property:\n \n```\n event: thread.created\n data: {\"id\": \"thread_123\", \"object\": \"thread\", ...}\n```\n \n We emit events whenever a new object is created, transitions to a new state, or is being\n streamed in parts (deltas). For example, we emit `thread.run.created` when a new run\n is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses\n to create a message during a run, we emit a `thread.message.created event`, a\n `thread.message.in_progress` event, many `thread.message.delta` events, and finally a\n `thread.message.completed` event.\n \n We may add additional events over time, so we recommend handling unknown events gracefully\n in your code.**/\nexport interface AgentEventMessage {\n /** The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk */\n data: AgentEventStreamDataOutput;\n /** The type of the event. */\n event: AgentStreamEventType | string;\n}\n\n/** Represents a stream event data in the agent. */\nexport type AgentEventStreamDataOutput =\n | AgentThreadOutput\n | ThreadRunOutput\n | RunStepOutput\n | ThreadMessageOutput\n | MessageDeltaChunk\n | RunStepDeltaChunk\n | string;\n\n/** Thread operation related streaming events */\nexport enum ThreadStreamEvent {\n /** Event sent when a new thread is created. The data of this event is of type AgentThread */\n ThreadCreated = \"thread.created\",\n}\n\n/** Run operation related streaming events */\nexport enum RunStreamEvent {\n /** Event sent when a new run is created. The data of this event is of type ThreadRun */\n ThreadRunCreated = \"thread.run.created\",\n\n /** Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun */\n ThreadRunQueued = \"thread.run.queued\",\n\n /** Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun */\n ThreadRunInProgress = \"thread.run.in_progress\",\n\n /** Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun */\n ThreadRunRequiresAction = \"thread.run.requires_action\",\n\n /** Event sent when a run is completed. The data of this event is of type ThreadRun */\n ThreadRunCompleted = \"thread.run.completed\",\n\n /** Event sent when a run fails. The data of this event is of type ThreadRun */\n ThreadRunFailed = \"thread.run.failed\",\n\n /** Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun */\n ThreadRunCancelling = \"thread.run.cancelling\",\n\n /** Event sent when a run is cancelled. The data of this event is of type ThreadRun */\n ThreadRunCancelled = \"thread.run.cancelled\",\n\n /** Event sent when a run is expired. The data of this event is of type ThreadRun */\n ThreadRunExpired = \"thread.run.expired\",\n}\n\n/** Run step operation related streaming events */\nexport enum RunStepStreamEvent {\n /** Event sent when a new thread run step is created. The data of this event is of type RunStep */\n ThreadRunStepCreated = \"thread.run.step.created\",\n\n /** Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep */\n ThreadRunStepInProgress = \"thread.run.step.in_progress\",\n\n /** Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk */\n ThreadRunStepDelta = \"thread.run.step.delta\",\n\n /** Event sent when a run step is completed. The data of this event is of type RunStep */\n ThreadRunStepCompleted = \"thread.run.step.completed\",\n\n /** Event sent when a run step fails. The data of this event is of type RunStep */\n ThreadRunStepFailed = \"thread.run.step.failed\",\n\n /** Event sent when a run step is cancelled. The data of this event is of type RunStep */\n ThreadRunStepCancelled = \"thread.run.step.cancelled\",\n\n /** Event sent when a run step is expired. The data of this event is of type RunStep */\n ThreadRunStepExpired = \"thread.run.step.expired\",\n}\n\n/** Message operation related streaming events */\nexport enum MessageStreamEvent {\n /** Event sent when a new message is created. The data of this event is of type ThreadMessage */\n ThreadMessageCreated = \"thread.message.created\",\n\n /** Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage */\n ThreadMessageInProgress = \"thread.message.in_progress\",\n\n /** Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk */\n ThreadMessageDelta = \"thread.message.delta\",\n\n /** Event sent when a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageCompleted = \"thread.message.completed\",\n\n /** Event sent before a message is completed. The data of this event is of type ThreadMessage */\n ThreadMessageIncomplete = \"thread.message.incomplete\",\n}\n\n/** Terminal event indicating a server side error while streaming. */\nexport enum ErrorEvent {\n /** Event sent when an error occurs, such as an internal server error or a timeout. */\n Error = \"error\",\n}\n\n/** Terminal event indicating the successful end of a stream. */\nexport enum DoneEvent {\n /** Event sent when the stream is done. */\n Done = \"done\",\n}\n\n/**\n Represents the type of an agent stream event.\n */\nexport type AgentStreamEventType =\n | ThreadStreamEvent\n | RunStreamEvent\n | RunStepStreamEvent\n | MessageStreamEvent\n | ErrorEvent\n | DoneEvent;\n\n/** Represents a stream of agent event message. */\nexport interface AgentEventMessageStream\n extends AsyncDisposable,\n AsyncIterable<AgentEventMessage> {}\n"]}
@@ -2,7 +2,7 @@ import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSe
2
2
  /**
3
3
  * Determines if the given output is of the specified type.
4
4
  *
5
- * @template T - The type to check against, which extends one of the possible output parent types.
5
+ * @typeparam T - The type to check against, which extends one of the possible output parent types.
6
6
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
7
7
  * @param type - The type to check the action against.
8
8
  * @returns A boolean indicating whether the action is of the specified type.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Determines if the given output is of the specified type.
5
5
  *
6
- * @template T - The type to check against, which extends one of the possible output parent types.
6
+ * @typeparam T - The type to check against, which extends one of the possible output parent types.
7
7
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
8
8
  * @param type - The type to check the action against.
9
9
  * @returns A boolean indicating whether the action is of the specified type.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;AAC9C,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B;AAED,MAAM,OAAO,GAAG;IACd,cAAc,EAAE,eAAe;IAC/B,gBAAgB,EAAE,iBAAiB;IACnC,oBAAoB,EAAE,qBAAqB;CAC5C,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAA4B,EAC5B,aAAuB;QAEvB,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;oBACnB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;iBACnF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,CACzB,cAAyB,EACzB,YAA+C,EAC/C,iBAAmD;QAEnD,OAAO;YACL,UAAU,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAE;Y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chToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @template T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;AAC9C,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B;AAED,MAAM,OAAO,GAAG;IACd,cAAc,EAAE,eAAe;IAC/B,gBAAgB,EAAE,iBAAiB;IACnC,oBAAoB,EAAE,qBAAqB;CAC5C,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAA4B,EAC5B,aAAuB;QAEvB,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;oBACnB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,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C,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @typeparam T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/ai-projects",
3
- "version": "1.0.0-alpha.20241230.1",
3
+ "version": "1.0.0-alpha.20250123.1",
4
4
  "description": "A generated SDK for ProjectsClient.",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -20,7 +20,8 @@
20
20
  "browser",
21
21
  "react-native"
22
22
  ],
23
- "selfLink": false
23
+ "selfLink": false,
24
+ "project": "./tsconfig.src.json"
24
25
  },
25
26
  "type": "module",
26
27
  "keywords": [
@@ -81,38 +82,37 @@
81
82
  "@opentelemetry/api": "^1.9.0",
82
83
  "@opentelemetry/instrumentation": "0.57.0",
83
84
  "@opentelemetry/sdk-trace-node": "^1.30.0",
84
- "@vitest/browser": "^2.0.5",
85
- "@vitest/coverage-istanbul": "^2.0.5",
85
+ "@vitest/browser": "^3.0.3",
86
+ "@vitest/coverage-istanbul": "^3.0.3",
86
87
  "@types/node": "^18.0.0",
87
88
  "dotenv": "^16.0.0",
88
- "eslint": "^8.55.0",
89
+ "eslint": "^9.9.0",
89
90
  "prettier": "^3.2.5",
90
91
  "playwright": "^1.41.2",
91
- "typescript": "~5.5.3",
92
- "tshy": "^1.11.1",
93
- "vitest": "^2.0.5"
92
+ "typescript": "~5.7.2",
93
+ "vitest": "^3.0.3"
94
94
  },
95
95
  "scripts": {
96
- "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
97
- "extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
98
- "pack": "npm pack 2>&1",
99
- "lint": "eslint package.json api-extractor.json src test",
100
- "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
101
96
  "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
97
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
102
98
  "build:samples": "echo skipped",
99
+ "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test",
103
100
  "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"samples-dev/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
101
+ "clean": "dev-tool run vendored rimraf --glob dist dist-* test-dist temp types *.tgz *.log",
104
102
  "execute:samples": "dev-tool samples run samples-dev",
103
+ "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
105
104
  "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"samples-dev/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
105
+ "generate": "dev-tool run vendored rimraf ./src/generated && dev-tool run vendored mkdirp ./src/generated && cp tsp-location.yaml ./src/generated && tsp-client update -o ./src/generated && dev-tool run vendored rimraf ./src/generated/tsp-location.yaml",
106
106
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
107
- "integration-test:browser": "dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
108
- "integration-test:node": "dev-tool run test:vitest --no-test-proxy",
109
- "generate:client": "echo skipped",
110
- "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
111
- "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
112
- "build:test": "npm run clean && tshy && dev-tool run build-test",
113
- "build": "npm run clean && tshy && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
114
- "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
115
- "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
107
+ "integration-test:browser": "npm run unit-test:browser --no-test-proxy",
108
+ "integration-test:node": "npm run unit-test:node --no-test-proxy",
109
+ "lint": "eslint package.json api-extractor.json src test",
110
+ "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
111
+ "pack": "npm pack 2>&1",
112
+ "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
113
+ "test:browser": "npm run clean && npm run unit-test:browser && npm run integration-test:browser",
114
+ "test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node",
115
+ "unit-test": "npm run unit-test:node && npm run unit-test:browser",
116
116
  "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser",
117
117
  "unit-test:node": "dev-tool run test:vitest"
118
118
  },
@@ -120,22 +120,18 @@
120
120
  "./package.json": "./package.json",
121
121
  ".": {
122
122
  "browser": {
123
- "source": "./src/index.ts",
124
123
  "types": "./dist/browser/index.d.ts",
125
124
  "default": "./dist/browser/index.js"
126
125
  },
127
126
  "react-native": {
128
- "source": "./src/index.ts",
129
127
  "types": "./dist/react-native/index.d.ts",
130
128
  "default": "./dist/react-native/index.js"
131
129
  },
132
130
  "import": {
133
- "source": "./src/index.ts",
134
131
  "types": "./dist/esm/index.d.ts",
135
132
  "default": "./dist/esm/index.js"
136
133
  },
137
134
  "require": {
138
- "source": "./src/index.ts",
139
135
  "types": "./dist/commonjs/index.d.ts",
140
136
  "default": "./dist/commonjs/index.js"
141
137
  }