共用方式為


@azure/ai-agents package

類別

AgentsClient
ToolSet

表示一組具有其定義和資源的工具。

ToolUtility

用於建立各種工具的公用程序類別。

介面

AISearchIndexResource

AI 搜尋索引資源。

Agent

表示可以呼叫模型並使用工具的代理程式。

AgentDeletionStatus

代理程式刪除作業的狀態。

AgentErrorDetail

描述代理 API 傳回的錯誤資訊。

AgentEventMessage

伺服器傳送事件數據流中的每個事件都有一個 eventdata 屬性:* *

範例

  • event:thread.created
  • data: {“id”: “thread_123”, “object”: “thread”, ...}
  • 每當建立新物件、轉換至新狀態或正在發生時,我們就會發出事件
  • 串流於部分(差異)。 例如,當新的執行時,我們會發出 thread.run.created
  • 會在執行完成時建立、thread.run.completed 等等。 當代理程式選擇時
  • 若要在執行期間建立訊息,我們會發出 thread.message.created event
  • thread.message.in_progress 事件、許多 thread.message.delta 事件,最後是
  • thread.message.completed 事件。
  • 我們可能會隨著時間新增其他事件,因此建議您正常處理未知的事件
  • 在您的程式代碼中。
AgentEventMessageStream

表示代理程式事件訊息的數據流。

AgentThread

與代理程式相關聯的單一線程相關信息。

AgentThreadCreationOptions

用來建立新代理程式線程的詳細數據。

AgentV1Error

代理 API 傳回的錯誤負載。

AgentsClientOptionalParams

用戶端的選擇性參數。

AgentsNamedToolChoice

指定模型應使用的工具。 用來強制模型呼叫特定工具。

AgentsResponseFormat

描述模型預期輸出的物件。 若為 json_object,則僅允許將 function 類型 tools 傳遞至執行。 若為 text,則模型可傳回文字或所需的任何值。

AzureAISearchToolDefinition

用來設定代理程式的 Azure AI 搜尋工具輸入定義資訊。

AzureAISearchToolResource

azure_ai_search 工具所使用的一組索引資源。

AzureFunctionBinding

保留記憶體佇列名稱和 URI 的結構。

AzureFunctionDefinition

Azure 函式的定義。

AzureFunctionStorageQueue

保留記憶體佇列名稱和 URI 的結構。

AzureFunctionToolDefinition

Azure 函式工具的輸入定義資訊,用來設定代理程式。

BingGroundingSearchConfiguration

搜索 Bing Grounding 的配置

BingGroundingSearchToolParameters

bing 接地搜索工具參數。

BingGroundingToolDefinition

用於設定代理程式的 bing 地面搜尋工具輸入定義資訊。

CodeInterpreterToolDefinition

程式代碼解釋器工具的輸入定義資訊,用來設定代理程式。

CodeInterpreterToolResource

code_interpreter 工具所使用的一組資源。

ConnectedAgentDetails

將一個代理作為工具連接到另一個代理的資訊

ConnectedAgentToolDefinition

已連接代理程式工具的輸入定義資訊,用於定義特定於域的子代理程式

CreateAgentOptionalParams

選擇性參數。

CreateThreadAndRunOptionalParams

選擇性參數。

DeleteAgentOptionalParams

選擇性參數。

FileDeletionStatus

檔案刪除作業的狀態回應。

FileInfo

表示可以呼叫模型並使用工具的代理程式。

FileListResponse

來自檔案清單作業的回應數據。

FileSearchRankingOptions

檔案搜尋的排名選項。

FileSearchToolCallContent

檔案搜尋結果內容物件。

FileSearchToolDefinition

用來設定代理程式的檔案搜尋工具輸入定義資訊。

FileSearchToolDefinitionDetails

檔案搜尋工具的選項覆寫。

FileSearchToolResource

file_search 工具所使用的一組資源。

FilesDeleteFileOptionalParams

選擇性參數。

FilesGetFileContentOptionalParams

選擇性參數。

FilesGetFileOptionalParams

選擇性參數。

FilesListFilesOptionalParams

選擇性參數。

FilesOperations

表示 Files作的介面。

FilesUploadFileOptionalParams

選擇性參數。

FunctionDefinition

函式的輸入定義資訊。

FunctionName

如果使用 function 工具,將會使用的函式名稱

FunctionToolDefinition

用來設定代理程式的函式工具輸入定義資訊。

GetAgentOptionalParams

選擇性參數。

IncompleteRunDetails

執行不完整的詳細原因。 如果執行未完成,將會 null

ListAgentsOptionalParams

選擇性參數。

MessageAttachment

這描述已附加檔案的工具。

MessageContent

線程訊息內容之單一專案的抽象表示。

MessageDelta

表示串流訊息差異區塊內的具型別 'delta' 承載。

MessageDeltaChunk

代表訊息差異,也就是訊息在串流處理期間的任何欄位變更。

MessageDeltaContent

部分串流訊息內容承載的抽象基底表示。

MessageDeltaImageFileContent

表示串流訊息差異區塊內的串流圖像檔內容部分。

MessageDeltaImageFileContentObject

表示串流圖像檔內容內的「image_file」承載。

MessageDeltaTextAnnotation

串流文字內容部分文字批注的抽象基底表示。

MessageDeltaTextContent

表示串流訊息差異區塊內的串流文字內容部分。

MessageDeltaTextContentObject

表示串流訊息差異區塊內串流文字內容部分的數據。

MessageDeltaTextFileCitationAnnotation

表示套用至串流文字內容部分的串流檔引文。

MessageDeltaTextFileCitationAnnotationObject

表示串流檔引文的數據,如套用至串流文字內容部分。

MessageDeltaTextFilePathAnnotation

表示套用至串流文字內容部分的串流檔案路徑批注。

MessageDeltaTextFilePathAnnotationObject

表示套用至串流文字內容部分之串流檔案路徑批註的數據。

MessageDeltaTextUrlCitationAnnotation

消息中指向與消息關聯的特定 URL 的引文。 當代理使用「bing_grounding」等工具搜索 Internet 時生成。

MessageDeltaTextUrlCitationDetails

URL 引用的表示形式,用於文本線程消息內容。

MessageImageFileContent

表示線程訊息中的圖像檔內容。

MessageImageFileDetails

影像參考,如線程訊息內容所示。

MessageImageFileParam

定義在創建 image-file 塊時如何引用內部上傳的 image 檔。

MessageImageUrlParam

定義在創建 image-URL 塊時如何引用外部圖像 URL。

MessageIncompleteDetails

提供有關輸入不完整狀態之訊息的其他詳細數據的資訊。

MessageInputContentBlock

建立訊息時定義單一內容區塊。 [類型] 欄位會判斷它是否為文字、圖像檔案或外部影像 URL 等等。

MessageInputImageFileBlock

新消息中的 image-file 塊,通過檔 ID 引用內部上傳的圖像。

MessageInputImageUrlBlock

新消息中的 image-URL 塊,通過 URL 引用外部圖像。

MessageInputTextBlock

新消息中的文字塊,包含純文本內容。

MessageTextAnnotation

文字線程訊息內容的批注抽象表示。

MessageTextContent

線程訊息內容的文字專案表示。

MessageTextDetails

代理程式線程訊息內容之單一專案的文字和相關聯的批注。

MessageTextFileCitationAnnotation

訊息內的引文,指向與代理程式或訊息相關聯之特定檔案的特定引文。 當代理程式使用 『file_search』 工具來搜尋檔案時產生。

MessageTextFileCitationDetails

檔案型文字引文的表示法,如文字線程訊息內容的檔案型批注所使用。

MessageTextFilePathAnnotation

訊息內的引文,指向位於特定路徑的檔案。

MessageTextFilePathDetails

映射檔標識碼的封裝,如訊息影像內容所使用。

MessageTextUrlCitationAnnotation

消息中指向與消息關聯的特定 URL 的引文。 當代理使用「bing_grounding」等工具搜索 Internet 時生成。

MessageTextUrlCitationDetails

URL 引用的表示形式,用於文本線程消息內容。

MessagesCreateMessageOptionalParams

選擇性參數。

MessagesGetMessageOptionalParams

選擇性參數。

MessagesListMessagesOptionalParams

選擇性參數。

MessagesOperations

表示 Messages作的介面。

MessagesUpdateMessageOptionalParams

選擇性參數。

OpenApiAnonymousAuthDetails

OpenApi 匿名驗證的安全性詳細數據

OpenApiAuthDetails

OpenApiFunctionDefinition 的驗證詳細數據

OpenApiConnectionAuthDetails

OpenApi 連線驗證的安全性詳細數據

OpenApiConnectionSecurityScheme

OpenApi managed_identity 驗證的安全性配置

OpenApiFunctionDefinition

openapi 函式的輸入定義資訊。

OpenApiManagedAuthDetails

OpenApi managed_identity驗證的安全性詳細數據

OpenApiManagedSecurityScheme

OpenApi managed_identity 驗證的安全性配置

OpenApiToolDefinition

OpenAPI 工具的輸入定義資訊,用來設定代理程式。

PageSettings

byPage 方法的選項

PagedAsyncIterableIterator

介面,可讓異步反覆運算同時完成和逐頁執行。

PollingOptions

設定輪詢行為的選項。

PollingOptionsParams

設定輪詢行為的選擇性參數。

RequiredAction

代理程式線程執行所需動作的抽象表示法,以繼續執行。

RequiredFunctionToolCall

模型需要之函式工具所要求呼叫的表示法,以繼續評估執行。

RequiredFunctionToolCallDetails

函式調用的詳細資訊,如叫用函式工具的必要動作所提供,其中包含函式的名稱和自變數。

RequiredToolCall

模型需要之工具調用的抽象表示法,以繼續執行。

ResponseFormatJsonSchema

回應格式用途的描述,模型用來決定如何以該格式進行回應。

ResponseFormatJsonSchemaType

定義的回應格式類型:json_schema

RunCompletionUsage

與執行相關的使用量統計資料。 如果執行不是處於終端狀態(例如 nullin_progress等),則此值將會 queued

RunError

代理程式線程執行所遇到的錯誤詳細數據。

RunStep

代理程式線程執行單一步驟的詳細資訊。

RunStepAzureAISearchToolCall

呼叫 Azure AI 搜尋工具的記錄,由模型在評估已定義的工具時發出,代表已執行的 Azure AI 搜尋。

RunStepBingGroundingToolCall

呼叫 bing 地面工具的記錄,由模型在評估已定義的工具時發出,代表使用 bing 地面執行的搜尋。

RunStepCodeInterpreterImageOutput

程式代碼解釋器工具發出之影像輸出的表示法,以回應模型所呼叫的工具。

RunStepCodeInterpreterImageReference

程式代碼解釋器工具發出的影像參考,以回應模型的工具呼叫。

RunStepCodeInterpreterLogOutput

程式代碼解釋器工具發出之記錄輸出的表示法,以回應模型的工具呼叫。

RunStepCodeInterpreterToolCall

呼叫程式代碼解釋器工具的記錄,由模型在評估已定義的工具時發出,代表程式代碼解釋器所取用和發出的輸入和輸出。

RunStepCodeInterpreterToolCallDetails

模型調用程式代碼解釋器的詳細資訊。

RunStepCodeInterpreterToolCallOutput

從程式代碼解釋器工具發出之輸出的抽象表示法。

RunStepCompletionUsage

與執行步驟相關的使用量統計資料。

RunStepDelta

表示串流執行步驟差異區塊中的差異承載。

RunStepDeltaChunk

代表執行步驟差異,也就是執行步驟在串流處理期間的任何欄位變更。

RunStepDeltaCodeInterpreterDetailItemObject

表示串流執行步驟工具呼叫中的程式代碼解釋器工具呼叫數據。

RunStepDeltaCodeInterpreterImageOutput

表示產生程式代碼解釋器工具的影像輸出,並在串流執行步驟的差異工具呼叫集合中表示。

RunStepDeltaCodeInterpreterImageOutputObject

表示串流執行步驟的程式代碼解釋器工具呼叫影像輸出的數據。

RunStepDeltaCodeInterpreterLogOutput

表示程式代碼解釋器工具所產生的記錄輸出,以及在串流執行步驟的差異工具呼叫集合中表示。

RunStepDeltaCodeInterpreterOutput

串流執行步驟工具呼叫程式代碼解釋器工具輸出的抽象基底表示法。

RunStepDeltaCodeInterpreterToolCall

表示串流執行步驟的工具呼叫詳細數據內的程式碼解釋器工具呼叫。

RunStepDeltaDetail

表示串流執行步驟差異承載中的單一執行步驟詳細數據專案。

RunStepDeltaFileSearchToolCall

表示串流執行步驟的工具呼叫詳細數據內的檔案搜尋工具呼叫。

RunStepDeltaFunction

表示串流執行步驟差異函數工具呼叫中的函式數據。

RunStepDeltaFunctionToolCall

表示串流執行步驟的工具呼叫詳細數據內的函式工具呼叫。

RunStepDeltaMessageCreation

表示串流執行步驟差異內的訊息建立。

RunStepDeltaMessageCreationObject

表示串流執行步驟訊息建立回應對象中的數據。

RunStepDeltaToolCall

串流執行步驟差異工具呼叫詳細數據內單一工具呼叫的抽象基底表示法。

RunStepDeltaToolCallObject

表示在串流執行步驟中叫用工具呼叫。

RunStepDetails

執行步驟詳細數據的抽象表示法。

RunStepError

與失敗執行步驟相關聯的錯誤資訊。

RunStepFileSearchToolCall

呼叫檔案搜尋工具的記錄,由模型在評估已定義的工具時發出,代表已執行之檔案搜尋。

RunStepFileSearchToolCallResult

檔案搜尋工具呼叫結果。

RunStepFileSearchToolCallResults

檔案搜尋的結果。

RunStepFunctionToolCall

呼叫函式工具的記錄,由模型在評估已定義的工具時發出,代表所指定函式所取用和發出的輸入和輸出。

RunStepFunctionToolCallDetails

模型所呼叫之函式的詳細資訊。

RunStepMessageCreationDetails

與訊息建立執行步驟相關聯的詳細資訊。

RunStepMessageCreationReference

在執行步驟中建立之訊息的詳細數據。

RunStepOpenAPIToolCall

對 OpenAPI 工具的呼叫記錄,由模型在評估已定義的工具時發出,表示已執行的 OpenAPI 作。

RunStepToolCall

詳細工具呼叫的抽象表示法,如在現有回合的執行步驟中記錄。

RunStepToolCallDetails

與執行步驟呼叫工具相關聯的詳細資訊。

RunStepsGetRunStepOptionalParams

選擇性參數。

RunStepsListRunStepsOptionalParams

選擇性參數。

RunStepsOperations

表示 RunSteps作的介面。

RunsCancelRunOptionalParams

選擇性參數。

RunsCreateRunOptionalParams

選擇性參數。

RunsGetRunOptionalParams

選擇性參數。

RunsListRunsOptionalParams

選擇性參數。

RunsOperations

表示 Runs作的介面。

RunsSubmitToolOutputsToRunOptionalParams

選擇性參數。

RunsUpdateRunOptionalParams

選擇性參數。

SubmitToolOutputsAction

必須提交代理程式線程執行才能繼續的必要工具呼叫詳細數據。

SubmitToolOutputsDetails

描述應呼叫以提交工具輸出之工具的詳細數據。

ThreadDeletionStatus

線程刪除作業的狀態。

ThreadMessage

代理程式線程內的單一現有訊息。

ThreadMessageOptions

代理程式線程內的單一訊息,如在該線程建立其初始狀態期間提供。

ThreadRun

代表代理程式線程單一評估執行的數據。

ThreadsCreateThreadOptionalParams

選擇性參數。

ThreadsDeleteThreadOptionalParams

選擇性參數。

ThreadsGetThreadOptionalParams

選擇性參數。

ThreadsListThreadsOptionalParams

選擇性參數。

ThreadsOperations

表示 Threads作的介面。

ThreadsUpdateThreadOptionalParams

選擇性參數。

ToolDefinition

代理程式可以使用之輸入工具定義的抽象表示法。

ToolOutput

在工具期間提供的數據會輸出提交,以解析暫止的工具呼叫,並允許模型繼續。

ToolResources

代理程式工具所使用的一組資源。 工具的類型專用的資源。 例如,code_interpreter 工具需要檔案識別碼的清單,而 file_search 工具則需要向量存放區識別碼的清單。

TruncationObject

決定在執行之前如何截斷執行緒的控制項。 使用此項目,可控制執行的初始內容視窗。

UpdateAgentOptionalParams

選擇性參數。

VectorStore

向量存放區是可供 file_search 工具使用的已處理檔案集合。

VectorStoreAutoChunkingStrategyRequest

預設策略。 此策略目前使用 800 和 400 chunk_overlap_tokens的max_chunk_size_tokens。

VectorStoreAutoChunkingStrategyResponse

當區塊化策略未知時,就會傳回這個值。 一般而言,這是因為檔案是在 API 中引進chunking_strategy概念之前編製索引。

VectorStoreChunkingStrategyRequest

向量存放區區塊化策略組態的抽象表示法。

VectorStoreChunkingStrategyResponse

向量存放區區塊化策略組態的抽象表示法。

VectorStoreConfiguration

向量記憶體組態是數據源清單,當多個檔案可用於企業檔案搜尋時使用。

VectorStoreConfigurations

結構,包含向量記憶體組態的清單,也就是 Azure 資產識別碼的清單。

VectorStoreDataSource

結構,包含 Azure 資產 URI 路徑,以及做為企業檔案搜尋數據源的檔案資產類型。

VectorStoreDeletionStatus

用於刪除向量存放區的回應物件。

VectorStoreExpirationPolicy

向量存放區的到期原則。

VectorStoreFile

附加至向量存放區之檔案的描述。

VectorStoreFileBatch

附加至向量存放區的檔案批次。

VectorStoreFileBatchesCancelVectorStoreFileBatchOptionalParams

選擇性參數。

VectorStoreFileBatchesCreateVectorStoreFileBatchOptionalParams

選擇性參數。

VectorStoreFileBatchesGetVectorStoreFileBatchOptionalParams

選擇性參數。

VectorStoreFileBatchesListVectorStoreFileBatchFilesOptionalParams

選擇性參數。

VectorStoreFileBatchesOperations

表示 VectorStoreFileBatches作的介面。

VectorStoreFileCount

這個向量存放區依狀態分組處理或正在處理的檔案計數。

VectorStoreFileDeletionStatus

用於刪除向量存放區檔案關聯性的響應物件。

VectorStoreFileError

處理此向量存放區檔案時可能發生之錯誤的詳細數據

VectorStoreFilesCreateVectorStoreFileOptionalParams

選擇性參數。

VectorStoreFilesDeleteVectorStoreFileOptionalParams

選擇性參數。

VectorStoreFilesGetVectorStoreFileOptionalParams

選擇性參數。

VectorStoreFilesListVectorStoreFilesOptionalParams

選擇性參數。

VectorStoreFilesOperations

表示 VectorStoreFiles作的介面。

VectorStoreStaticChunkingStrategyOptions

設定向量存放區靜態區塊化策略的選項。

VectorStoreStaticChunkingStrategyRequest

靜態設定的區塊化策略。

VectorStoreStaticChunkingStrategyResponse

靜態設定的區塊化策略。

VectorStoresCreateVectorStoreOptionalParams

選擇性參數。

VectorStoresDeleteVectorStoreOptionalParams

選擇性參數。

VectorStoresGetVectorStoreOptionalParams

選擇性參數。

VectorStoresListVectorStoresOptionalParams

選擇性參數。

VectorStoresModifyVectorStoreOptionalParams

選擇性參數。

VectorStoresOperations

表示 VectorStores作的介面。

類型別名

AgentEventStreamData

表示代理程式中的數據流事件數據。

AgentRunResponse

代理程式會執行支持數據流的回應。

AgentStreamEvent

AgentStreamEvent 的別名

AgentsNamedToolChoiceType

代理的可用工具類型命名 tools。

AgentsResponseFormatMode

表示模型將處理工具調用的返回格式的模式。

AgentsResponseFormatOption

AgentsResponseFormatOption 的別名

AgentsToolChoiceOption

AgentsToolChoiceOption 的別名

AgentsToolChoiceOptionMode

指定如何使用工具選擇

AzureAISearchQueryType

Azure AI 搜尋工具的可用查詢類型。

ContinuablePage

描述結果頁面的介面。

FileContents

二進位檔內容的有效值。

FilePurpose

表示文件預期用途的可能值。

FileState

檔案的狀態。

ImageDetailLevel

指定圖像的細節級別。 可以是 『auto』、『low』、『high』 或未知的未來值。

IncompleteDetailsReason

執行不完整的原因。 這會指出在執行的過程中達到的特定權杖限制。

ListSortOrder

請求回應物件清單時的可用排序選項。

MessageAttachmentToolDefinition

MessageAttachmentToolDefinition 的別名

MessageBlockType

指定消息中內容塊的類型。 可以是文本、圖像檔、外部圖像 URL 或未知的未來類型。

MessageContentUnion

MessageContentUnion 的別名

MessageDeltaContentUnion

MessageDeltaContentUnion 的別名

MessageDeltaTextAnnotationUnion

MessageDeltaTextAnnotationUnion 的別名

MessageIncompleteDetailsReason

描述消息標記為未完成原因的一組原因。

MessageInputContent

MessageInputContent 的別名

MessageInputContentBlockUnion

MessageInputContentBlockUnion 的別名

MessageRole

歸因於線程中消息的角色的可能值。

MessageStatus

線程消息的可能執行狀態值。

MessageTextAnnotationUnion

MessageTextAnnotationUnion 的別名

OpenApiAuthDetailsUnion

OpenApiAuthDetailsUnion 的別名

OpenApiAuthType

OpenApi 終端節點的身份驗證類型。 允許的類型包括:

  • 匿名(無需身份驗證)
  • 連接(需要connection_id到端點,如 AI Foundry 中的設置)
  • Managed_Identity (需要受眾進行基於身份的身份驗證)
RequiredActionUnion

RequiredActionUnion 的別名

RequiredToolCallUnion

RequiredToolCallUnion 的別名

ResponseFormat

可能的 API 回應格式。

RunAdditionalFieldList

要包含在回應中的其他欄位清單。

RunStatus

代理線程運行狀態的可能值。

RunStepCodeInterpreterToolCallOutputUnion

RunStepCodeInterpreterToolCallOutputUnion 的別名

RunStepDeltaCodeInterpreterOutputUnion

RunStepDeltaCodeInterpreterOutputUnion 的別名

RunStepDeltaDetailUnion

RunStepDeltaDetailUnion 的別名

RunStepDeltaToolCallUnion

RunStepDeltaToolCallUnion 的別名

RunStepDetailsUnion

RunStepDetailsUnion 的別名

RunStepErrorCode

可能歸因於失敗的運行步驟的錯誤代碼值。

RunStepStatus

運行步驟狀態的可能值。

RunStepToolCallUnion

RunStepToolCallUnion 的別名

RunStepType

可能的運行步驟類型。

ToolDefinitionUnion

ToolDefinitionUnion 的別名

TruncationStrategy

線程的可能截斷策略。

VectorStoreChunkingStrategyRequestType

分塊策略的類型

VectorStoreChunkingStrategyRequestUnion

VectorStoreChunkingStrategyRequestUnion 的別名

VectorStoreChunkingStrategyResponseType

分塊策略的類型

VectorStoreChunkingStrategyResponseUnion

VectorStoreChunkingStrategyResponseUnion 的別名

VectorStoreExpirationPolicyAnchor

描述此向量存儲的天數與過期時間之間的關係

VectorStoreFileBatchStatus

向量存儲檔批處理的狀態。

VectorStoreFileErrorCode

向量存儲檔處理的錯誤代碼變體

VectorStoreFileStatus

向量存儲文件狀態

VectorStoreFileStatusFilter

向量儲存檔檢索終端節點的查詢參數過濾器

VectorStoreStatus

向量存儲可能的狀態

列舉

DoneEvent

指出數據流成功結束的終端事件。

ErrorEvent

終端機事件,指出串流時發生伺服器端錯誤。

KnownVersions

Azure AI 代理 API 版本

MessageStreamEvent

訊息作業相關的串流事件

RunStepStreamEvent

執行步驟作業相關的串流事件

RunStreamEvent

執行作業相關的串流事件

ThreadStreamEvent

線程作業相關的串流事件

VectorStoreDataSourceAssetType

向量存儲資產的類型。 資產類型可以是uri_asset,在這種情況下,它應包含資產 URI ID,在這種情況下,它應包含數據 ID id_asset。

connectionToolType

用來設定代理程式的連線工具類型

函式

isOutputOfType<T>(ToolDefinitionUnion | RequiredAction | RequiredToolCall, string)

判斷指定的輸出是否為指定的型別。

函式詳細資料

isOutputOfType<T>(ToolDefinitionUnion | RequiredAction | RequiredToolCall, string)

判斷指定的輸出是否為指定的型別。

function isOutputOfType<T>(output: ToolDefinitionUnion | RequiredAction | RequiredToolCall, type: string): output

參數

output

ToolDefinitionUnion | RequiredAction | RequiredToolCall

要檢查的動作,可以是類型為 RequiredActionRequiredToolCallToolDefinitionUnion

type

string

要檢查動作的型別。

傳回

output

布爾值,指出動作是否為指定的型別。