@lingya-ai/agents-sdk 0.1.2
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.
- package/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/apis/ChatApi.d.ts +182 -0
- package/dist/apis/ChatApi.js +411 -0
- package/dist/apis/ConfigurationApi.d.ts +62 -0
- package/dist/apis/ConfigurationApi.js +148 -0
- package/dist/apis/ConversationsApi.d.ts +403 -0
- package/dist/apis/ConversationsApi.js +914 -0
- package/dist/apis/EventsApi.d.ts +70 -0
- package/dist/apis/EventsApi.js +161 -0
- package/dist/apis/FilesApi.d.ts +174 -0
- package/dist/apis/FilesApi.js +409 -0
- package/dist/apis/InteractionsApi.d.ts +122 -0
- package/dist/apis/InteractionsApi.js +286 -0
- package/dist/apis/KnowledgeApi.d.ts +70 -0
- package/dist/apis/KnowledgeApi.js +157 -0
- package/dist/apis/MessagesApi.d.ts +236 -0
- package/dist/apis/MessagesApi.js +413 -0
- package/dist/apis/SQLApi.d.ts +126 -0
- package/dist/apis/SQLApi.js +246 -0
- package/dist/apis/WorkspaceApi.d.ts +115 -0
- package/dist/apis/WorkspaceApi.js +194 -0
- package/dist/apis/index.d.ts +10 -0
- package/dist/apis/index.js +28 -0
- package/dist/client.d.ts +116 -0
- package/dist/client.js +201 -0
- package/dist/esm/apis/ChatApi.d.ts +182 -0
- package/dist/esm/apis/ChatApi.js +407 -0
- package/dist/esm/apis/ConfigurationApi.d.ts +62 -0
- package/dist/esm/apis/ConfigurationApi.js +144 -0
- package/dist/esm/apis/ConversationsApi.d.ts +403 -0
- package/dist/esm/apis/ConversationsApi.js +910 -0
- package/dist/esm/apis/EventsApi.d.ts +70 -0
- package/dist/esm/apis/EventsApi.js +157 -0
- package/dist/esm/apis/FilesApi.d.ts +174 -0
- package/dist/esm/apis/FilesApi.js +405 -0
- package/dist/esm/apis/InteractionsApi.d.ts +122 -0
- package/dist/esm/apis/InteractionsApi.js +282 -0
- package/dist/esm/apis/KnowledgeApi.d.ts +70 -0
- package/dist/esm/apis/KnowledgeApi.js +153 -0
- package/dist/esm/apis/MessagesApi.d.ts +236 -0
- package/dist/esm/apis/MessagesApi.js +409 -0
- package/dist/esm/apis/SQLApi.d.ts +126 -0
- package/dist/esm/apis/SQLApi.js +242 -0
- package/dist/esm/apis/WorkspaceApi.d.ts +115 -0
- package/dist/esm/apis/WorkspaceApi.js +190 -0
- package/dist/esm/apis/index.d.ts +10 -0
- package/dist/esm/apis/index.js +12 -0
- package/dist/esm/client.d.ts +116 -0
- package/dist/esm/client.js +195 -0
- package/dist/esm/events.d.ts +21 -0
- package/dist/esm/events.js +33 -0
- package/dist/esm/hmac.d.ts +25 -0
- package/dist/esm/hmac.js +63 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/models/AgentFile.d.ts +50 -0
- package/dist/esm/models/AgentFile.js +64 -0
- package/dist/esm/models/AgentsConfig.d.ts +40 -0
- package/dist/esm/models/AgentsConfig.js +53 -0
- package/dist/esm/models/AiChatAwaitingInputBriefEvent.d.ts +74 -0
- package/dist/esm/models/AiChatAwaitingInputBriefEvent.js +87 -0
- package/dist/esm/models/AiChatBriefEvent.d.ts +66 -0
- package/dist/esm/models/AiChatBriefEvent.js +112 -0
- package/dist/esm/models/AiChatBriefEventList.d.ts +31 -0
- package/dist/esm/models/AiChatBriefEventList.js +44 -0
- package/dist/esm/models/AiChatCompactorWarningBriefEvent.d.ts +45 -0
- package/dist/esm/models/AiChatCompactorWarningBriefEvent.js +59 -0
- package/dist/esm/models/AiChatCompressorContextEndBriefEvent.d.ts +37 -0
- package/dist/esm/models/AiChatCompressorContextEndBriefEvent.js +51 -0
- package/dist/esm/models/AiChatCompressorContextStartBriefEvent.d.ts +37 -0
- package/dist/esm/models/AiChatCompressorContextStartBriefEvent.js +51 -0
- package/dist/esm/models/AiChatEndBriefEvent.d.ts +65 -0
- package/dist/esm/models/AiChatEndBriefEvent.js +75 -0
- package/dist/esm/models/AiChatErrorBriefEvent.d.ts +41 -0
- package/dist/esm/models/AiChatErrorBriefEvent.js +55 -0
- package/dist/esm/models/AiChatEventsBatch.d.ts +36 -0
- package/dist/esm/models/AiChatEventsBatch.js +49 -0
- package/dist/esm/models/AiChatEventsBatchInput.d.ts +34 -0
- package/dist/esm/models/AiChatEventsBatchInput.js +47 -0
- package/dist/esm/models/AiChatEventsBatchSkipped.d.ts +34 -0
- package/dist/esm/models/AiChatEventsBatchSkipped.js +47 -0
- package/dist/esm/models/AiChatFileRef.d.ts +34 -0
- package/dist/esm/models/AiChatFileRef.js +45 -0
- package/dist/esm/models/AiChatInput.d.ts +44 -0
- package/dist/esm/models/AiChatInput.js +51 -0
- package/dist/esm/models/AiChatManualInterruptBriefEvent.d.ts +37 -0
- package/dist/esm/models/AiChatManualInterruptBriefEvent.js +51 -0
- package/dist/esm/models/AiChatMessageBriefEvent.d.ts +41 -0
- package/dist/esm/models/AiChatMessageBriefEvent.js +55 -0
- package/dist/esm/models/AiChatMessageEvent.d.ts +35 -0
- package/dist/esm/models/AiChatMessageEvent.js +48 -0
- package/dist/esm/models/AiChatRequestBriefEvent.d.ts +47 -0
- package/dist/esm/models/AiChatRequestBriefEvent.js +59 -0
- package/dist/esm/models/AiChatResponseBriefEvent.d.ts +47 -0
- package/dist/esm/models/AiChatResponseBriefEvent.js +61 -0
- package/dist/esm/models/AiChatStartBriefEvent.d.ts +37 -0
- package/dist/esm/models/AiChatStartBriefEvent.js +51 -0
- package/dist/esm/models/AiChatStreamInput.d.ts +30 -0
- package/dist/esm/models/AiChatStreamInput.js +43 -0
- package/dist/esm/models/AiChatSubAgentCallBriefEvent.d.ts +53 -0
- package/dist/esm/models/AiChatSubAgentCallBriefEvent.js +67 -0
- package/dist/esm/models/AiChatSubmission.d.ts +42 -0
- package/dist/esm/models/AiChatSubmission.js +55 -0
- package/dist/esm/models/AiChatThinkBriefEvent.d.ts +41 -0
- package/dist/esm/models/AiChatThinkBriefEvent.js +55 -0
- package/dist/esm/models/AiChatToolExecutionBriefEvent.d.ts +62 -0
- package/dist/esm/models/AiChatToolExecutionBriefEvent.js +72 -0
- package/dist/esm/models/AiChatUserQueryBriefEvent.d.ts +46 -0
- package/dist/esm/models/AiChatUserQueryBriefEvent.js +58 -0
- package/dist/esm/models/ArtifactInfo.d.ts +58 -0
- package/dist/esm/models/ArtifactInfo.js +69 -0
- package/dist/esm/models/AskUserQuestionExtensionContent.d.ts +34 -0
- package/dist/esm/models/AskUserQuestionExtensionContent.js +45 -0
- package/dist/esm/models/AskUserQuestionExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/AskUserQuestionExtensionToolExtension.js +60 -0
- package/dist/esm/models/AskUserQuestionOption.d.ts +34 -0
- package/dist/esm/models/AskUserQuestionOption.js +47 -0
- package/dist/esm/models/AssistantChatMessage.d.ts +54 -0
- package/dist/esm/models/AssistantChatMessage.js +62 -0
- package/dist/esm/models/AsyncTask.d.ts +126 -0
- package/dist/esm/models/AsyncTask.js +120 -0
- package/dist/esm/models/AsyncTaskPage.d.ts +36 -0
- package/dist/esm/models/AsyncTaskPage.js +49 -0
- package/dist/esm/models/AttachmentExtension.d.ts +34 -0
- package/dist/esm/models/AttachmentExtension.js +47 -0
- package/dist/esm/models/BooleanChartColumn.d.ts +45 -0
- package/dist/esm/models/BooleanChartColumn.js +59 -0
- package/dist/esm/models/ChartColumnData.d.ts +50 -0
- package/dist/esm/models/ChartColumnData.js +86 -0
- package/dist/esm/models/ChartNumberFormat.d.ts +42 -0
- package/dist/esm/models/ChartNumberFormat.js +51 -0
- package/dist/esm/models/ChartQualitySummary.d.ts +38 -0
- package/dist/esm/models/ChartQualitySummary.js +51 -0
- package/dist/esm/models/ChartSeries.d.ts +68 -0
- package/dist/esm/models/ChartSeries.js +77 -0
- package/dist/esm/models/ChartSpec.d.ts +115 -0
- package/dist/esm/models/ChartSpec.js +121 -0
- package/dist/esm/models/ChartTimeContext.d.ts +34 -0
- package/dist/esm/models/ChartTimeContext.js +48 -0
- package/dist/esm/models/ChatMessage.d.ts +33 -0
- package/dist/esm/models/ChatMessage.js +57 -0
- package/dist/esm/models/ChatModelConfig.d.ts +62 -0
- package/dist/esm/models/ChatModelConfig.js +75 -0
- package/dist/esm/models/ChatModelSpec.d.ts +66 -0
- package/dist/esm/models/ChatModelSpec.js +63 -0
- package/dist/esm/models/ChatOptions.d.ts +54 -0
- package/dist/esm/models/ChatOptions.js +53 -0
- package/dist/esm/models/ChatStreamProbeEvent.d.ts +38 -0
- package/dist/esm/models/ChatStreamProbeEvent.js +51 -0
- package/dist/esm/models/ChatStreamProbeInput.d.ts +30 -0
- package/dist/esm/models/ChatStreamProbeInput.js +43 -0
- package/dist/esm/models/CitationMetadata.d.ts +42 -0
- package/dist/esm/models/CitationMetadata.js +51 -0
- package/dist/esm/models/CitationMetadataList.d.ts +31 -0
- package/dist/esm/models/CitationMetadataList.js +44 -0
- package/dist/esm/models/CodeMessage.d.ts +34 -0
- package/dist/esm/models/CodeMessage.js +47 -0
- package/dist/esm/models/ConfirmUploadInput.d.ts +34 -0
- package/dist/esm/models/ConfirmUploadInput.js +47 -0
- package/dist/esm/models/ConversationActivity.d.ts +62 -0
- package/dist/esm/models/ConversationActivity.js +66 -0
- package/dist/esm/models/ConversationActivityBatchInput.d.ts +30 -0
- package/dist/esm/models/ConversationActivityBatchInput.js +43 -0
- package/dist/esm/models/ConversationActivityList.d.ts +31 -0
- package/dist/esm/models/ConversationActivityList.js +44 -0
- package/dist/esm/models/ConversationConfig.d.ts +31 -0
- package/dist/esm/models/ConversationConfig.js +42 -0
- package/dist/esm/models/ConversationContextUsage.d.ts +74 -0
- package/dist/esm/models/ConversationContextUsage.js +83 -0
- package/dist/esm/models/ConversationIds.d.ts +30 -0
- package/dist/esm/models/ConversationIds.js +43 -0
- package/dist/esm/models/ConversationMessage.d.ts +84 -0
- package/dist/esm/models/ConversationMessage.js +96 -0
- package/dist/esm/models/ConversationMessagePage.d.ts +36 -0
- package/dist/esm/models/ConversationMessagePage.js +49 -0
- package/dist/esm/models/ConversationReadReceipt.d.ts +58 -0
- package/dist/esm/models/ConversationReadReceipt.js +62 -0
- package/dist/esm/models/ConversationReadReceiptInput.d.ts +30 -0
- package/dist/esm/models/ConversationReadReceiptInput.js +43 -0
- package/dist/esm/models/ConversationShareCreated.d.ts +46 -0
- package/dist/esm/models/ConversationShareCreated.js +58 -0
- package/dist/esm/models/ConversationShareInput.d.ts +34 -0
- package/dist/esm/models/ConversationShareInput.js +44 -0
- package/dist/esm/models/ConversationShareList.d.ts +31 -0
- package/dist/esm/models/ConversationShareList.js +44 -0
- package/dist/esm/models/ConversationShareRecord.d.ts +58 -0
- package/dist/esm/models/ConversationShareRecord.js +70 -0
- package/dist/esm/models/ConversationShareRevoked.d.ts +30 -0
- package/dist/esm/models/ConversationShareRevoked.js +43 -0
- package/dist/esm/models/ConversationStats.d.ts +50 -0
- package/dist/esm/models/ConversationStats.js +63 -0
- package/dist/esm/models/ConversationStatusInput.d.ts +30 -0
- package/dist/esm/models/ConversationStatusInput.js +43 -0
- package/dist/esm/models/ConversationSummary.d.ts +75 -0
- package/dist/esm/models/ConversationSummary.js +87 -0
- package/dist/esm/models/ConversationSummaryList.d.ts +31 -0
- package/dist/esm/models/ConversationSummaryList.js +44 -0
- package/dist/esm/models/ConversationTitle.d.ts +38 -0
- package/dist/esm/models/ConversationTitle.js +49 -0
- package/dist/esm/models/ConversationTitleInput.d.ts +30 -0
- package/dist/esm/models/ConversationTitleInput.js +43 -0
- package/dist/esm/models/ConversationUserMessage.d.ts +59 -0
- package/dist/esm/models/ConversationUserMessage.js +67 -0
- package/dist/esm/models/CreateFileInput.d.ts +34 -0
- package/dist/esm/models/CreateFileInput.js +47 -0
- package/dist/esm/models/DecimalChartColumn.d.ts +45 -0
- package/dist/esm/models/DecimalChartColumn.js +59 -0
- package/dist/esm/models/DefaultModel.d.ts +34 -0
- package/dist/esm/models/DefaultModel.js +47 -0
- package/dist/esm/models/DoubleChartColumn.d.ts +45 -0
- package/dist/esm/models/DoubleChartColumn.js +59 -0
- package/dist/esm/models/FieldError.d.ts +34 -0
- package/dist/esm/models/FieldError.js +47 -0
- package/dist/esm/models/FileExists.d.ts +30 -0
- package/dist/esm/models/FileExists.js +43 -0
- package/dist/esm/models/GeneratePreSignedUrlInput.d.ts +49 -0
- package/dist/esm/models/GeneratePreSignedUrlInput.js +61 -0
- package/dist/esm/models/GeneratePreSignedUrlOutput.d.ts +38 -0
- package/dist/esm/models/GeneratePreSignedUrlOutput.js +47 -0
- package/dist/esm/models/ImageGenerationExtensionContent.d.ts +30 -0
- package/dist/esm/models/ImageGenerationExtensionContent.js +43 -0
- package/dist/esm/models/ImageGenerationExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/ImageGenerationExtensionToolExtension.js +60 -0
- package/dist/esm/models/InputTokenBreakdown.d.ts +42 -0
- package/dist/esm/models/InputTokenBreakdown.js +53 -0
- package/dist/esm/models/InstantChartColumn.d.ts +45 -0
- package/dist/esm/models/InstantChartColumn.js +59 -0
- package/dist/esm/models/IntegerChartColumn.d.ts +46 -0
- package/dist/esm/models/IntegerChartColumn.js +58 -0
- package/dist/esm/models/JsRunScriptExtensionContent.d.ts +30 -0
- package/dist/esm/models/JsRunScriptExtensionContent.js +43 -0
- package/dist/esm/models/JsRunScriptExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/JsRunScriptExtensionToolExtension.js +60 -0
- package/dist/esm/models/JsRunScriptResultExtensionContent.d.ts +34 -0
- package/dist/esm/models/JsRunScriptResultExtensionContent.js +45 -0
- package/dist/esm/models/JsRunScriptResultExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/JsRunScriptResultExtensionToolExtension.js +60 -0
- package/dist/esm/models/LocalDateChartColumn.d.ts +45 -0
- package/dist/esm/models/LocalDateChartColumn.js +59 -0
- package/dist/esm/models/LocalDateTimeChartColumn.d.ts +45 -0
- package/dist/esm/models/LocalDateTimeChartColumn.js +59 -0
- package/dist/esm/models/LocalTimeChartColumn.d.ts +45 -0
- package/dist/esm/models/LocalTimeChartColumn.js +59 -0
- package/dist/esm/models/MathFormulaExtensionContent.d.ts +35 -0
- package/dist/esm/models/MathFormulaExtensionContent.js +46 -0
- package/dist/esm/models/MathFormulaExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/MathFormulaExtensionToolExtension.js +60 -0
- package/dist/esm/models/MathResultExtensionContent.d.ts +30 -0
- package/dist/esm/models/MathResultExtensionContent.js +43 -0
- package/dist/esm/models/MathResultExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/MathResultExtensionToolExtension.js +60 -0
- package/dist/esm/models/MediaAttachment.d.ts +46 -0
- package/dist/esm/models/MediaAttachment.js +59 -0
- package/dist/esm/models/ModelConfig.d.ts +36 -0
- package/dist/esm/models/ModelConfig.js +49 -0
- package/dist/esm/models/ModelKeyGroup.d.ts +39 -0
- package/dist/esm/models/ModelKeyGroup.js +52 -0
- package/dist/esm/models/MultimodalMediaAttachment.d.ts +38 -0
- package/dist/esm/models/MultimodalMediaAttachment.js +51 -0
- package/dist/esm/models/OperationResult.d.ts +34 -0
- package/dist/esm/models/OperationResult.js +45 -0
- package/dist/esm/models/PageInfo.d.ts +38 -0
- package/dist/esm/models/PageInfo.js +51 -0
- package/dist/esm/models/PlanApprovalExtensionContent.d.ts +38 -0
- package/dist/esm/models/PlanApprovalExtensionContent.js +52 -0
- package/dist/esm/models/PlanApprovalExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/PlanApprovalExtensionToolExtension.js +60 -0
- package/dist/esm/models/PlanApprovalInput.d.ts +42 -0
- package/dist/esm/models/PlanApprovalInput.js +53 -0
- package/dist/esm/models/PlanStatus.d.ts +34 -0
- package/dist/esm/models/PlanStatus.js +47 -0
- package/dist/esm/models/PreSignedReadUrl.d.ts +30 -0
- package/dist/esm/models/PreSignedReadUrl.js +43 -0
- package/dist/esm/models/ReturnedReference.d.ts +34 -0
- package/dist/esm/models/ReturnedReference.js +47 -0
- package/dist/esm/models/SkillResourceExtensionContent.d.ts +34 -0
- package/dist/esm/models/SkillResourceExtensionContent.js +47 -0
- package/dist/esm/models/SkillResourceExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/SkillResourceExtensionToolExtension.js +60 -0
- package/dist/esm/models/SqlChartDataset.d.ts +44 -0
- package/dist/esm/models/SqlChartDataset.js +57 -0
- package/dist/esm/models/SqlChartResultExtensionContent.d.ts +62 -0
- package/dist/esm/models/SqlChartResultExtensionContent.js +75 -0
- package/dist/esm/models/SqlChartResultExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/SqlChartResultExtensionToolExtension.js +60 -0
- package/dist/esm/models/SqlQueryExtensionContent.d.ts +30 -0
- package/dist/esm/models/SqlQueryExtensionContent.js +43 -0
- package/dist/esm/models/SqlQueryExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/SqlQueryExtensionToolExtension.js +60 -0
- package/dist/esm/models/SqlQueryResultExtensionContent.d.ts +59 -0
- package/dist/esm/models/SqlQueryResultExtensionContent.js +72 -0
- package/dist/esm/models/SqlQueryResultExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/SqlQueryResultExtensionToolExtension.js +60 -0
- package/dist/esm/models/SqlQueryResultPage.d.ts +63 -0
- package/dist/esm/models/SqlQueryResultPage.js +76 -0
- package/dist/esm/models/SqlQueryResultRow.d.ts +30 -0
- package/dist/esm/models/SqlQueryResultRow.js +43 -0
- package/dist/esm/models/SqlResultColumnSchema.d.ts +46 -0
- package/dist/esm/models/SqlResultColumnSchema.js +55 -0
- package/dist/esm/models/StringChartColumn.d.ts +45 -0
- package/dist/esm/models/StringChartColumn.js +59 -0
- package/dist/esm/models/SystemChatMessage.d.ts +45 -0
- package/dist/esm/models/SystemChatMessage.js +57 -0
- package/dist/esm/models/TaskProgressExtensionContent.d.ts +67 -0
- package/dist/esm/models/TaskProgressExtensionContent.js +76 -0
- package/dist/esm/models/TaskProgressExtensionToolExtension.d.ts +46 -0
- package/dist/esm/models/TaskProgressExtensionToolExtension.js +60 -0
- package/dist/esm/models/TaskSummary.d.ts +50 -0
- package/dist/esm/models/TaskSummary.js +61 -0
- package/dist/esm/models/ToolCall.d.ts +42 -0
- package/dist/esm/models/ToolCall.js +55 -0
- package/dist/esm/models/ToolExtension.d.ts +57 -0
- package/dist/esm/models/ToolExtension.js +97 -0
- package/dist/esm/models/ToolResponse.d.ts +46 -0
- package/dist/esm/models/ToolResponse.js +59 -0
- package/dist/esm/models/ToolResponseChatMessage.d.ts +46 -0
- package/dist/esm/models/ToolResponseChatMessage.js +58 -0
- package/dist/esm/models/UnknownAiChatBriefEvent.d.ts +34 -0
- package/dist/esm/models/UnknownAiChatBriefEvent.js +47 -0
- package/dist/esm/models/UnknownToolExtension.d.ts +34 -0
- package/dist/esm/models/UnknownToolExtension.js +47 -0
- package/dist/esm/models/Usage.d.ts +55 -0
- package/dist/esm/models/Usage.js +57 -0
- package/dist/esm/models/UserChatMessage.d.ts +55 -0
- package/dist/esm/models/UserChatMessage.js +63 -0
- package/dist/esm/models/UserInputAnswerInput.d.ts +46 -0
- package/dist/esm/models/UserInputAnswerInput.js +57 -0
- package/dist/esm/models/UserInputStatus.d.ts +46 -0
- package/dist/esm/models/UserInputStatus.js +51 -0
- package/dist/esm/models/ValidationError.d.ts +39 -0
- package/dist/esm/models/ValidationError.js +52 -0
- package/dist/esm/models/VariableBinding.d.ts +34 -0
- package/dist/esm/models/VariableBinding.js +47 -0
- package/dist/esm/models/WorkspaceArtifactList.d.ts +36 -0
- package/dist/esm/models/WorkspaceArtifactList.js +49 -0
- package/dist/esm/models/WorkspaceFile.d.ts +46 -0
- package/dist/esm/models/WorkspaceFile.js +60 -0
- package/dist/esm/models/WorkspaceFilePage.d.ts +36 -0
- package/dist/esm/models/WorkspaceFilePage.js +49 -0
- package/dist/esm/models/WorkspaceNonFileArtifact.d.ts +50 -0
- package/dist/esm/models/WorkspaceNonFileArtifact.js +60 -0
- package/dist/esm/models/index.d.ts +3519 -0
- package/dist/esm/models/index.js +307 -0
- package/dist/esm/runtime.d.ts +197 -0
- package/dist/esm/runtime.js +365 -0
- package/dist/esm/sse.d.ts +8 -0
- package/dist/esm/sse.js +57 -0
- package/dist/events.d.ts +21 -0
- package/dist/events.js +37 -0
- package/dist/hmac.d.ts +25 -0
- package/dist/hmac.js +67 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +25 -0
- package/dist/models/AgentFile.d.ts +50 -0
- package/dist/models/AgentFile.js +71 -0
- package/dist/models/AgentsConfig.d.ts +40 -0
- package/dist/models/AgentsConfig.js +60 -0
- package/dist/models/AiChatAwaitingInputBriefEvent.d.ts +74 -0
- package/dist/models/AiChatAwaitingInputBriefEvent.js +95 -0
- package/dist/models/AiChatBriefEvent.d.ts +66 -0
- package/dist/models/AiChatBriefEvent.js +118 -0
- package/dist/models/AiChatBriefEventList.d.ts +31 -0
- package/dist/models/AiChatBriefEventList.js +51 -0
- package/dist/models/AiChatCompactorWarningBriefEvent.d.ts +45 -0
- package/dist/models/AiChatCompactorWarningBriefEvent.js +67 -0
- package/dist/models/AiChatCompressorContextEndBriefEvent.d.ts +37 -0
- package/dist/models/AiChatCompressorContextEndBriefEvent.js +59 -0
- package/dist/models/AiChatCompressorContextStartBriefEvent.d.ts +37 -0
- package/dist/models/AiChatCompressorContextStartBriefEvent.js +59 -0
- package/dist/models/AiChatEndBriefEvent.d.ts +65 -0
- package/dist/models/AiChatEndBriefEvent.js +83 -0
- package/dist/models/AiChatErrorBriefEvent.d.ts +41 -0
- package/dist/models/AiChatErrorBriefEvent.js +63 -0
- package/dist/models/AiChatEventsBatch.d.ts +36 -0
- package/dist/models/AiChatEventsBatch.js +56 -0
- package/dist/models/AiChatEventsBatchInput.d.ts +34 -0
- package/dist/models/AiChatEventsBatchInput.js +54 -0
- package/dist/models/AiChatEventsBatchSkipped.d.ts +34 -0
- package/dist/models/AiChatEventsBatchSkipped.js +54 -0
- package/dist/models/AiChatFileRef.d.ts +34 -0
- package/dist/models/AiChatFileRef.js +52 -0
- package/dist/models/AiChatInput.d.ts +44 -0
- package/dist/models/AiChatInput.js +58 -0
- package/dist/models/AiChatManualInterruptBriefEvent.d.ts +37 -0
- package/dist/models/AiChatManualInterruptBriefEvent.js +59 -0
- package/dist/models/AiChatMessageBriefEvent.d.ts +41 -0
- package/dist/models/AiChatMessageBriefEvent.js +63 -0
- package/dist/models/AiChatMessageEvent.d.ts +35 -0
- package/dist/models/AiChatMessageEvent.js +55 -0
- package/dist/models/AiChatRequestBriefEvent.d.ts +47 -0
- package/dist/models/AiChatRequestBriefEvent.js +67 -0
- package/dist/models/AiChatResponseBriefEvent.d.ts +47 -0
- package/dist/models/AiChatResponseBriefEvent.js +69 -0
- package/dist/models/AiChatStartBriefEvent.d.ts +37 -0
- package/dist/models/AiChatStartBriefEvent.js +59 -0
- package/dist/models/AiChatStreamInput.d.ts +30 -0
- package/dist/models/AiChatStreamInput.js +50 -0
- package/dist/models/AiChatSubAgentCallBriefEvent.d.ts +53 -0
- package/dist/models/AiChatSubAgentCallBriefEvent.js +75 -0
- package/dist/models/AiChatSubmission.d.ts +42 -0
- package/dist/models/AiChatSubmission.js +62 -0
- package/dist/models/AiChatThinkBriefEvent.d.ts +41 -0
- package/dist/models/AiChatThinkBriefEvent.js +63 -0
- package/dist/models/AiChatToolExecutionBriefEvent.d.ts +62 -0
- package/dist/models/AiChatToolExecutionBriefEvent.js +80 -0
- package/dist/models/AiChatUserQueryBriefEvent.d.ts +46 -0
- package/dist/models/AiChatUserQueryBriefEvent.js +66 -0
- package/dist/models/ArtifactInfo.d.ts +58 -0
- package/dist/models/ArtifactInfo.js +76 -0
- package/dist/models/AskUserQuestionExtensionContent.d.ts +34 -0
- package/dist/models/AskUserQuestionExtensionContent.js +52 -0
- package/dist/models/AskUserQuestionExtensionToolExtension.d.ts +46 -0
- package/dist/models/AskUserQuestionExtensionToolExtension.js +68 -0
- package/dist/models/AskUserQuestionOption.d.ts +34 -0
- package/dist/models/AskUserQuestionOption.js +54 -0
- package/dist/models/AssistantChatMessage.d.ts +54 -0
- package/dist/models/AssistantChatMessage.js +70 -0
- package/dist/models/AsyncTask.d.ts +126 -0
- package/dist/models/AsyncTask.js +127 -0
- package/dist/models/AsyncTaskPage.d.ts +36 -0
- package/dist/models/AsyncTaskPage.js +56 -0
- package/dist/models/AttachmentExtension.d.ts +34 -0
- package/dist/models/AttachmentExtension.js +54 -0
- package/dist/models/BooleanChartColumn.d.ts +45 -0
- package/dist/models/BooleanChartColumn.js +67 -0
- package/dist/models/ChartColumnData.d.ts +50 -0
- package/dist/models/ChartColumnData.js +92 -0
- package/dist/models/ChartNumberFormat.d.ts +42 -0
- package/dist/models/ChartNumberFormat.js +58 -0
- package/dist/models/ChartQualitySummary.d.ts +38 -0
- package/dist/models/ChartQualitySummary.js +58 -0
- package/dist/models/ChartSeries.d.ts +68 -0
- package/dist/models/ChartSeries.js +85 -0
- package/dist/models/ChartSpec.d.ts +115 -0
- package/dist/models/ChartSpec.js +129 -0
- package/dist/models/ChartTimeContext.d.ts +34 -0
- package/dist/models/ChartTimeContext.js +55 -0
- package/dist/models/ChatMessage.d.ts +33 -0
- package/dist/models/ChatMessage.js +63 -0
- package/dist/models/ChatModelConfig.d.ts +62 -0
- package/dist/models/ChatModelConfig.js +82 -0
- package/dist/models/ChatModelSpec.d.ts +66 -0
- package/dist/models/ChatModelSpec.js +70 -0
- package/dist/models/ChatOptions.d.ts +54 -0
- package/dist/models/ChatOptions.js +60 -0
- package/dist/models/ChatStreamProbeEvent.d.ts +38 -0
- package/dist/models/ChatStreamProbeEvent.js +58 -0
- package/dist/models/ChatStreamProbeInput.d.ts +30 -0
- package/dist/models/ChatStreamProbeInput.js +50 -0
- package/dist/models/CitationMetadata.d.ts +42 -0
- package/dist/models/CitationMetadata.js +58 -0
- package/dist/models/CitationMetadataList.d.ts +31 -0
- package/dist/models/CitationMetadataList.js +51 -0
- package/dist/models/CodeMessage.d.ts +34 -0
- package/dist/models/CodeMessage.js +54 -0
- package/dist/models/ConfirmUploadInput.d.ts +34 -0
- package/dist/models/ConfirmUploadInput.js +54 -0
- package/dist/models/ConversationActivity.d.ts +62 -0
- package/dist/models/ConversationActivity.js +73 -0
- package/dist/models/ConversationActivityBatchInput.d.ts +30 -0
- package/dist/models/ConversationActivityBatchInput.js +50 -0
- package/dist/models/ConversationActivityList.d.ts +31 -0
- package/dist/models/ConversationActivityList.js +51 -0
- package/dist/models/ConversationConfig.d.ts +31 -0
- package/dist/models/ConversationConfig.js +49 -0
- package/dist/models/ConversationContextUsage.d.ts +74 -0
- package/dist/models/ConversationContextUsage.js +90 -0
- package/dist/models/ConversationIds.d.ts +30 -0
- package/dist/models/ConversationIds.js +50 -0
- package/dist/models/ConversationMessage.d.ts +84 -0
- package/dist/models/ConversationMessage.js +103 -0
- package/dist/models/ConversationMessagePage.d.ts +36 -0
- package/dist/models/ConversationMessagePage.js +56 -0
- package/dist/models/ConversationReadReceipt.d.ts +58 -0
- package/dist/models/ConversationReadReceipt.js +69 -0
- package/dist/models/ConversationReadReceiptInput.d.ts +30 -0
- package/dist/models/ConversationReadReceiptInput.js +50 -0
- package/dist/models/ConversationShareCreated.d.ts +46 -0
- package/dist/models/ConversationShareCreated.js +65 -0
- package/dist/models/ConversationShareInput.d.ts +34 -0
- package/dist/models/ConversationShareInput.js +51 -0
- package/dist/models/ConversationShareList.d.ts +31 -0
- package/dist/models/ConversationShareList.js +51 -0
- package/dist/models/ConversationShareRecord.d.ts +58 -0
- package/dist/models/ConversationShareRecord.js +77 -0
- package/dist/models/ConversationShareRevoked.d.ts +30 -0
- package/dist/models/ConversationShareRevoked.js +50 -0
- package/dist/models/ConversationStats.d.ts +50 -0
- package/dist/models/ConversationStats.js +70 -0
- package/dist/models/ConversationStatusInput.d.ts +30 -0
- package/dist/models/ConversationStatusInput.js +50 -0
- package/dist/models/ConversationSummary.d.ts +75 -0
- package/dist/models/ConversationSummary.js +94 -0
- package/dist/models/ConversationSummaryList.d.ts +31 -0
- package/dist/models/ConversationSummaryList.js +51 -0
- package/dist/models/ConversationTitle.d.ts +38 -0
- package/dist/models/ConversationTitle.js +56 -0
- package/dist/models/ConversationTitleInput.d.ts +30 -0
- package/dist/models/ConversationTitleInput.js +50 -0
- package/dist/models/ConversationUserMessage.d.ts +59 -0
- package/dist/models/ConversationUserMessage.js +75 -0
- package/dist/models/CreateFileInput.d.ts +34 -0
- package/dist/models/CreateFileInput.js +54 -0
- package/dist/models/DecimalChartColumn.d.ts +45 -0
- package/dist/models/DecimalChartColumn.js +67 -0
- package/dist/models/DefaultModel.d.ts +34 -0
- package/dist/models/DefaultModel.js +54 -0
- package/dist/models/DoubleChartColumn.d.ts +45 -0
- package/dist/models/DoubleChartColumn.js +67 -0
- package/dist/models/FieldError.d.ts +34 -0
- package/dist/models/FieldError.js +54 -0
- package/dist/models/FileExists.d.ts +30 -0
- package/dist/models/FileExists.js +50 -0
- package/dist/models/GeneratePreSignedUrlInput.d.ts +49 -0
- package/dist/models/GeneratePreSignedUrlInput.js +69 -0
- package/dist/models/GeneratePreSignedUrlOutput.d.ts +38 -0
- package/dist/models/GeneratePreSignedUrlOutput.js +54 -0
- package/dist/models/ImageGenerationExtensionContent.d.ts +30 -0
- package/dist/models/ImageGenerationExtensionContent.js +50 -0
- package/dist/models/ImageGenerationExtensionToolExtension.d.ts +46 -0
- package/dist/models/ImageGenerationExtensionToolExtension.js +68 -0
- package/dist/models/InputTokenBreakdown.d.ts +42 -0
- package/dist/models/InputTokenBreakdown.js +60 -0
- package/dist/models/InstantChartColumn.d.ts +45 -0
- package/dist/models/InstantChartColumn.js +67 -0
- package/dist/models/IntegerChartColumn.d.ts +46 -0
- package/dist/models/IntegerChartColumn.js +66 -0
- package/dist/models/JsRunScriptExtensionContent.d.ts +30 -0
- package/dist/models/JsRunScriptExtensionContent.js +50 -0
- package/dist/models/JsRunScriptExtensionToolExtension.d.ts +46 -0
- package/dist/models/JsRunScriptExtensionToolExtension.js +68 -0
- package/dist/models/JsRunScriptResultExtensionContent.d.ts +34 -0
- package/dist/models/JsRunScriptResultExtensionContent.js +52 -0
- package/dist/models/JsRunScriptResultExtensionToolExtension.d.ts +46 -0
- package/dist/models/JsRunScriptResultExtensionToolExtension.js +68 -0
- package/dist/models/LocalDateChartColumn.d.ts +45 -0
- package/dist/models/LocalDateChartColumn.js +67 -0
- package/dist/models/LocalDateTimeChartColumn.d.ts +45 -0
- package/dist/models/LocalDateTimeChartColumn.js +67 -0
- package/dist/models/LocalTimeChartColumn.d.ts +45 -0
- package/dist/models/LocalTimeChartColumn.js +67 -0
- package/dist/models/MathFormulaExtensionContent.d.ts +35 -0
- package/dist/models/MathFormulaExtensionContent.js +53 -0
- package/dist/models/MathFormulaExtensionToolExtension.d.ts +46 -0
- package/dist/models/MathFormulaExtensionToolExtension.js +68 -0
- package/dist/models/MathResultExtensionContent.d.ts +30 -0
- package/dist/models/MathResultExtensionContent.js +50 -0
- package/dist/models/MathResultExtensionToolExtension.d.ts +46 -0
- package/dist/models/MathResultExtensionToolExtension.js +68 -0
- package/dist/models/MediaAttachment.d.ts +46 -0
- package/dist/models/MediaAttachment.js +66 -0
- package/dist/models/ModelConfig.d.ts +36 -0
- package/dist/models/ModelConfig.js +56 -0
- package/dist/models/ModelKeyGroup.d.ts +39 -0
- package/dist/models/ModelKeyGroup.js +59 -0
- package/dist/models/MultimodalMediaAttachment.d.ts +38 -0
- package/dist/models/MultimodalMediaAttachment.js +58 -0
- package/dist/models/OperationResult.d.ts +34 -0
- package/dist/models/OperationResult.js +52 -0
- package/dist/models/PageInfo.d.ts +38 -0
- package/dist/models/PageInfo.js +58 -0
- package/dist/models/PlanApprovalExtensionContent.d.ts +38 -0
- package/dist/models/PlanApprovalExtensionContent.js +59 -0
- package/dist/models/PlanApprovalExtensionToolExtension.d.ts +46 -0
- package/dist/models/PlanApprovalExtensionToolExtension.js +68 -0
- package/dist/models/PlanApprovalInput.d.ts +42 -0
- package/dist/models/PlanApprovalInput.js +60 -0
- package/dist/models/PlanStatus.d.ts +34 -0
- package/dist/models/PlanStatus.js +54 -0
- package/dist/models/PreSignedReadUrl.d.ts +30 -0
- package/dist/models/PreSignedReadUrl.js +50 -0
- package/dist/models/ReturnedReference.d.ts +34 -0
- package/dist/models/ReturnedReference.js +54 -0
- package/dist/models/SkillResourceExtensionContent.d.ts +34 -0
- package/dist/models/SkillResourceExtensionContent.js +54 -0
- package/dist/models/SkillResourceExtensionToolExtension.d.ts +46 -0
- package/dist/models/SkillResourceExtensionToolExtension.js +68 -0
- package/dist/models/SqlChartDataset.d.ts +44 -0
- package/dist/models/SqlChartDataset.js +64 -0
- package/dist/models/SqlChartResultExtensionContent.d.ts +62 -0
- package/dist/models/SqlChartResultExtensionContent.js +82 -0
- package/dist/models/SqlChartResultExtensionToolExtension.d.ts +46 -0
- package/dist/models/SqlChartResultExtensionToolExtension.js +68 -0
- package/dist/models/SqlQueryExtensionContent.d.ts +30 -0
- package/dist/models/SqlQueryExtensionContent.js +50 -0
- package/dist/models/SqlQueryExtensionToolExtension.d.ts +46 -0
- package/dist/models/SqlQueryExtensionToolExtension.js +68 -0
- package/dist/models/SqlQueryResultExtensionContent.d.ts +59 -0
- package/dist/models/SqlQueryResultExtensionContent.js +79 -0
- package/dist/models/SqlQueryResultExtensionToolExtension.d.ts +46 -0
- package/dist/models/SqlQueryResultExtensionToolExtension.js +68 -0
- package/dist/models/SqlQueryResultPage.d.ts +63 -0
- package/dist/models/SqlQueryResultPage.js +83 -0
- package/dist/models/SqlQueryResultRow.d.ts +30 -0
- package/dist/models/SqlQueryResultRow.js +50 -0
- package/dist/models/SqlResultColumnSchema.d.ts +46 -0
- package/dist/models/SqlResultColumnSchema.js +62 -0
- package/dist/models/StringChartColumn.d.ts +45 -0
- package/dist/models/StringChartColumn.js +67 -0
- package/dist/models/SystemChatMessage.d.ts +45 -0
- package/dist/models/SystemChatMessage.js +65 -0
- package/dist/models/TaskProgressExtensionContent.d.ts +67 -0
- package/dist/models/TaskProgressExtensionContent.js +83 -0
- package/dist/models/TaskProgressExtensionToolExtension.d.ts +46 -0
- package/dist/models/TaskProgressExtensionToolExtension.js +68 -0
- package/dist/models/TaskSummary.d.ts +50 -0
- package/dist/models/TaskSummary.js +68 -0
- package/dist/models/ToolCall.d.ts +42 -0
- package/dist/models/ToolCall.js +62 -0
- package/dist/models/ToolExtension.d.ts +57 -0
- package/dist/models/ToolExtension.js +103 -0
- package/dist/models/ToolResponse.d.ts +46 -0
- package/dist/models/ToolResponse.js +66 -0
- package/dist/models/ToolResponseChatMessage.d.ts +46 -0
- package/dist/models/ToolResponseChatMessage.js +66 -0
- package/dist/models/UnknownAiChatBriefEvent.d.ts +34 -0
- package/dist/models/UnknownAiChatBriefEvent.js +54 -0
- package/dist/models/UnknownToolExtension.d.ts +34 -0
- package/dist/models/UnknownToolExtension.js +54 -0
- package/dist/models/Usage.d.ts +55 -0
- package/dist/models/Usage.js +64 -0
- package/dist/models/UserChatMessage.d.ts +55 -0
- package/dist/models/UserChatMessage.js +71 -0
- package/dist/models/UserInputAnswerInput.d.ts +46 -0
- package/dist/models/UserInputAnswerInput.js +64 -0
- package/dist/models/UserInputStatus.d.ts +46 -0
- package/dist/models/UserInputStatus.js +58 -0
- package/dist/models/ValidationError.d.ts +39 -0
- package/dist/models/ValidationError.js +59 -0
- package/dist/models/VariableBinding.d.ts +34 -0
- package/dist/models/VariableBinding.js +54 -0
- package/dist/models/WorkspaceArtifactList.d.ts +36 -0
- package/dist/models/WorkspaceArtifactList.js +56 -0
- package/dist/models/WorkspaceFile.d.ts +46 -0
- package/dist/models/WorkspaceFile.js +67 -0
- package/dist/models/WorkspaceFilePage.d.ts +36 -0
- package/dist/models/WorkspaceFilePage.js +56 -0
- package/dist/models/WorkspaceNonFileArtifact.d.ts +50 -0
- package/dist/models/WorkspaceNonFileArtifact.js +67 -0
- package/dist/models/index.d.ts +3519 -0
- package/dist/models/index.js +310 -0
- package/dist/runtime.d.ts +197 -0
- package/dist/runtime.js +385 -0
- package/dist/sse.d.ts +8 -0
- package/dist/sse.js +60 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lingya AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# 灵涯 Agents TypeScript SDK
|
|
2
|
+
Lingya Agents SDK for TypeScript
|
|
3
|
+
|
|
4
|
+
这是面向可信 Node.js 服务端的灵涯 Agents OpenAPI 强类型 SDK;契约包含 46 个公共接口,并生成全部请求、响应、事件与工具扩展类型。
|
|
5
|
+
This strongly typed Lingya Agents OpenAPI SDK is designed for trusted Node.js servers. Its contract covers 46 public operations and generates every request, response, event, and tool-extension type.
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @lingya-ai/agents-sdk
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
包同时支持 CommonJS `require`、ES module `import` 与 TypeScript 类型声明,运行时要求 Node.js 20 或更高版本。
|
|
15
|
+
The package supports CommonJS `require`, ES module `import`, and TypeScript declarations, and requires Node.js 20 or later.
|
|
16
|
+
|
|
17
|
+
## 调用与 SSE
|
|
18
|
+
Calls and SSE
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { LingyaAgentsClient } from '@lingya-ai/agents-sdk';
|
|
22
|
+
|
|
23
|
+
const user = new LingyaAgentsClient('https://lingtong.lingya.tech/', channelId, {
|
|
24
|
+
accessKey: process.env.OPENAPI_AK!,
|
|
25
|
+
secretKey: process.env.OPENAPI_SK!,
|
|
26
|
+
}).forUser('external-user-id');
|
|
27
|
+
|
|
28
|
+
const submission = await user.chat.createChat({
|
|
29
|
+
channelId,
|
|
30
|
+
aiChatInput: { query: '你好' },
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
for await (const event of user.streamChatEvents(submission.conversationId, submission.messageId)) {
|
|
34
|
+
if (event.type === 'end') break;
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
SDK 会在最终 URL、查询串、`Content-Type` 与正文(body)字节确定后签名;每次请求独立生成 nonce,secret 不会进入请求、日志或异常。
|
|
39
|
+
The SDK signs only after the final URL, query string, `Content-Type`, and body bytes are fixed. Every request receives a fresh nonce, and the secret is never included in requests, logs, or exceptions.
|
|
40
|
+
|
|
41
|
+
未知事件与工具扩展会分别保留为带 `rawJson` 的明确后备类型,已知结构不会退化为动态对象。
|
|
42
|
+
Unknown events and tool extensions are retained in explicit fallback types with `rawJson`; known structures never degrade into dynamic objects.
|
|
43
|
+
|
|
44
|
+
本 SDK 仅适用于可信服务端,不得在浏览器、桌面或移动客户端中分发 secret。
|
|
45
|
+
This SDK is for trusted servers only. Never distribute the secret in browser, desktop, or mobile applications.
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lingya Agents OpenAPI
|
|
3
|
+
* Public, tenant-scoped Agent channel API authenticated with OPENAPI-HMAC-SHA256-V1. Studio administration endpoints are not part of this contract.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.2
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { AiChatBriefEvent, AiChatInput, AiChatStreamInput, AiChatSubmission, ChatStreamProbeEvent, ChatStreamProbeInput } from '../models/index';
|
|
14
|
+
export interface CompactConversationRequest {
|
|
15
|
+
/**
|
|
16
|
+
* Agent OpenAPI 渠道 UUID。 / Agent OpenAPI channel UUID.
|
|
17
|
+
*/
|
|
18
|
+
channelId: string;
|
|
19
|
+
/**
|
|
20
|
+
* 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
|
|
21
|
+
*/
|
|
22
|
+
conversationId: string;
|
|
23
|
+
/**
|
|
24
|
+
* 是否忽略当前阈值并强制压缩。 / Whether to compact regardless of the current threshold.
|
|
25
|
+
*/
|
|
26
|
+
force?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface ContinueChatRequest {
|
|
29
|
+
/**
|
|
30
|
+
* Agent OpenAPI 渠道 UUID。 / Agent OpenAPI channel UUID.
|
|
31
|
+
*/
|
|
32
|
+
channelId: string;
|
|
33
|
+
/**
|
|
34
|
+
* 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
|
|
35
|
+
*/
|
|
36
|
+
conversationId: string;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
aiChatInput: AiChatInput;
|
|
41
|
+
}
|
|
42
|
+
export interface CreateChatRequest {
|
|
43
|
+
/**
|
|
44
|
+
* Agent OpenAPI 渠道 UUID。 / Agent OpenAPI channel UUID.
|
|
45
|
+
*/
|
|
46
|
+
channelId: string;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
aiChatInput: AiChatInput;
|
|
51
|
+
}
|
|
52
|
+
export interface InterruptConversationRequest {
|
|
53
|
+
/**
|
|
54
|
+
* Agent OpenAPI 渠道 UUID。 / Agent OpenAPI channel UUID.
|
|
55
|
+
*/
|
|
56
|
+
channelId: string;
|
|
57
|
+
/**
|
|
58
|
+
* 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
|
|
59
|
+
*/
|
|
60
|
+
conversationId: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ProbeEventStreamRequest {
|
|
63
|
+
/**
|
|
64
|
+
* Agent OpenAPI 渠道 UUID。 / Agent OpenAPI channel UUID.
|
|
65
|
+
*/
|
|
66
|
+
channelId: string;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
chatStreamProbeInput: ChatStreamProbeInput;
|
|
71
|
+
/**
|
|
72
|
+
* 可选诊断请求 ID,便于关联客户端与服务端日志。 / Optional diagnostic request ID used to correlate client and server logs.
|
|
73
|
+
*/
|
|
74
|
+
xRequestID?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface StreamChatEventsRequest {
|
|
77
|
+
/**
|
|
78
|
+
* Agent OpenAPI 渠道 UUID。 / Agent OpenAPI channel UUID.
|
|
79
|
+
*/
|
|
80
|
+
channelId: string;
|
|
81
|
+
/**
|
|
82
|
+
* 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
|
|
83
|
+
*/
|
|
84
|
+
conversationId: string;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
aiChatStreamInput: AiChatStreamInput;
|
|
89
|
+
/**
|
|
90
|
+
* 可选诊断请求 ID,便于关联客户端与服务端日志。 / Optional diagnostic request ID used to correlate client and server logs.
|
|
91
|
+
*/
|
|
92
|
+
xRequestID?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
*/
|
|
97
|
+
export declare class ChatApi extends runtime.BaseAPI {
|
|
98
|
+
/**
|
|
99
|
+
* Creates request options for compactConversation without sending the request
|
|
100
|
+
*/
|
|
101
|
+
compactConversationRequestOpts(requestParameters: CompactConversationRequest): Promise<runtime.RequestOpts>;
|
|
102
|
+
/**
|
|
103
|
+
* 压缩会话上下文 / Compact conversation context 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
104
|
+
* 压缩会话上下文 / Compact conversation context
|
|
105
|
+
*/
|
|
106
|
+
compactConversationRaw(requestParameters: CompactConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
107
|
+
/**
|
|
108
|
+
* 压缩会话上下文 / Compact conversation context 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
109
|
+
* 压缩会话上下文 / Compact conversation context
|
|
110
|
+
*/
|
|
111
|
+
compactConversation(requestParameters: CompactConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Creates request options for continueChat without sending the request
|
|
114
|
+
*/
|
|
115
|
+
continueChatRequestOpts(requestParameters: ContinueChatRequest): Promise<runtime.RequestOpts>;
|
|
116
|
+
/**
|
|
117
|
+
* 向已有会话提交消息 / Submit a message to an existing conversation 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
118
|
+
* 向已有会话提交消息 / Submit a message to an existing conversation
|
|
119
|
+
*/
|
|
120
|
+
continueChatRaw(requestParameters: ContinueChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiChatSubmission>>;
|
|
121
|
+
/**
|
|
122
|
+
* 向已有会话提交消息 / Submit a message to an existing conversation 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
123
|
+
* 向已有会话提交消息 / Submit a message to an existing conversation
|
|
124
|
+
*/
|
|
125
|
+
continueChat(requestParameters: ContinueChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiChatSubmission>;
|
|
126
|
+
/**
|
|
127
|
+
* Creates request options for createChat without sending the request
|
|
128
|
+
*/
|
|
129
|
+
createChatRequestOpts(requestParameters: CreateChatRequest): Promise<runtime.RequestOpts>;
|
|
130
|
+
/**
|
|
131
|
+
* 创建会话并提交消息 / Create a conversation and submit a message 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
132
|
+
* 创建会话并提交消息 / Create a conversation and submit a message
|
|
133
|
+
*/
|
|
134
|
+
createChatRaw(requestParameters: CreateChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiChatSubmission>>;
|
|
135
|
+
/**
|
|
136
|
+
* 创建会话并提交消息 / Create a conversation and submit a message 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
137
|
+
* 创建会话并提交消息 / Create a conversation and submit a message
|
|
138
|
+
*/
|
|
139
|
+
createChat(requestParameters: CreateChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiChatSubmission>;
|
|
140
|
+
/**
|
|
141
|
+
* Creates request options for interruptConversation without sending the request
|
|
142
|
+
*/
|
|
143
|
+
interruptConversationRequestOpts(requestParameters: InterruptConversationRequest): Promise<runtime.RequestOpts>;
|
|
144
|
+
/**
|
|
145
|
+
* 中断会话执行 / Interrupt conversation execution 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
146
|
+
* 中断会话执行 / Interrupt conversation execution
|
|
147
|
+
*/
|
|
148
|
+
interruptConversationRaw(requestParameters: InterruptConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
149
|
+
/**
|
|
150
|
+
* 中断会话执行 / Interrupt conversation execution 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
151
|
+
* 中断会话执行 / Interrupt conversation execution
|
|
152
|
+
*/
|
|
153
|
+
interruptConversation(requestParameters: InterruptConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Creates request options for probeEventStream without sending the request
|
|
156
|
+
*/
|
|
157
|
+
probeEventStreamRequestOpts(requestParameters: ProbeEventStreamRequest): Promise<runtime.RequestOpts>;
|
|
158
|
+
/**
|
|
159
|
+
* 探测 SSE 连接 / Probe the SSE connection 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
160
|
+
* 探测 SSE 连接 / Probe the SSE connection
|
|
161
|
+
*/
|
|
162
|
+
probeEventStreamRaw(requestParameters: ProbeEventStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatStreamProbeEvent>>;
|
|
163
|
+
/**
|
|
164
|
+
* 探测 SSE 连接 / Probe the SSE connection 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
165
|
+
* 探测 SSE 连接 / Probe the SSE connection
|
|
166
|
+
*/
|
|
167
|
+
probeEventStream(requestParameters: ProbeEventStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatStreamProbeEvent>;
|
|
168
|
+
/**
|
|
169
|
+
* Creates request options for streamChatEvents without sending the request
|
|
170
|
+
*/
|
|
171
|
+
streamChatEventsRequestOpts(requestParameters: StreamChatEventsRequest): Promise<runtime.RequestOpts>;
|
|
172
|
+
/**
|
|
173
|
+
* 订阅消息事件流 / Stream message events 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
174
|
+
* 订阅消息事件流 / Stream message events
|
|
175
|
+
*/
|
|
176
|
+
streamChatEventsRaw(requestParameters: StreamChatEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiChatBriefEvent>>;
|
|
177
|
+
/**
|
|
178
|
+
* 订阅消息事件流 / Stream message events 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
179
|
+
* 订阅消息事件流 / Stream message events
|
|
180
|
+
*/
|
|
181
|
+
streamChatEvents(requestParameters: StreamChatEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiChatBriefEvent>;
|
|
182
|
+
}
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Lingya Agents OpenAPI
|
|
6
|
+
* Public, tenant-scoped Agent channel API authenticated with OPENAPI-HMAC-SHA256-V1. Studio administration endpoints are not part of this contract.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.2
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ChatApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
class ChatApi extends runtime.BaseAPI {
|
|
31
|
+
/**
|
|
32
|
+
* Creates request options for compactConversation without sending the request
|
|
33
|
+
*/
|
|
34
|
+
compactConversationRequestOpts(requestParameters) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
if (requestParameters['channelId'] == null) {
|
|
37
|
+
throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling compactConversation().');
|
|
38
|
+
}
|
|
39
|
+
if (requestParameters['conversationId'] == null) {
|
|
40
|
+
throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling compactConversation().');
|
|
41
|
+
}
|
|
42
|
+
const queryParameters = {};
|
|
43
|
+
if (requestParameters['force'] != null) {
|
|
44
|
+
queryParameters['force'] = requestParameters['force'];
|
|
45
|
+
}
|
|
46
|
+
const headerParameters = {};
|
|
47
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
48
|
+
headerParameters["X-OpenAPI-User"] = yield this.configuration.apiKey("X-OpenAPI-User"); // OpenApiUser authentication
|
|
49
|
+
}
|
|
50
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
51
|
+
headerParameters["X-OpenAPI-AK"] = yield this.configuration.apiKey("X-OpenAPI-AK"); // OpenApiAccessKey authentication
|
|
52
|
+
}
|
|
53
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
54
|
+
headerParameters["X-OpenAPI-Timestamp"] = yield this.configuration.apiKey("X-OpenAPI-Timestamp"); // OpenApiTimestamp authentication
|
|
55
|
+
}
|
|
56
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
57
|
+
headerParameters["X-OpenAPI-Nonce"] = yield this.configuration.apiKey("X-OpenAPI-Nonce"); // OpenApiNonce authentication
|
|
58
|
+
}
|
|
59
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
60
|
+
headerParameters["X-OpenAPI-Signature"] = yield this.configuration.apiKey("X-OpenAPI-Signature"); // OpenApiSignature authentication
|
|
61
|
+
}
|
|
62
|
+
let urlPath = `/api/agents/channel/openapi/v1/{channelId}/chat/conversations/{conversationId}/compact`;
|
|
63
|
+
urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
|
|
64
|
+
urlPath = urlPath.replace('{conversationId}', encodeURIComponent(String(requestParameters['conversationId'])));
|
|
65
|
+
return {
|
|
66
|
+
path: urlPath,
|
|
67
|
+
method: 'POST',
|
|
68
|
+
headers: headerParameters,
|
|
69
|
+
query: queryParameters,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 压缩会话上下文 / Compact conversation context 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
75
|
+
* 压缩会话上下文 / Compact conversation context
|
|
76
|
+
*/
|
|
77
|
+
compactConversationRaw(requestParameters, initOverrides) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const requestOptions = yield this.compactConversationRequestOpts(requestParameters);
|
|
80
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
81
|
+
return new runtime.VoidApiResponse(response);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 压缩会话上下文 / Compact conversation context 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
86
|
+
* 压缩会话上下文 / Compact conversation context
|
|
87
|
+
*/
|
|
88
|
+
compactConversation(requestParameters, initOverrides) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
yield this.compactConversationRaw(requestParameters, initOverrides);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Creates request options for continueChat without sending the request
|
|
95
|
+
*/
|
|
96
|
+
continueChatRequestOpts(requestParameters) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
if (requestParameters['channelId'] == null) {
|
|
99
|
+
throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling continueChat().');
|
|
100
|
+
}
|
|
101
|
+
if (requestParameters['conversationId'] == null) {
|
|
102
|
+
throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling continueChat().');
|
|
103
|
+
}
|
|
104
|
+
if (requestParameters['aiChatInput'] == null) {
|
|
105
|
+
throw new runtime.RequiredError('aiChatInput', 'Required parameter "aiChatInput" was null or undefined when calling continueChat().');
|
|
106
|
+
}
|
|
107
|
+
const queryParameters = {};
|
|
108
|
+
const headerParameters = {};
|
|
109
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
110
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
111
|
+
headerParameters["X-OpenAPI-User"] = yield this.configuration.apiKey("X-OpenAPI-User"); // OpenApiUser authentication
|
|
112
|
+
}
|
|
113
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
114
|
+
headerParameters["X-OpenAPI-AK"] = yield this.configuration.apiKey("X-OpenAPI-AK"); // OpenApiAccessKey authentication
|
|
115
|
+
}
|
|
116
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
117
|
+
headerParameters["X-OpenAPI-Timestamp"] = yield this.configuration.apiKey("X-OpenAPI-Timestamp"); // OpenApiTimestamp authentication
|
|
118
|
+
}
|
|
119
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
120
|
+
headerParameters["X-OpenAPI-Nonce"] = yield this.configuration.apiKey("X-OpenAPI-Nonce"); // OpenApiNonce authentication
|
|
121
|
+
}
|
|
122
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
123
|
+
headerParameters["X-OpenAPI-Signature"] = yield this.configuration.apiKey("X-OpenAPI-Signature"); // OpenApiSignature authentication
|
|
124
|
+
}
|
|
125
|
+
let urlPath = `/api/agents/channel/openapi/v1/{channelId}/chat/conversations/{conversationId}`;
|
|
126
|
+
urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
|
|
127
|
+
urlPath = urlPath.replace('{conversationId}', encodeURIComponent(String(requestParameters['conversationId'])));
|
|
128
|
+
return {
|
|
129
|
+
path: urlPath,
|
|
130
|
+
method: 'POST',
|
|
131
|
+
headers: headerParameters,
|
|
132
|
+
query: queryParameters,
|
|
133
|
+
body: requestParameters['aiChatInput'],
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* 向已有会话提交消息 / Submit a message to an existing conversation 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
139
|
+
* 向已有会话提交消息 / Submit a message to an existing conversation
|
|
140
|
+
*/
|
|
141
|
+
continueChatRaw(requestParameters, initOverrides) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
const requestOptions = yield this.continueChatRequestOpts(requestParameters);
|
|
144
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
145
|
+
return new runtime.JSONApiResponse(response);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 向已有会话提交消息 / Submit a message to an existing conversation 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
150
|
+
* 向已有会话提交消息 / Submit a message to an existing conversation
|
|
151
|
+
*/
|
|
152
|
+
continueChat(requestParameters, initOverrides) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
const response = yield this.continueChatRaw(requestParameters, initOverrides);
|
|
155
|
+
return yield response.value();
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Creates request options for createChat without sending the request
|
|
160
|
+
*/
|
|
161
|
+
createChatRequestOpts(requestParameters) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
if (requestParameters['channelId'] == null) {
|
|
164
|
+
throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling createChat().');
|
|
165
|
+
}
|
|
166
|
+
if (requestParameters['aiChatInput'] == null) {
|
|
167
|
+
throw new runtime.RequiredError('aiChatInput', 'Required parameter "aiChatInput" was null or undefined when calling createChat().');
|
|
168
|
+
}
|
|
169
|
+
const queryParameters = {};
|
|
170
|
+
const headerParameters = {};
|
|
171
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
172
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
173
|
+
headerParameters["X-OpenAPI-User"] = yield this.configuration.apiKey("X-OpenAPI-User"); // OpenApiUser authentication
|
|
174
|
+
}
|
|
175
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
176
|
+
headerParameters["X-OpenAPI-AK"] = yield this.configuration.apiKey("X-OpenAPI-AK"); // OpenApiAccessKey authentication
|
|
177
|
+
}
|
|
178
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
179
|
+
headerParameters["X-OpenAPI-Timestamp"] = yield this.configuration.apiKey("X-OpenAPI-Timestamp"); // OpenApiTimestamp authentication
|
|
180
|
+
}
|
|
181
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
182
|
+
headerParameters["X-OpenAPI-Nonce"] = yield this.configuration.apiKey("X-OpenAPI-Nonce"); // OpenApiNonce authentication
|
|
183
|
+
}
|
|
184
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
185
|
+
headerParameters["X-OpenAPI-Signature"] = yield this.configuration.apiKey("X-OpenAPI-Signature"); // OpenApiSignature authentication
|
|
186
|
+
}
|
|
187
|
+
let urlPath = `/api/agents/channel/openapi/v1/{channelId}/chat`;
|
|
188
|
+
urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
|
|
189
|
+
return {
|
|
190
|
+
path: urlPath,
|
|
191
|
+
method: 'POST',
|
|
192
|
+
headers: headerParameters,
|
|
193
|
+
query: queryParameters,
|
|
194
|
+
body: requestParameters['aiChatInput'],
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* 创建会话并提交消息 / Create a conversation and submit a message 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
200
|
+
* 创建会话并提交消息 / Create a conversation and submit a message
|
|
201
|
+
*/
|
|
202
|
+
createChatRaw(requestParameters, initOverrides) {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
const requestOptions = yield this.createChatRequestOpts(requestParameters);
|
|
205
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
206
|
+
return new runtime.JSONApiResponse(response);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* 创建会话并提交消息 / Create a conversation and submit a message 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
211
|
+
* 创建会话并提交消息 / Create a conversation and submit a message
|
|
212
|
+
*/
|
|
213
|
+
createChat(requestParameters, initOverrides) {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
const response = yield this.createChatRaw(requestParameters, initOverrides);
|
|
216
|
+
return yield response.value();
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Creates request options for interruptConversation without sending the request
|
|
221
|
+
*/
|
|
222
|
+
interruptConversationRequestOpts(requestParameters) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
if (requestParameters['channelId'] == null) {
|
|
225
|
+
throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling interruptConversation().');
|
|
226
|
+
}
|
|
227
|
+
if (requestParameters['conversationId'] == null) {
|
|
228
|
+
throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling interruptConversation().');
|
|
229
|
+
}
|
|
230
|
+
const queryParameters = {};
|
|
231
|
+
const headerParameters = {};
|
|
232
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
233
|
+
headerParameters["X-OpenAPI-User"] = yield this.configuration.apiKey("X-OpenAPI-User"); // OpenApiUser authentication
|
|
234
|
+
}
|
|
235
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
236
|
+
headerParameters["X-OpenAPI-AK"] = yield this.configuration.apiKey("X-OpenAPI-AK"); // OpenApiAccessKey authentication
|
|
237
|
+
}
|
|
238
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
239
|
+
headerParameters["X-OpenAPI-Timestamp"] = yield this.configuration.apiKey("X-OpenAPI-Timestamp"); // OpenApiTimestamp authentication
|
|
240
|
+
}
|
|
241
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
242
|
+
headerParameters["X-OpenAPI-Nonce"] = yield this.configuration.apiKey("X-OpenAPI-Nonce"); // OpenApiNonce authentication
|
|
243
|
+
}
|
|
244
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
245
|
+
headerParameters["X-OpenAPI-Signature"] = yield this.configuration.apiKey("X-OpenAPI-Signature"); // OpenApiSignature authentication
|
|
246
|
+
}
|
|
247
|
+
let urlPath = `/api/agents/channel/openapi/v1/{channelId}/chat/conversations/{conversationId}/interrupt`;
|
|
248
|
+
urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
|
|
249
|
+
urlPath = urlPath.replace('{conversationId}', encodeURIComponent(String(requestParameters['conversationId'])));
|
|
250
|
+
return {
|
|
251
|
+
path: urlPath,
|
|
252
|
+
method: 'DELETE',
|
|
253
|
+
headers: headerParameters,
|
|
254
|
+
query: queryParameters,
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* 中断会话执行 / Interrupt conversation execution 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
260
|
+
* 中断会话执行 / Interrupt conversation execution
|
|
261
|
+
*/
|
|
262
|
+
interruptConversationRaw(requestParameters, initOverrides) {
|
|
263
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
const requestOptions = yield this.interruptConversationRequestOpts(requestParameters);
|
|
265
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
266
|
+
return new runtime.VoidApiResponse(response);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* 中断会话执行 / Interrupt conversation execution 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
271
|
+
* 中断会话执行 / Interrupt conversation execution
|
|
272
|
+
*/
|
|
273
|
+
interruptConversation(requestParameters, initOverrides) {
|
|
274
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
275
|
+
yield this.interruptConversationRaw(requestParameters, initOverrides);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Creates request options for probeEventStream without sending the request
|
|
280
|
+
*/
|
|
281
|
+
probeEventStreamRequestOpts(requestParameters) {
|
|
282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
+
if (requestParameters['channelId'] == null) {
|
|
284
|
+
throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling probeEventStream().');
|
|
285
|
+
}
|
|
286
|
+
if (requestParameters['chatStreamProbeInput'] == null) {
|
|
287
|
+
throw new runtime.RequiredError('chatStreamProbeInput', 'Required parameter "chatStreamProbeInput" was null or undefined when calling probeEventStream().');
|
|
288
|
+
}
|
|
289
|
+
const queryParameters = {};
|
|
290
|
+
const headerParameters = {};
|
|
291
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
292
|
+
if (requestParameters['xRequestID'] != null) {
|
|
293
|
+
headerParameters['X-Request-ID'] = String(requestParameters['xRequestID']);
|
|
294
|
+
}
|
|
295
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
296
|
+
headerParameters["X-OpenAPI-User"] = yield this.configuration.apiKey("X-OpenAPI-User"); // OpenApiUser authentication
|
|
297
|
+
}
|
|
298
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
299
|
+
headerParameters["X-OpenAPI-AK"] = yield this.configuration.apiKey("X-OpenAPI-AK"); // OpenApiAccessKey authentication
|
|
300
|
+
}
|
|
301
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
302
|
+
headerParameters["X-OpenAPI-Timestamp"] = yield this.configuration.apiKey("X-OpenAPI-Timestamp"); // OpenApiTimestamp authentication
|
|
303
|
+
}
|
|
304
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
305
|
+
headerParameters["X-OpenAPI-Nonce"] = yield this.configuration.apiKey("X-OpenAPI-Nonce"); // OpenApiNonce authentication
|
|
306
|
+
}
|
|
307
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
308
|
+
headerParameters["X-OpenAPI-Signature"] = yield this.configuration.apiKey("X-OpenAPI-Signature"); // OpenApiSignature authentication
|
|
309
|
+
}
|
|
310
|
+
let urlPath = `/api/agents/channel/openapi/v1/{channelId}/chat/stream-probe`;
|
|
311
|
+
urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
|
|
312
|
+
return {
|
|
313
|
+
path: urlPath,
|
|
314
|
+
method: 'POST',
|
|
315
|
+
headers: headerParameters,
|
|
316
|
+
query: queryParameters,
|
|
317
|
+
body: requestParameters['chatStreamProbeInput'],
|
|
318
|
+
};
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* 探测 SSE 连接 / Probe the SSE connection 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
323
|
+
* 探测 SSE 连接 / Probe the SSE connection
|
|
324
|
+
*/
|
|
325
|
+
probeEventStreamRaw(requestParameters, initOverrides) {
|
|
326
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
327
|
+
const requestOptions = yield this.probeEventStreamRequestOpts(requestParameters);
|
|
328
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
329
|
+
return new runtime.JSONApiResponse(response);
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* 探测 SSE 连接 / Probe the SSE connection 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
334
|
+
* 探测 SSE 连接 / Probe the SSE connection
|
|
335
|
+
*/
|
|
336
|
+
probeEventStream(requestParameters, initOverrides) {
|
|
337
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
338
|
+
const response = yield this.probeEventStreamRaw(requestParameters, initOverrides);
|
|
339
|
+
return yield response.value();
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Creates request options for streamChatEvents without sending the request
|
|
344
|
+
*/
|
|
345
|
+
streamChatEventsRequestOpts(requestParameters) {
|
|
346
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
347
|
+
if (requestParameters['channelId'] == null) {
|
|
348
|
+
throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling streamChatEvents().');
|
|
349
|
+
}
|
|
350
|
+
if (requestParameters['conversationId'] == null) {
|
|
351
|
+
throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling streamChatEvents().');
|
|
352
|
+
}
|
|
353
|
+
if (requestParameters['aiChatStreamInput'] == null) {
|
|
354
|
+
throw new runtime.RequiredError('aiChatStreamInput', 'Required parameter "aiChatStreamInput" was null or undefined when calling streamChatEvents().');
|
|
355
|
+
}
|
|
356
|
+
const queryParameters = {};
|
|
357
|
+
const headerParameters = {};
|
|
358
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
359
|
+
if (requestParameters['xRequestID'] != null) {
|
|
360
|
+
headerParameters['X-Request-ID'] = String(requestParameters['xRequestID']);
|
|
361
|
+
}
|
|
362
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
363
|
+
headerParameters["X-OpenAPI-User"] = yield this.configuration.apiKey("X-OpenAPI-User"); // OpenApiUser authentication
|
|
364
|
+
}
|
|
365
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
366
|
+
headerParameters["X-OpenAPI-AK"] = yield this.configuration.apiKey("X-OpenAPI-AK"); // OpenApiAccessKey authentication
|
|
367
|
+
}
|
|
368
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
369
|
+
headerParameters["X-OpenAPI-Timestamp"] = yield this.configuration.apiKey("X-OpenAPI-Timestamp"); // OpenApiTimestamp authentication
|
|
370
|
+
}
|
|
371
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
372
|
+
headerParameters["X-OpenAPI-Nonce"] = yield this.configuration.apiKey("X-OpenAPI-Nonce"); // OpenApiNonce authentication
|
|
373
|
+
}
|
|
374
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
375
|
+
headerParameters["X-OpenAPI-Signature"] = yield this.configuration.apiKey("X-OpenAPI-Signature"); // OpenApiSignature authentication
|
|
376
|
+
}
|
|
377
|
+
let urlPath = `/api/agents/channel/openapi/v1/{channelId}/chat/conversations/{conversationId}/stream`;
|
|
378
|
+
urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
|
|
379
|
+
urlPath = urlPath.replace('{conversationId}', encodeURIComponent(String(requestParameters['conversationId'])));
|
|
380
|
+
return {
|
|
381
|
+
path: urlPath,
|
|
382
|
+
method: 'POST',
|
|
383
|
+
headers: headerParameters,
|
|
384
|
+
query: queryParameters,
|
|
385
|
+
body: requestParameters['aiChatStreamInput'],
|
|
386
|
+
};
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* 订阅消息事件流 / Stream message events 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
391
|
+
* 订阅消息事件流 / Stream message events
|
|
392
|
+
*/
|
|
393
|
+
streamChatEventsRaw(requestParameters, initOverrides) {
|
|
394
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
395
|
+
const requestOptions = yield this.streamChatEventsRequestOpts(requestParameters);
|
|
396
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
397
|
+
return new runtime.JSONApiResponse(response);
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* 订阅消息事件流 / Stream message events 请求会在身份验签和资源归属校验后执行;响应字段以本契约为准。 / The request runs after signature and resource-ownership validation; this contract defines the response fields.
|
|
402
|
+
* 订阅消息事件流 / Stream message events
|
|
403
|
+
*/
|
|
404
|
+
streamChatEvents(requestParameters, initOverrides) {
|
|
405
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
406
|
+
const response = yield this.streamChatEventsRaw(requestParameters, initOverrides);
|
|
407
|
+
return yield response.value();
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
exports.ChatApi = ChatApi;
|