mavenagi 0.0.0-alpha.2 → 0.0.0-alpha.20
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/Client.d.ts +21 -0
- package/Client.js +20 -0
- package/README.md +70 -16
- package/api/resources/actions/client/Client.d.ts +96 -0
- package/api/resources/actions/client/Client.js +316 -0
- package/api/resources/actions/client/index.d.ts +1 -0
- package/api/resources/actions/client/index.js +1 -0
- package/api/resources/actions/index.d.ts +2 -0
- package/api/resources/actions/index.js +2 -0
- package/api/resources/actions/types/ActionBase.d.ts +18 -0
- package/api/resources/actions/types/ActionParameter.d.ts +9 -0
- package/api/resources/actions/types/ActionRequest.d.ts +31 -0
- package/api/resources/actions/types/ActionResponse.d.ts +35 -0
- package/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +12 -0
- package/api/resources/actions/types/ConversationPrecondition.d.ts +20 -0
- package/api/resources/actions/types/MetadataPrecondition.d.ts +12 -0
- package/api/resources/actions/types/Precondition.d.ts +31 -0
- package/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
- package/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
- package/api/resources/{knowledge/types/IdBody.d.ts → actions/types/PreconditionOperator.js} +3 -3
- package/api/resources/actions/types/index.d.ts +11 -0
- package/api/resources/actions/types/index.js +11 -0
- package/api/resources/appSettings/client/Client.d.ts +47 -0
- package/api/resources/appSettings/client/Client.js +124 -0
- package/api/resources/appSettings/client/index.d.ts +1 -0
- package/api/resources/appSettings/client/index.js +1 -0
- package/api/resources/appSettings/index.d.ts +1 -0
- package/api/resources/appSettings/index.js +1 -0
- package/api/resources/commons/errors/{AgentNotFoundError.d.ts → BadRequestError.d.ts} +1 -1
- package/api/resources/{conversation/errors/EmptyConversationError.js → commons/errors/BadRequestError.js} +3 -3
- package/{dist/api/resources/commons/errors/AgentNotFoundError.d.ts → api/resources/commons/errors/NotFoundError.d.ts} +1 -1
- package/{dist/api/resources/commons/errors/AgentNotFoundError.js → api/resources/commons/errors/NotFoundError.js} +3 -3
- package/api/resources/{conversation/errors/EmptyConversationError.d.ts → commons/errors/ServerError.d.ts} +1 -1
- package/api/resources/commons/errors/ServerError.js +14 -0
- package/api/resources/commons/errors/index.d.ts +3 -1
- package/api/resources/commons/errors/index.js +3 -1
- package/api/resources/commons/types/AppUser.d.ts +9 -0
- package/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/api/resources/commons/types/AppUserRequest.d.ts +26 -0
- package/api/resources/commons/types/AppUserResponse.d.ts +42 -0
- package/api/resources/commons/types/EntityId.d.ts +14 -0
- package/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/api/resources/commons/types/EntityType.d.ts +16 -0
- package/api/resources/commons/types/EntityType.js +15 -0
- package/api/resources/commons/types/EventTriggerBase.d.ts +10 -0
- package/api/resources/commons/types/EventTriggerResponse.d.ts +22 -0
- package/api/resources/commons/types/EventTriggerResponse.js +4 -0
- package/api/resources/commons/types/EventTriggerType.d.ts +8 -0
- package/api/resources/commons/types/EventTriggerType.js +7 -0
- package/api/resources/commons/types/Feedback.d.ts +12 -0
- package/api/resources/commons/types/Feedback.js +4 -0
- package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/api/resources/commons/types/FeedbackBase.js +4 -0
- package/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{dist/api/resources/conversation → api/resources/commons}/types/FeedbackType.js +2 -0
- package/api/resources/commons/types/UserData.d.ts +10 -0
- package/api/resources/commons/types/UserData.js +4 -0
- package/api/resources/commons/types/VisibilityType.d.ts +9 -0
- package/api/resources/commons/types/VisibilityType.js +8 -0
- package/api/resources/commons/types/index.d.ts +16 -1
- package/api/resources/commons/types/index.js +16 -1
- package/api/resources/conversation/client/Client.d.ts +136 -42
- package/api/resources/conversation/client/Client.js +451 -130
- package/api/resources/conversation/index.d.ts +0 -1
- package/api/resources/conversation/index.js +0 -1
- package/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/api/resources/conversation/types/AskRequest.d.ts +15 -3
- package/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
- package/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
- package/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
- package/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/api/resources/conversation/types/Capability.d.ts +18 -0
- package/api/resources/conversation/types/Capability.js +8 -0
- package/{dist/api/resources/knowledge/types/IdBody.d.ts → api/resources/conversation/types/CategorizationResponse.d.ts} +2 -2
- package/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/api/resources/conversation/types/ConversationAnalysis.d.ts +12 -0
- package/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +14 -4
- package/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
- package/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
- package/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/api/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/api/resources/conversation/types/FeedbackRequest.d.ts +7 -7
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/api/resources/conversation/types/ResponseLength.js +8 -0
- package/api/resources/conversation/types/Sentiment.d.ts +14 -0
- package/api/resources/conversation/types/Sentiment.js +10 -0
- package/api/resources/conversation/types/StreamResponse.d.ts +4 -1
- package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +8 -0
- package/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
- package/api/resources/conversation/types/UserMessage.d.ts +3 -3
- package/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
- package/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/api/resources/conversation/types/index.d.ts +9 -3
- package/api/resources/conversation/types/index.js +9 -3
- package/api/resources/index.d.ts +6 -2
- package/api/resources/index.js +6 -2
- package/api/resources/knowledge/client/Client.d.ts +85 -73
- package/api/resources/knowledge/client/Client.js +233 -175
- package/api/resources/knowledge/index.d.ts +0 -1
- package/api/resources/knowledge/index.js +0 -1
- package/{dist/api/resources/knowledge/types/KnowledgeDocument.d.ts → api/resources/knowledge/types/BaseKnowledgeDocument.d.ts} +2 -5
- package/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/api/resources/knowledge/types/{KnowledgeBase.d.ts → KnowledgeBaseProperties.d.ts} +3 -3
- package/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
- package/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -3
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +22 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/api/resources/knowledge/types/index.d.ts +7 -5
- package/api/resources/knowledge/types/index.js +7 -5
- package/api/resources/triggers/client/Client.d.ts +83 -0
- package/api/resources/triggers/client/Client.js +303 -0
- package/api/resources/triggers/client/index.d.ts +1 -0
- package/api/resources/triggers/client/index.js +1 -0
- package/api/resources/triggers/index.d.ts +2 -0
- package/api/resources/triggers/index.js +2 -0
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/api/resources/triggers/types/index.d.ts +1 -0
- package/api/resources/triggers/types/index.js +1 -0
- package/api/resources/users/client/Client.d.ts +77 -0
- package/api/resources/users/client/Client.js +228 -0
- package/api/resources/users/client/index.d.ts +1 -0
- package/api/resources/users/client/index.js +1 -0
- package/api/resources/users/index.d.ts +1 -0
- package/api/resources/users/index.js +1 -0
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +18 -159
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +6 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +32 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +19 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +48 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +38 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +28 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +32 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +222 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +104 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +204 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +17 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/core/runtime/runtime.d.ts +1 -0
- package/core/runtime/runtime.js +1 -0
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +21 -0
- package/dist/Client.js +20 -0
- package/dist/api/resources/actions/client/Client.d.ts +96 -0
- package/dist/api/resources/actions/client/Client.js +316 -0
- package/dist/api/resources/actions/client/index.d.ts +1 -0
- package/dist/api/resources/actions/client/index.js +1 -0
- package/dist/api/resources/actions/index.d.ts +2 -0
- package/dist/api/resources/actions/index.js +2 -0
- package/dist/api/resources/actions/types/ActionBase.d.ts +18 -0
- package/dist/api/resources/actions/types/ActionBase.js +4 -0
- package/dist/api/resources/actions/types/ActionParameter.d.ts +9 -0
- package/dist/api/resources/actions/types/ActionParameter.js +4 -0
- package/dist/api/resources/actions/types/ActionRequest.d.ts +31 -0
- package/dist/api/resources/actions/types/ActionRequest.js +4 -0
- package/dist/api/resources/actions/types/ActionResponse.d.ts +35 -0
- package/dist/api/resources/actions/types/ActionResponse.js +4 -0
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +12 -0
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.js +4 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.d.ts +20 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.js +4 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.d.ts +12 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.js +4 -0
- package/dist/api/resources/actions/types/Precondition.d.ts +31 -0
- package/dist/api/resources/actions/types/Precondition.js +4 -0
- package/dist/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionGroup.js +4 -0
- package/dist/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
- package/dist/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
- package/dist/api/resources/actions/types/PreconditionOperator.js +6 -0
- package/dist/api/resources/actions/types/index.d.ts +11 -0
- package/dist/api/resources/actions/types/index.js +11 -0
- package/dist/api/resources/appSettings/client/Client.d.ts +47 -0
- package/dist/api/resources/appSettings/client/Client.js +124 -0
- package/dist/api/resources/appSettings/client/index.d.ts +1 -0
- package/dist/api/resources/appSettings/client/index.js +1 -0
- package/dist/api/resources/appSettings/index.d.ts +1 -0
- package/dist/api/resources/appSettings/index.js +1 -0
- package/dist/api/resources/{conversation/errors/EmptyConversationError.d.ts → commons/errors/BadRequestError.d.ts} +1 -1
- package/dist/api/resources/{knowledge/errors/VersionInProgressError.js → commons/errors/BadRequestError.js} +3 -3
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
- package/{api/resources/commons/errors/AgentNotFoundError.js → dist/api/resources/commons/errors/NotFoundError.js} +3 -3
- package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
- package/dist/api/resources/commons/errors/ServerError.js +14 -0
- package/dist/api/resources/commons/errors/index.d.ts +3 -1
- package/dist/api/resources/commons/errors/index.js +3 -1
- package/dist/api/resources/commons/types/AppUser.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUser.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUserIdentifier.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +26 -0
- package/dist/api/resources/commons/types/AppUserRequest.js +4 -0
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +42 -0
- package/dist/api/resources/commons/types/AppUserResponse.js +4 -0
- package/dist/api/resources/commons/types/EntityId.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityId.js +4 -0
- package/dist/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EntityIdBase.js +4 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +16 -0
- package/dist/api/resources/commons/types/EntityType.js +15 -0
- package/dist/api/resources/commons/types/EventTriggerBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/commons/types/EventTriggerResponse.d.ts +22 -0
- package/dist/api/resources/commons/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/commons/types/EventTriggerType.d.ts +8 -0
- package/dist/api/resources/commons/types/EventTriggerType.js +7 -0
- package/dist/api/resources/commons/types/Feedback.d.ts +12 -0
- package/dist/api/resources/commons/types/Feedback.js +4 -0
- package/dist/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/dist/api/resources/commons/types/FeedbackBase.js +4 -0
- package/dist/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{api/resources/conversation → dist/api/resources/commons}/types/FeedbackType.js +2 -0
- package/dist/api/resources/commons/types/UserData.d.ts +10 -0
- package/dist/api/resources/commons/types/UserData.js +4 -0
- package/dist/api/resources/commons/types/VisibilityType.d.ts +9 -0
- package/dist/api/resources/commons/types/VisibilityType.js +8 -0
- package/dist/api/resources/commons/types/index.d.ts +16 -1
- package/dist/api/resources/commons/types/index.js +16 -1
- package/dist/api/resources/conversation/client/Client.d.ts +136 -42
- package/dist/api/resources/conversation/client/Client.js +451 -130
- package/dist/api/resources/conversation/index.d.ts +0 -1
- package/dist/api/resources/conversation/index.js +0 -1
- package/dist/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +15 -3
- package/dist/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
- package/dist/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
- package/dist/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/dist/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
- package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/api/resources/conversation/types/Capability.d.ts +18 -0
- package/dist/api/resources/conversation/types/Capability.js +8 -0
- package/dist/api/resources/conversation/types/CategorizationResponse.d.ts +6 -0
- package/dist/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.d.ts +12 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +14 -4
- package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
- package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +7 -7
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/dist/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/dist/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/dist/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/dist/api/resources/conversation/types/ResponseLength.js +8 -0
- package/dist/api/resources/conversation/types/Sentiment.d.ts +14 -0
- package/dist/api/resources/conversation/types/Sentiment.js +10 -0
- package/dist/api/resources/conversation/types/StreamResponse.d.ts +4 -1
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.d.ts +8 -0
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
- package/dist/api/resources/conversation/types/UserMessage.d.ts +3 -3
- package/dist/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
- package/dist/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/dist/api/resources/conversation/types/index.d.ts +9 -3
- package/dist/api/resources/conversation/types/index.js +9 -3
- package/dist/api/resources/index.d.ts +6 -2
- package/dist/api/resources/index.js +6 -2
- package/dist/api/resources/knowledge/client/Client.d.ts +85 -73
- package/dist/api/resources/knowledge/client/Client.js +233 -175
- package/dist/api/resources/knowledge/index.d.ts +0 -1
- package/dist/api/resources/knowledge/index.js +0 -1
- package/{api/resources/knowledge/types/KnowledgeDocument.d.ts → dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts} +2 -5
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/dist/api/resources/knowledge/types/{KnowledgeBase.d.ts → KnowledgeBaseProperties.d.ts} +3 -3
- package/dist/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -3
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +22 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/dist/api/resources/knowledge/types/index.d.ts +7 -5
- package/dist/api/resources/knowledge/types/index.js +7 -5
- package/dist/api/resources/triggers/client/Client.d.ts +83 -0
- package/dist/api/resources/triggers/client/Client.js +303 -0
- package/dist/api/resources/triggers/client/index.d.ts +1 -0
- package/dist/api/resources/triggers/client/index.js +1 -0
- package/dist/api/resources/triggers/index.d.ts +2 -0
- package/dist/api/resources/triggers/index.js +2 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/dist/api/resources/triggers/types/index.d.ts +1 -0
- package/dist/api/resources/triggers/types/index.js +1 -0
- package/dist/api/resources/users/client/Client.d.ts +77 -0
- package/dist/api/resources/users/client/Client.js +228 -0
- package/dist/api/resources/users/client/index.d.ts +1 -0
- package/dist/api/resources/users/client/index.js +1 -0
- package/dist/api/resources/users/index.d.ts +1 -0
- package/dist/api/resources/users/index.js +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +18 -159
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +6 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +32 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +19 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +48 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +38 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +28 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +32 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +222 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +104 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +204 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +17 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/runtime/runtime.d.ts +1 -0
- package/dist/core/runtime/runtime.js +1 -0
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/actions/index.d.ts +1 -0
- package/dist/serialization/resources/actions/index.js +1 -0
- package/dist/serialization/resources/actions/types/ActionBase.d.ts +18 -0
- package/dist/serialization/resources/actions/types/ActionBase.js +14 -0
- package/dist/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
- package/dist/serialization/resources/actions/types/ActionParameter.js +10 -0
- package/dist/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/dist/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +15 -0
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +10 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.js +18 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.d.ts +15 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.js +10 -0
- package/dist/serialization/resources/actions/types/Precondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/Precondition.js +19 -0
- package/dist/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
- package/dist/serialization/resources/actions/types/PreconditionGroup.js +10 -0
- package/dist/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
- package/dist/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
- package/dist/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
- package/dist/serialization/resources/actions/types/PreconditionOperator.js +5 -0
- package/dist/serialization/resources/actions/types/index.d.ts +11 -0
- package/dist/serialization/resources/actions/types/index.js +11 -0
- package/dist/serialization/resources/appSettings/client/get.d.ts +9 -0
- package/dist/serialization/resources/appSettings/client/get.js +5 -0
- package/dist/serialization/resources/appSettings/client/index.d.ts +1 -0
- package/dist/serialization/resources/appSettings/client/index.js +1 -0
- package/dist/serialization/resources/appSettings/index.d.ts +1 -0
- package/dist/serialization/resources/appSettings/index.js +1 -0
- package/dist/serialization/resources/commons/types/AppUser.d.ts +15 -0
- package/dist/serialization/resources/commons/types/AppUser.js +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifier.js +9 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserRequest.js +11 -0
- package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +16 -0
- package/dist/serialization/resources/commons/types/AppUserResponse.js +13 -0
- package/dist/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/dist/serialization/resources/commons/types/EntityId.js +14 -0
- package/{serialization/resources/knowledge/types/IdBody.d.ts → dist/serialization/resources/commons/types/EntityIdBase.d.ts} +3 -3
- package/dist/serialization/resources/{knowledge/types/IdBody.js → commons/types/EntityIdBase.js} +2 -2
- package/dist/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EntityType.js +16 -0
- package/dist/serialization/resources/commons/types/EventTriggerBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/EventTriggerBase.js +9 -0
- package/dist/serialization/resources/commons/types/EventTriggerResponse.d.ts +14 -0
- package/dist/serialization/resources/commons/types/EventTriggerResponse.js +11 -0
- package/dist/serialization/resources/commons/types/EventTriggerType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EventTriggerType.js +5 -0
- package/dist/serialization/resources/commons/types/Feedback.d.ts +16 -0
- package/dist/serialization/resources/commons/types/Feedback.js +13 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/{serialization/resources/conversation → dist/serialization/resources/commons}/types/FeedbackType.d.ts +1 -1
- package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/dist/serialization/resources/commons/types/UserData.d.ts +14 -0
- package/dist/serialization/resources/commons/types/UserData.js +9 -0
- package/dist/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/VisibilityType.js +5 -0
- package/dist/serialization/resources/commons/types/index.d.ts +16 -1
- package/dist/serialization/resources/commons/types/index.js +16 -1
- package/dist/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversation/client/index.js +1 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.js +1 -0
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +3 -3
- package/dist/serialization/resources/conversation/types/AskRequest.js +3 -3
- package/dist/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/dist/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/BotMessage.js +2 -0
- package/dist/serialization/resources/conversation/types/Capability.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/Capability.js +5 -0
- package/dist/serialization/resources/{commons/types/User.d.ts → conversation/types/CategorizationResponse.d.ts} +3 -5
- package/dist/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.js +10 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +8 -3
- package/dist/serialization/resources/conversation/types/ConversationBase.js +8 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +4 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +6 -5
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +9 -6
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
- package/dist/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/dist/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.js +5 -0
- package/dist/serialization/resources/conversation/types/Sentiment.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/Sentiment.js +5 -0
- package/dist/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
- package/dist/serialization/resources/conversation/types/StreamResponse.js +2 -0
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +13 -0
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +8 -0
- package/dist/serialization/resources/conversation/types/UserMessage.d.ts +4 -5
- package/dist/serialization/resources/conversation/types/UserMessage.js +4 -5
- package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
- package/dist/serialization/resources/conversation/types/UserMessageBase.js +14 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +9 -3
- package/dist/serialization/resources/conversation/types/index.js +9 -3
- package/dist/serialization/resources/index.d.ts +5 -0
- package/dist/serialization/resources/index.js +5 -0
- package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +3 -5
- package/{serialization/resources/knowledge/types/KnowledgeDocument.js → dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +2 -6
- package/{serialization/resources/knowledge/types/KnowledgeBase.d.ts → dist/serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
- package/dist/serialization/resources/knowledge/types/{KnowledgeBase.js → KnowledgeBaseProperties.js} +3 -6
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +17 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +7 -5
- package/dist/serialization/resources/knowledge/types/index.js +7 -5
- package/dist/serialization/resources/triggers/index.d.ts +1 -0
- package/dist/serialization/resources/triggers/index.js +1 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +1 -0
- package/dist/serialization/resources/triggers/types/index.js +1 -0
- package/package.json +7 -2
- package/reference.md +1863 -0
- package/serialization/resources/actions/index.d.ts +1 -0
- package/serialization/resources/actions/index.js +1 -0
- package/serialization/resources/actions/types/ActionBase.d.ts +18 -0
- package/serialization/resources/actions/types/ActionBase.js +14 -0
- package/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
- package/serialization/resources/actions/types/ActionParameter.js +10 -0
- package/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +15 -0
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +10 -0
- package/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/serialization/resources/actions/types/ConversationPrecondition.js +18 -0
- package/serialization/resources/actions/types/MetadataPrecondition.d.ts +15 -0
- package/serialization/resources/actions/types/MetadataPrecondition.js +10 -0
- package/serialization/resources/actions/types/Precondition.d.ts +22 -0
- package/serialization/resources/actions/types/Precondition.js +19 -0
- package/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
- package/serialization/resources/actions/types/PreconditionGroup.js +10 -0
- package/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
- package/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
- package/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
- package/serialization/resources/actions/types/PreconditionOperator.js +5 -0
- package/serialization/resources/actions/types/index.d.ts +11 -0
- package/serialization/resources/actions/types/index.js +11 -0
- package/serialization/resources/appSettings/client/get.d.ts +9 -0
- package/serialization/resources/appSettings/client/get.js +5 -0
- package/serialization/resources/appSettings/client/index.d.ts +1 -0
- package/serialization/resources/appSettings/client/index.js +1 -0
- package/serialization/resources/appSettings/index.d.ts +1 -0
- package/serialization/resources/appSettings/index.js +1 -0
- package/serialization/resources/commons/types/AppUser.d.ts +15 -0
- package/serialization/resources/commons/types/AppUser.js +10 -0
- package/serialization/resources/commons/types/AppUserIdentifier.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserIdentifier.js +9 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/serialization/resources/commons/types/AppUserRequest.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserRequest.js +11 -0
- package/serialization/resources/commons/types/AppUserResponse.d.ts +16 -0
- package/serialization/resources/commons/types/AppUserResponse.js +13 -0
- package/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/serialization/resources/commons/types/EntityId.js +14 -0
- package/{dist/serialization/resources/knowledge/types/IdBody.d.ts → serialization/resources/commons/types/EntityIdBase.d.ts} +3 -3
- package/serialization/resources/{knowledge/types/IdBody.js → commons/types/EntityIdBase.js} +2 -2
- package/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/serialization/resources/commons/types/EntityType.js +16 -0
- package/serialization/resources/commons/types/EventTriggerBase.d.ts +14 -0
- package/serialization/resources/commons/types/EventTriggerBase.js +9 -0
- package/serialization/resources/commons/types/EventTriggerResponse.d.ts +14 -0
- package/serialization/resources/commons/types/EventTriggerResponse.js +11 -0
- package/serialization/resources/commons/types/EventTriggerType.d.ts +10 -0
- package/serialization/resources/commons/types/EventTriggerType.js +5 -0
- package/serialization/resources/commons/types/Feedback.d.ts +16 -0
- package/serialization/resources/commons/types/Feedback.js +13 -0
- package/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/{dist/serialization/resources/conversation → serialization/resources/commons}/types/FeedbackType.d.ts +1 -1
- package/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/serialization/resources/commons/types/UserData.d.ts +14 -0
- package/serialization/resources/commons/types/UserData.js +9 -0
- package/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
- package/serialization/resources/commons/types/VisibilityType.js +5 -0
- package/serialization/resources/commons/types/index.d.ts +16 -1
- package/serialization/resources/commons/types/index.js +16 -1
- package/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/serialization/resources/conversation/client/index.d.ts +1 -0
- package/serialization/resources/conversation/client/index.js +1 -0
- package/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/serialization/resources/conversation/types/ActionFormField.js +1 -0
- package/serialization/resources/conversation/types/AskRequest.d.ts +3 -3
- package/serialization/resources/conversation/types/AskRequest.js +3 -3
- package/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
- package/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
- package/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
- package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
- package/serialization/resources/conversation/types/BotMessage.js +2 -0
- package/serialization/resources/conversation/types/Capability.d.ts +10 -0
- package/serialization/resources/conversation/types/Capability.js +5 -0
- package/serialization/resources/{commons/types/User.d.ts → conversation/types/CategorizationResponse.d.ts} +3 -5
- package/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.d.ts +15 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.js +10 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +8 -3
- package/serialization/resources/conversation/types/ConversationBase.js +8 -3
- package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
- package/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
- package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/serialization/resources/conversation/types/ConversationResponse.js +4 -0
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +6 -5
- package/serialization/resources/conversation/types/FeedbackRequest.js +9 -6
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
- package/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/serialization/resources/conversation/types/ResponseLength.js +5 -0
- package/serialization/resources/conversation/types/Sentiment.d.ts +10 -0
- package/serialization/resources/conversation/types/Sentiment.js +5 -0
- package/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
- package/serialization/resources/conversation/types/StreamResponse.js +2 -0
- package/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +13 -0
- package/serialization/resources/conversation/types/SubmitActionFormRequest.js +8 -0
- package/serialization/resources/conversation/types/UserMessage.d.ts +4 -5
- package/serialization/resources/conversation/types/UserMessage.js +4 -5
- package/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
- package/serialization/resources/conversation/types/UserMessageBase.js +14 -0
- package/serialization/resources/conversation/types/index.d.ts +9 -3
- package/serialization/resources/conversation/types/index.js +9 -3
- package/serialization/resources/index.d.ts +5 -0
- package/serialization/resources/index.js +5 -0
- package/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +3 -5
- package/{dist/serialization/resources/knowledge/types/KnowledgeDocument.js → serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +2 -6
- package/{dist/serialization/resources/knowledge/types/KnowledgeBase.d.ts → serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
- package/serialization/resources/knowledge/types/{KnowledgeBase.js → KnowledgeBaseProperties.js} +3 -6
- package/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +17 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
- package/serialization/resources/knowledge/types/index.d.ts +7 -5
- package/serialization/resources/knowledge/types/index.js +7 -5
- package/serialization/resources/triggers/index.d.ts +1 -0
- package/serialization/resources/triggers/index.js +1 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/serialization/resources/triggers/types/index.d.ts +1 -0
- package/serialization/resources/triggers/types/index.js +1 -0
- package/api/resources/commons/types/User.d.ts +0 -9
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/api/resources/conversation/errors/index.d.ts +0 -7
- package/api/resources/conversation/errors/index.js +0 -7
- package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionInProgressError.js +0 -14
- package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/api/resources/knowledge/errors/index.d.ts +0 -6
- package/api/resources/knowledge/errors/index.js +0 -6
- package/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
- package/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
- package/dist/api/resources/commons/types/User.d.ts +0 -9
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/EmptyConversationError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/dist/api/resources/conversation/errors/index.d.ts +0 -7
- package/dist/api/resources/conversation/errors/index.js +0 -7
- package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/dist/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/dist/api/resources/knowledge/errors/index.d.ts +0 -6
- package/dist/api/resources/knowledge/errors/index.js +0 -6
- package/dist/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
- package/dist/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
- package/dist/serialization/resources/commons/types/User.js +0 -9
- package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -12
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
- package/serialization/resources/commons/types/User.js +0 -9
- package/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- package/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -12
- package/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
- package/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
- package/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
- /package/api/resources/{commons/types/User.js → actions/types/ActionBase.js} +0 -0
- /package/api/resources/{conversation/types/ConversationContext.js → actions/types/ActionParameter.js} +0 -0
- /package/api/resources/{conversation/types/ConversationMessageContext.js → actions/types/ActionRequest.js} +0 -0
- /package/api/resources/{knowledge/types/IdBody.js → actions/types/ActionResponse.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeBase.js → actions/types/ConversationExecutedActionPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeBaseId.js → actions/types/ConversationPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeDocument.js → actions/types/MetadataPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeDocumentId.js → actions/types/Precondition.js} +0 -0
- /package/{dist/api/resources/commons/types/User.js → api/resources/actions/types/PreconditionGroup.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationContext.js → api/resources/commons/types/AppUser.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationMessageContext.js → api/resources/commons/types/AppUserIdentifier.js} +0 -0
- /package/{dist/api/resources/knowledge/types/IdBody.js → api/resources/commons/types/AppUserRequest.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeBase.js → api/resources/commons/types/AppUserResponse.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeBaseId.js → api/resources/commons/types/EntityId.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeDocument.js → api/resources/commons/types/EntityIdBase.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeDocumentId.js → api/resources/commons/types/EventTriggerBase.js} +0 -0
|
@@ -21,26 +21,38 @@ export class Conversation {
|
|
|
21
21
|
this._options = _options;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Initialize a new conversation. Only required if the ask request wishes to supply conversation level data or when syncing to external systems.
|
|
25
25
|
*
|
|
26
26
|
* @param {MavenAGI.ConversationRequest} request
|
|
27
27
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
|
-
* @throws {@link MavenAGI.
|
|
30
|
-
* @throws {@link MavenAGI.
|
|
31
|
-
* @throws {@link MavenAGI.
|
|
32
|
-
* @throws {@link MavenAGI.EmptyConversationError}
|
|
33
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
29
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
30
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
31
|
+
* @throws {@link MavenAGI.ServerError}
|
|
34
32
|
*
|
|
35
33
|
* @example
|
|
36
|
-
* await
|
|
34
|
+
* await client.conversation.initialize({
|
|
35
|
+
* conversationId: {
|
|
36
|
+
* referenceId: "string"
|
|
37
|
+
* },
|
|
37
38
|
* messages: [{}],
|
|
38
|
-
*
|
|
39
|
-
*
|
|
39
|
+
* responseConfig: {
|
|
40
|
+
* capabilities: [MavenAGI.Capability.Markdown],
|
|
41
|
+
* isCopilot: true,
|
|
42
|
+
* responseLength: MavenAGI.ResponseLength.Short
|
|
43
|
+
* },
|
|
44
|
+
* subject: "string",
|
|
45
|
+
* url: "string",
|
|
46
|
+
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
47
|
+
* updatedAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
48
|
+
* tags: new Set(["string"]),
|
|
49
|
+
* metadata: {
|
|
50
|
+
* "string": "string"
|
|
51
|
+
* }
|
|
40
52
|
* })
|
|
41
53
|
*/
|
|
42
54
|
initialize(request, requestOptions) {
|
|
43
|
-
var _a, _b
|
|
55
|
+
var _a, _b;
|
|
44
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
57
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
46
58
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/conversations"),
|
|
@@ -51,18 +63,19 @@ export class Conversation {
|
|
|
51
63
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
52
64
|
"X-Fern-Language": "JavaScript",
|
|
53
65
|
"X-Fern-SDK-Name": "mavenagi",
|
|
54
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
66
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
55
67
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
68
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
69
|
},
|
|
58
70
|
contentType: "application/json",
|
|
59
|
-
|
|
71
|
+
requestType: "json",
|
|
72
|
+
body: serializers.ConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
60
73
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
61
74
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
62
75
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
63
76
|
});
|
|
64
77
|
if (_response.ok) {
|
|
65
|
-
return
|
|
78
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
66
79
|
unrecognizedObjectKeys: "passthrough",
|
|
67
80
|
allowUnrecognizedUnionMembers: true,
|
|
68
81
|
allowUnrecognizedEnumValues: true,
|
|
@@ -70,37 +83,23 @@ export class Conversation {
|
|
|
70
83
|
});
|
|
71
84
|
}
|
|
72
85
|
if (_response.error.reason === "status-code") {
|
|
73
|
-
switch (
|
|
74
|
-
case
|
|
75
|
-
throw new MavenAGI.
|
|
76
|
-
unrecognizedObjectKeys: "passthrough",
|
|
77
|
-
allowUnrecognizedUnionMembers: true,
|
|
78
|
-
allowUnrecognizedEnumValues: true,
|
|
79
|
-
breadcrumbsPrefix: ["response"],
|
|
80
|
-
}));
|
|
81
|
-
case "InvalidConversationIdError":
|
|
82
|
-
throw new MavenAGI.InvalidConversationIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
83
|
-
unrecognizedObjectKeys: "passthrough",
|
|
84
|
-
allowUnrecognizedUnionMembers: true,
|
|
85
|
-
allowUnrecognizedEnumValues: true,
|
|
86
|
-
breadcrumbsPrefix: ["response"],
|
|
87
|
-
}));
|
|
88
|
-
case "InvalidConversationMessageIdError":
|
|
89
|
-
throw new MavenAGI.InvalidConversationMessageIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
86
|
+
switch (_response.error.statusCode) {
|
|
87
|
+
case 404:
|
|
88
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
90
89
|
unrecognizedObjectKeys: "passthrough",
|
|
91
90
|
allowUnrecognizedUnionMembers: true,
|
|
92
91
|
allowUnrecognizedEnumValues: true,
|
|
93
92
|
breadcrumbsPrefix: ["response"],
|
|
94
93
|
}));
|
|
95
|
-
case
|
|
96
|
-
throw new MavenAGI.
|
|
94
|
+
case 400:
|
|
95
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
97
96
|
unrecognizedObjectKeys: "passthrough",
|
|
98
97
|
allowUnrecognizedUnionMembers: true,
|
|
99
98
|
allowUnrecognizedEnumValues: true,
|
|
100
99
|
breadcrumbsPrefix: ["response"],
|
|
101
100
|
}));
|
|
102
|
-
case
|
|
103
|
-
throw new MavenAGI.
|
|
101
|
+
case 500:
|
|
102
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
104
103
|
unrecognizedObjectKeys: "passthrough",
|
|
105
104
|
allowUnrecognizedUnionMembers: true,
|
|
106
105
|
allowUnrecognizedEnumValues: true,
|
|
@@ -131,17 +130,18 @@ export class Conversation {
|
|
|
131
130
|
/**
|
|
132
131
|
* Get a conversation
|
|
133
132
|
*
|
|
134
|
-
* @param {string} conversationId - The ID of
|
|
133
|
+
* @param {string} conversationId - The ID of the conversation to get
|
|
135
134
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
135
|
*
|
|
137
|
-
* @throws {@link MavenAGI.
|
|
138
|
-
* @throws {@link MavenAGI.
|
|
136
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
137
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
138
|
+
* @throws {@link MavenAGI.ServerError}
|
|
139
139
|
*
|
|
140
140
|
* @example
|
|
141
|
-
* await
|
|
141
|
+
* await client.conversation.get("string")
|
|
142
142
|
*/
|
|
143
143
|
get(conversationId, requestOptions) {
|
|
144
|
-
var _a, _b
|
|
144
|
+
var _a, _b;
|
|
145
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
146
146
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
147
147
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}`),
|
|
@@ -152,17 +152,18 @@ export class Conversation {
|
|
|
152
152
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
153
153
|
"X-Fern-Language": "JavaScript",
|
|
154
154
|
"X-Fern-SDK-Name": "mavenagi",
|
|
155
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
155
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
156
156
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
157
157
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
158
158
|
},
|
|
159
159
|
contentType: "application/json",
|
|
160
|
+
requestType: "json",
|
|
160
161
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
161
162
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
162
163
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
163
164
|
});
|
|
164
165
|
if (_response.ok) {
|
|
165
|
-
return
|
|
166
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
166
167
|
unrecognizedObjectKeys: "passthrough",
|
|
167
168
|
allowUnrecognizedUnionMembers: true,
|
|
168
169
|
allowUnrecognizedEnumValues: true,
|
|
@@ -170,16 +171,23 @@ export class Conversation {
|
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
if (_response.error.reason === "status-code") {
|
|
173
|
-
switch (
|
|
174
|
-
case
|
|
175
|
-
throw new MavenAGI.
|
|
174
|
+
switch (_response.error.statusCode) {
|
|
175
|
+
case 404:
|
|
176
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
177
|
+
unrecognizedObjectKeys: "passthrough",
|
|
178
|
+
allowUnrecognizedUnionMembers: true,
|
|
179
|
+
allowUnrecognizedEnumValues: true,
|
|
180
|
+
breadcrumbsPrefix: ["response"],
|
|
181
|
+
}));
|
|
182
|
+
case 400:
|
|
183
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
176
184
|
unrecognizedObjectKeys: "passthrough",
|
|
177
185
|
allowUnrecognizedUnionMembers: true,
|
|
178
186
|
allowUnrecognizedEnumValues: true,
|
|
179
187
|
breadcrumbsPrefix: ["response"],
|
|
180
188
|
}));
|
|
181
|
-
case
|
|
182
|
-
throw new MavenAGI.
|
|
189
|
+
case 500:
|
|
190
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
183
191
|
unrecognizedObjectKeys: "passthrough",
|
|
184
192
|
allowUnrecognizedUnionMembers: true,
|
|
185
193
|
allowUnrecognizedEnumValues: true,
|
|
@@ -214,20 +222,26 @@ export class Conversation {
|
|
|
214
222
|
* @param {MavenAGI.ConversationMessageRequest[]} request
|
|
215
223
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
216
224
|
*
|
|
217
|
-
* @throws {@link MavenAGI.
|
|
218
|
-
* @throws {@link MavenAGI.
|
|
219
|
-
* @throws {@link MavenAGI.
|
|
225
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
226
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
227
|
+
* @throws {@link MavenAGI.ServerError}
|
|
220
228
|
*
|
|
221
229
|
* @example
|
|
222
|
-
* await
|
|
230
|
+
* await client.conversation.appendNewMessages("string", [{
|
|
231
|
+
* conversationMessageId: {
|
|
232
|
+
* referenceId: "string"
|
|
233
|
+
* },
|
|
234
|
+
* userId: {
|
|
235
|
+
* referenceId: "string"
|
|
236
|
+
* },
|
|
223
237
|
* text: "string",
|
|
224
238
|
* userMessageType: MavenAGI.UserConversationMessageType.User,
|
|
225
|
-
*
|
|
226
|
-
*
|
|
239
|
+
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
240
|
+
* updatedAt: new Date("2024-01-15T09:30:00.000Z")
|
|
227
241
|
* }])
|
|
228
242
|
*/
|
|
229
243
|
appendNewMessages(conversationId, request, requestOptions) {
|
|
230
|
-
var _a, _b
|
|
244
|
+
var _a, _b;
|
|
231
245
|
return __awaiter(this, void 0, void 0, function* () {
|
|
232
246
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
233
247
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/messages`),
|
|
@@ -238,12 +252,13 @@ export class Conversation {
|
|
|
238
252
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
239
253
|
"X-Fern-Language": "JavaScript",
|
|
240
254
|
"X-Fern-SDK-Name": "mavenagi",
|
|
241
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
255
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
242
256
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
243
257
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
244
258
|
},
|
|
245
259
|
contentType: "application/json",
|
|
246
|
-
|
|
260
|
+
requestType: "json",
|
|
261
|
+
body: serializers.conversation.appendNewMessages.Request.jsonOrThrow(request, {
|
|
247
262
|
unrecognizedObjectKeys: "strip",
|
|
248
263
|
}),
|
|
249
264
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -251,7 +266,7 @@ export class Conversation {
|
|
|
251
266
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
252
267
|
});
|
|
253
268
|
if (_response.ok) {
|
|
254
|
-
return
|
|
269
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
255
270
|
unrecognizedObjectKeys: "passthrough",
|
|
256
271
|
allowUnrecognizedUnionMembers: true,
|
|
257
272
|
allowUnrecognizedEnumValues: true,
|
|
@@ -259,23 +274,23 @@ export class Conversation {
|
|
|
259
274
|
});
|
|
260
275
|
}
|
|
261
276
|
if (_response.error.reason === "status-code") {
|
|
262
|
-
switch (
|
|
263
|
-
case
|
|
264
|
-
throw new MavenAGI.
|
|
277
|
+
switch (_response.error.statusCode) {
|
|
278
|
+
case 404:
|
|
279
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
265
280
|
unrecognizedObjectKeys: "passthrough",
|
|
266
281
|
allowUnrecognizedUnionMembers: true,
|
|
267
282
|
allowUnrecognizedEnumValues: true,
|
|
268
283
|
breadcrumbsPrefix: ["response"],
|
|
269
284
|
}));
|
|
270
|
-
case
|
|
271
|
-
throw new MavenAGI.
|
|
285
|
+
case 400:
|
|
286
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
272
287
|
unrecognizedObjectKeys: "passthrough",
|
|
273
288
|
allowUnrecognizedUnionMembers: true,
|
|
274
289
|
allowUnrecognizedEnumValues: true,
|
|
275
290
|
breadcrumbsPrefix: ["response"],
|
|
276
291
|
}));
|
|
277
|
-
case
|
|
278
|
-
throw new MavenAGI.
|
|
292
|
+
case 500:
|
|
293
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
279
294
|
unrecognizedObjectKeys: "passthrough",
|
|
280
295
|
allowUnrecognizedUnionMembers: true,
|
|
281
296
|
allowUnrecognizedEnumValues: true,
|
|
@@ -304,24 +319,29 @@ export class Conversation {
|
|
|
304
319
|
});
|
|
305
320
|
}
|
|
306
321
|
/**
|
|
307
|
-
* Ask a question
|
|
322
|
+
* Ask a question
|
|
308
323
|
*
|
|
309
324
|
* @param {string} conversationId - The ID of a new or existing conversation to use as context for the question
|
|
310
325
|
* @param {MavenAGI.AskRequest} request
|
|
311
326
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
312
327
|
*
|
|
313
|
-
* @throws {@link MavenAGI.
|
|
314
|
-
* @throws {@link MavenAGI.
|
|
328
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
329
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
330
|
+
* @throws {@link MavenAGI.ServerError}
|
|
315
331
|
*
|
|
316
332
|
* @example
|
|
317
|
-
* await
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
333
|
+
* await client.conversation.ask("string", {
|
|
334
|
+
* conversationMessageId: {
|
|
335
|
+
* referenceId: "message-1"
|
|
336
|
+
* },
|
|
337
|
+
* userId: {
|
|
338
|
+
* referenceId: "user-1"
|
|
339
|
+
* },
|
|
340
|
+
* text: "How do I reset my password?"
|
|
321
341
|
* })
|
|
322
342
|
*/
|
|
323
343
|
ask(conversationId, request, requestOptions) {
|
|
324
|
-
var _a, _b
|
|
344
|
+
var _a, _b;
|
|
325
345
|
return __awaiter(this, void 0, void 0, function* () {
|
|
326
346
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
327
347
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask`),
|
|
@@ -332,18 +352,19 @@ export class Conversation {
|
|
|
332
352
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
333
353
|
"X-Fern-Language": "JavaScript",
|
|
334
354
|
"X-Fern-SDK-Name": "mavenagi",
|
|
335
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
355
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
336
356
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
337
357
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
338
358
|
},
|
|
339
359
|
contentType: "application/json",
|
|
340
|
-
|
|
360
|
+
requestType: "json",
|
|
361
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
341
362
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
342
363
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
343
364
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
344
365
|
});
|
|
345
366
|
if (_response.ok) {
|
|
346
|
-
return
|
|
367
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
347
368
|
unrecognizedObjectKeys: "passthrough",
|
|
348
369
|
allowUnrecognizedUnionMembers: true,
|
|
349
370
|
allowUnrecognizedEnumValues: true,
|
|
@@ -351,16 +372,23 @@ export class Conversation {
|
|
|
351
372
|
});
|
|
352
373
|
}
|
|
353
374
|
if (_response.error.reason === "status-code") {
|
|
354
|
-
switch (
|
|
355
|
-
case
|
|
356
|
-
throw new MavenAGI.
|
|
375
|
+
switch (_response.error.statusCode) {
|
|
376
|
+
case 404:
|
|
377
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
378
|
+
unrecognizedObjectKeys: "passthrough",
|
|
379
|
+
allowUnrecognizedUnionMembers: true,
|
|
380
|
+
allowUnrecognizedEnumValues: true,
|
|
381
|
+
breadcrumbsPrefix: ["response"],
|
|
382
|
+
}));
|
|
383
|
+
case 400:
|
|
384
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
357
385
|
unrecognizedObjectKeys: "passthrough",
|
|
358
386
|
allowUnrecognizedUnionMembers: true,
|
|
359
387
|
allowUnrecognizedEnumValues: true,
|
|
360
388
|
breadcrumbsPrefix: ["response"],
|
|
361
389
|
}));
|
|
362
|
-
case
|
|
363
|
-
throw new MavenAGI.
|
|
390
|
+
case 500:
|
|
391
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
364
392
|
unrecognizedObjectKeys: "passthrough",
|
|
365
393
|
allowUnrecognizedUnionMembers: true,
|
|
366
394
|
allowUnrecognizedEnumValues: true,
|
|
@@ -389,10 +417,10 @@ export class Conversation {
|
|
|
389
417
|
});
|
|
390
418
|
}
|
|
391
419
|
/**
|
|
392
|
-
* Ask a question
|
|
420
|
+
* Ask a question with a streaming response. The response will be sent as a stream of events. The text portions of stream responses should be concatenated to form the full response text. Action and metadata events should overwrite past data and do not need concatenation.
|
|
393
421
|
*/
|
|
394
422
|
askStream(conversationId, request, requestOptions) {
|
|
395
|
-
var _a, _b
|
|
423
|
+
var _a, _b;
|
|
396
424
|
return __awaiter(this, void 0, void 0, function* () {
|
|
397
425
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
398
426
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask_stream`),
|
|
@@ -403,13 +431,14 @@ export class Conversation {
|
|
|
403
431
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
404
432
|
"X-Fern-Language": "JavaScript",
|
|
405
433
|
"X-Fern-SDK-Name": "mavenagi",
|
|
406
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
434
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
407
435
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
408
436
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
409
437
|
},
|
|
410
438
|
contentType: "application/json",
|
|
411
|
-
|
|
412
|
-
|
|
439
|
+
requestType: "json",
|
|
440
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
441
|
+
responseType: "sse",
|
|
413
442
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
414
443
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
415
444
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -418,7 +447,7 @@ export class Conversation {
|
|
|
418
447
|
return new core.Stream({
|
|
419
448
|
stream: _response.body,
|
|
420
449
|
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
421
|
-
return
|
|
450
|
+
return serializers.StreamResponse.parseOrThrow(data, {
|
|
422
451
|
unrecognizedObjectKeys: "passthrough",
|
|
423
452
|
allowUnrecognizedUnionMembers: true,
|
|
424
453
|
allowUnrecognizedEnumValues: true,
|
|
@@ -433,9 +462,23 @@ export class Conversation {
|
|
|
433
462
|
});
|
|
434
463
|
}
|
|
435
464
|
if (_response.error.reason === "status-code") {
|
|
436
|
-
switch (
|
|
437
|
-
case
|
|
438
|
-
throw new MavenAGI.
|
|
465
|
+
switch (_response.error.statusCode) {
|
|
466
|
+
case 404:
|
|
467
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
468
|
+
unrecognizedObjectKeys: "passthrough",
|
|
469
|
+
allowUnrecognizedUnionMembers: true,
|
|
470
|
+
allowUnrecognizedEnumValues: true,
|
|
471
|
+
breadcrumbsPrefix: ["response"],
|
|
472
|
+
}));
|
|
473
|
+
case 400:
|
|
474
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
475
|
+
unrecognizedObjectKeys: "passthrough",
|
|
476
|
+
allowUnrecognizedUnionMembers: true,
|
|
477
|
+
allowUnrecognizedEnumValues: true,
|
|
478
|
+
breadcrumbsPrefix: ["response"],
|
|
479
|
+
}));
|
|
480
|
+
case 500:
|
|
481
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
439
482
|
unrecognizedObjectKeys: "passthrough",
|
|
440
483
|
allowUnrecognizedUnionMembers: true,
|
|
441
484
|
allowUnrecognizedEnumValues: true,
|
|
@@ -470,19 +513,19 @@ export class Conversation {
|
|
|
470
513
|
* @param {MavenAGI.GenerateMavenSuggestionsRequest} request
|
|
471
514
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
472
515
|
*
|
|
473
|
-
* @throws {@link MavenAGI.
|
|
474
|
-
* @throws {@link MavenAGI.
|
|
475
|
-
* @throws {@link MavenAGI.
|
|
476
|
-
* @throws {@link MavenAGI.InvalidConversationMessageIdError}
|
|
477
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
516
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
517
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
518
|
+
* @throws {@link MavenAGI.ServerError}
|
|
478
519
|
*
|
|
479
520
|
* @example
|
|
480
|
-
* await
|
|
481
|
-
*
|
|
521
|
+
* await client.conversation.generateMavenSuggestions("string", {
|
|
522
|
+
* conversationMessageIds: [{
|
|
523
|
+
* referenceId: "string"
|
|
524
|
+
* }]
|
|
482
525
|
* })
|
|
483
526
|
*/
|
|
484
527
|
generateMavenSuggestions(conversationId, request, requestOptions) {
|
|
485
|
-
var _a, _b
|
|
528
|
+
var _a, _b;
|
|
486
529
|
return __awaiter(this, void 0, void 0, function* () {
|
|
487
530
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
488
531
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/generate_maven_suggestions`),
|
|
@@ -493,20 +536,19 @@ export class Conversation {
|
|
|
493
536
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
494
537
|
"X-Fern-Language": "JavaScript",
|
|
495
538
|
"X-Fern-SDK-Name": "mavenagi",
|
|
496
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
539
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
497
540
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
498
541
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
499
542
|
},
|
|
500
543
|
contentType: "application/json",
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}),
|
|
544
|
+
requestType: "json",
|
|
545
|
+
body: serializers.GenerateMavenSuggestionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
504
546
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
505
547
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
506
548
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
507
549
|
});
|
|
508
550
|
if (_response.ok) {
|
|
509
|
-
return
|
|
551
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
510
552
|
unrecognizedObjectKeys: "passthrough",
|
|
511
553
|
allowUnrecognizedUnionMembers: true,
|
|
512
554
|
allowUnrecognizedEnumValues: true,
|
|
@@ -514,37 +556,111 @@ export class Conversation {
|
|
|
514
556
|
});
|
|
515
557
|
}
|
|
516
558
|
if (_response.error.reason === "status-code") {
|
|
517
|
-
switch (
|
|
518
|
-
case
|
|
519
|
-
throw new MavenAGI.
|
|
559
|
+
switch (_response.error.statusCode) {
|
|
560
|
+
case 404:
|
|
561
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
520
562
|
unrecognizedObjectKeys: "passthrough",
|
|
521
563
|
allowUnrecognizedUnionMembers: true,
|
|
522
564
|
allowUnrecognizedEnumValues: true,
|
|
523
565
|
breadcrumbsPrefix: ["response"],
|
|
524
566
|
}));
|
|
525
|
-
case
|
|
526
|
-
throw new MavenAGI.
|
|
567
|
+
case 400:
|
|
568
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
527
569
|
unrecognizedObjectKeys: "passthrough",
|
|
528
570
|
allowUnrecognizedUnionMembers: true,
|
|
529
571
|
allowUnrecognizedEnumValues: true,
|
|
530
572
|
breadcrumbsPrefix: ["response"],
|
|
531
573
|
}));
|
|
532
|
-
case
|
|
533
|
-
throw new MavenAGI.
|
|
574
|
+
case 500:
|
|
575
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
534
576
|
unrecognizedObjectKeys: "passthrough",
|
|
535
577
|
allowUnrecognizedUnionMembers: true,
|
|
536
578
|
allowUnrecognizedEnumValues: true,
|
|
537
579
|
breadcrumbsPrefix: ["response"],
|
|
538
580
|
}));
|
|
539
|
-
|
|
540
|
-
throw new
|
|
581
|
+
default:
|
|
582
|
+
throw new errors.MavenAGIError({
|
|
583
|
+
statusCode: _response.error.statusCode,
|
|
584
|
+
body: _response.error.body,
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
switch (_response.error.reason) {
|
|
589
|
+
case "non-json":
|
|
590
|
+
throw new errors.MavenAGIError({
|
|
591
|
+
statusCode: _response.error.statusCode,
|
|
592
|
+
body: _response.error.rawBody,
|
|
593
|
+
});
|
|
594
|
+
case "timeout":
|
|
595
|
+
throw new errors.MavenAGITimeoutError();
|
|
596
|
+
case "unknown":
|
|
597
|
+
throw new errors.MavenAGIError({
|
|
598
|
+
message: _response.error.errorMessage,
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Uses an LLM flow to categorize the conversation. Experimental.
|
|
605
|
+
*
|
|
606
|
+
* @param {string} conversationId - The ID of the conversation to categorize
|
|
607
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
608
|
+
*
|
|
609
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
610
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
611
|
+
* @throws {@link MavenAGI.ServerError}
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* await client.conversation.categorize("string")
|
|
615
|
+
*/
|
|
616
|
+
categorize(conversationId, requestOptions) {
|
|
617
|
+
var _a, _b;
|
|
618
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
619
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
620
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/categorize`),
|
|
621
|
+
method: "POST",
|
|
622
|
+
headers: {
|
|
623
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
624
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
625
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
626
|
+
"X-Fern-Language": "JavaScript",
|
|
627
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
628
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
629
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
630
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
631
|
+
},
|
|
632
|
+
contentType: "application/json",
|
|
633
|
+
requestType: "json",
|
|
634
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
635
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
636
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
637
|
+
});
|
|
638
|
+
if (_response.ok) {
|
|
639
|
+
return serializers.CategorizationResponse.parseOrThrow(_response.body, {
|
|
640
|
+
unrecognizedObjectKeys: "passthrough",
|
|
641
|
+
allowUnrecognizedUnionMembers: true,
|
|
642
|
+
allowUnrecognizedEnumValues: true,
|
|
643
|
+
breadcrumbsPrefix: ["response"],
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
if (_response.error.reason === "status-code") {
|
|
647
|
+
switch (_response.error.statusCode) {
|
|
648
|
+
case 404:
|
|
649
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
650
|
+
unrecognizedObjectKeys: "passthrough",
|
|
651
|
+
allowUnrecognizedUnionMembers: true,
|
|
652
|
+
allowUnrecognizedEnumValues: true,
|
|
653
|
+
breadcrumbsPrefix: ["response"],
|
|
654
|
+
}));
|
|
655
|
+
case 400:
|
|
656
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
541
657
|
unrecognizedObjectKeys: "passthrough",
|
|
542
658
|
allowUnrecognizedUnionMembers: true,
|
|
543
659
|
allowUnrecognizedEnumValues: true,
|
|
544
660
|
breadcrumbsPrefix: ["response"],
|
|
545
661
|
}));
|
|
546
|
-
case
|
|
547
|
-
throw new MavenAGI.
|
|
662
|
+
case 500:
|
|
663
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
548
664
|
unrecognizedObjectKeys: "passthrough",
|
|
549
665
|
allowUnrecognizedUnionMembers: true,
|
|
550
666
|
allowUnrecognizedEnumValues: true,
|
|
@@ -578,19 +694,27 @@ export class Conversation {
|
|
|
578
694
|
* @param {MavenAGI.FeedbackRequest} request
|
|
579
695
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
580
696
|
*
|
|
581
|
-
* @throws {@link MavenAGI.
|
|
582
|
-
* @throws {@link MavenAGI.
|
|
583
|
-
* @throws {@link MavenAGI.
|
|
697
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
698
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
699
|
+
* @throws {@link MavenAGI.ServerError}
|
|
584
700
|
*
|
|
585
701
|
* @example
|
|
586
|
-
* await
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
702
|
+
* await client.conversation.createFeedback({
|
|
703
|
+
* feedbackId: {
|
|
704
|
+
* referenceId: "string"
|
|
705
|
+
* },
|
|
706
|
+
* conversationId: {
|
|
707
|
+
* referenceId: "string"
|
|
708
|
+
* },
|
|
709
|
+
* conversationMessageId: {
|
|
710
|
+
* referenceId: "string"
|
|
711
|
+
* },
|
|
712
|
+
* type: MavenAGI.FeedbackType.ThumbsUp,
|
|
713
|
+
* text: "string"
|
|
590
714
|
* })
|
|
591
715
|
*/
|
|
592
716
|
createFeedback(request, requestOptions) {
|
|
593
|
-
var _a, _b
|
|
717
|
+
var _a, _b;
|
|
594
718
|
return __awaiter(this, void 0, void 0, function* () {
|
|
595
719
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
596
720
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/conversations/feedback"),
|
|
@@ -601,37 +725,234 @@ export class Conversation {
|
|
|
601
725
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
602
726
|
"X-Fern-Language": "JavaScript",
|
|
603
727
|
"X-Fern-SDK-Name": "mavenagi",
|
|
604
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
728
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
729
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
730
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
731
|
+
},
|
|
732
|
+
contentType: "application/json",
|
|
733
|
+
requestType: "json",
|
|
734
|
+
body: serializers.FeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
735
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
736
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
737
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
738
|
+
});
|
|
739
|
+
if (_response.ok) {
|
|
740
|
+
return serializers.Feedback.parseOrThrow(_response.body, {
|
|
741
|
+
unrecognizedObjectKeys: "passthrough",
|
|
742
|
+
allowUnrecognizedUnionMembers: true,
|
|
743
|
+
allowUnrecognizedEnumValues: true,
|
|
744
|
+
breadcrumbsPrefix: ["response"],
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
if (_response.error.reason === "status-code") {
|
|
748
|
+
switch (_response.error.statusCode) {
|
|
749
|
+
case 404:
|
|
750
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
751
|
+
unrecognizedObjectKeys: "passthrough",
|
|
752
|
+
allowUnrecognizedUnionMembers: true,
|
|
753
|
+
allowUnrecognizedEnumValues: true,
|
|
754
|
+
breadcrumbsPrefix: ["response"],
|
|
755
|
+
}));
|
|
756
|
+
case 400:
|
|
757
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
758
|
+
unrecognizedObjectKeys: "passthrough",
|
|
759
|
+
allowUnrecognizedUnionMembers: true,
|
|
760
|
+
allowUnrecognizedEnumValues: true,
|
|
761
|
+
breadcrumbsPrefix: ["response"],
|
|
762
|
+
}));
|
|
763
|
+
case 500:
|
|
764
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
765
|
+
unrecognizedObjectKeys: "passthrough",
|
|
766
|
+
allowUnrecognizedUnionMembers: true,
|
|
767
|
+
allowUnrecognizedEnumValues: true,
|
|
768
|
+
breadcrumbsPrefix: ["response"],
|
|
769
|
+
}));
|
|
770
|
+
default:
|
|
771
|
+
throw new errors.MavenAGIError({
|
|
772
|
+
statusCode: _response.error.statusCode,
|
|
773
|
+
body: _response.error.body,
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
switch (_response.error.reason) {
|
|
778
|
+
case "non-json":
|
|
779
|
+
throw new errors.MavenAGIError({
|
|
780
|
+
statusCode: _response.error.statusCode,
|
|
781
|
+
body: _response.error.rawBody,
|
|
782
|
+
});
|
|
783
|
+
case "timeout":
|
|
784
|
+
throw new errors.MavenAGITimeoutError();
|
|
785
|
+
case "unknown":
|
|
786
|
+
throw new errors.MavenAGIError({
|
|
787
|
+
message: _response.error.errorMessage,
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Submit a filled out action form
|
|
794
|
+
*
|
|
795
|
+
* @param {string} conversationId - The ID of a conversation the form being submitted belongs to
|
|
796
|
+
* @param {MavenAGI.SubmitActionFormRequest} request
|
|
797
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
798
|
+
*
|
|
799
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
800
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
801
|
+
* @throws {@link MavenAGI.ServerError}
|
|
802
|
+
*
|
|
803
|
+
* @example
|
|
804
|
+
* await client.conversation.submitActionForm("string", {
|
|
805
|
+
* actionFormId: "string",
|
|
806
|
+
* parameters: {
|
|
807
|
+
* "string": {
|
|
808
|
+
* "key": "value"
|
|
809
|
+
* }
|
|
810
|
+
* }
|
|
811
|
+
* })
|
|
812
|
+
*/
|
|
813
|
+
submitActionForm(conversationId, request, requestOptions) {
|
|
814
|
+
var _a, _b;
|
|
815
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
816
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
817
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/submit-form`),
|
|
818
|
+
method: "POST",
|
|
819
|
+
headers: {
|
|
820
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
821
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
822
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
823
|
+
"X-Fern-Language": "JavaScript",
|
|
824
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
825
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
605
826
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
606
827
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
607
828
|
},
|
|
608
829
|
contentType: "application/json",
|
|
609
|
-
|
|
830
|
+
requestType: "json",
|
|
831
|
+
body: serializers.SubmitActionFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
610
832
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
611
833
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
612
834
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
613
835
|
});
|
|
614
836
|
if (_response.ok) {
|
|
615
|
-
return
|
|
837
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
838
|
+
unrecognizedObjectKeys: "passthrough",
|
|
839
|
+
allowUnrecognizedUnionMembers: true,
|
|
840
|
+
allowUnrecognizedEnumValues: true,
|
|
841
|
+
breadcrumbsPrefix: ["response"],
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
if (_response.error.reason === "status-code") {
|
|
845
|
+
switch (_response.error.statusCode) {
|
|
846
|
+
case 404:
|
|
847
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
848
|
+
unrecognizedObjectKeys: "passthrough",
|
|
849
|
+
allowUnrecognizedUnionMembers: true,
|
|
850
|
+
allowUnrecognizedEnumValues: true,
|
|
851
|
+
breadcrumbsPrefix: ["response"],
|
|
852
|
+
}));
|
|
853
|
+
case 400:
|
|
854
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
855
|
+
unrecognizedObjectKeys: "passthrough",
|
|
856
|
+
allowUnrecognizedUnionMembers: true,
|
|
857
|
+
allowUnrecognizedEnumValues: true,
|
|
858
|
+
breadcrumbsPrefix: ["response"],
|
|
859
|
+
}));
|
|
860
|
+
case 500:
|
|
861
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
862
|
+
unrecognizedObjectKeys: "passthrough",
|
|
863
|
+
allowUnrecognizedUnionMembers: true,
|
|
864
|
+
allowUnrecognizedEnumValues: true,
|
|
865
|
+
breadcrumbsPrefix: ["response"],
|
|
866
|
+
}));
|
|
867
|
+
default:
|
|
868
|
+
throw new errors.MavenAGIError({
|
|
869
|
+
statusCode: _response.error.statusCode,
|
|
870
|
+
body: _response.error.body,
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
switch (_response.error.reason) {
|
|
875
|
+
case "non-json":
|
|
876
|
+
throw new errors.MavenAGIError({
|
|
877
|
+
statusCode: _response.error.statusCode,
|
|
878
|
+
body: _response.error.rawBody,
|
|
879
|
+
});
|
|
880
|
+
case "timeout":
|
|
881
|
+
throw new errors.MavenAGITimeoutError();
|
|
882
|
+
case "unknown":
|
|
883
|
+
throw new errors.MavenAGIError({
|
|
884
|
+
message: _response.error.errorMessage,
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Add metadata to an existing conversation. If a metadata field already exists, it will be overwritten.
|
|
891
|
+
*
|
|
892
|
+
* @param {string} conversationId - The ID of a conversation the metadata being added belongs to
|
|
893
|
+
* @param {Record<string, string>} request
|
|
894
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
895
|
+
*
|
|
896
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
897
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
898
|
+
* @throws {@link MavenAGI.ServerError}
|
|
899
|
+
*
|
|
900
|
+
* @example
|
|
901
|
+
* await client.conversation.addConversationMetadata("string", {
|
|
902
|
+
* "string": "string"
|
|
903
|
+
* })
|
|
904
|
+
*/
|
|
905
|
+
addConversationMetadata(conversationId, request, requestOptions) {
|
|
906
|
+
var _a, _b;
|
|
907
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
908
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
909
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/metadata`),
|
|
910
|
+
method: "POST",
|
|
911
|
+
headers: {
|
|
912
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
913
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
914
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
915
|
+
"X-Fern-Language": "JavaScript",
|
|
916
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
917
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.20",
|
|
918
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
919
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
920
|
+
},
|
|
921
|
+
contentType: "application/json",
|
|
922
|
+
requestType: "json",
|
|
923
|
+
body: serializers.conversation.addConversationMetadata.Request.jsonOrThrow(request, {
|
|
924
|
+
unrecognizedObjectKeys: "strip",
|
|
925
|
+
}),
|
|
926
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
927
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
928
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
929
|
+
});
|
|
930
|
+
if (_response.ok) {
|
|
931
|
+
return serializers.conversation.addConversationMetadata.Response.parseOrThrow(_response.body, {
|
|
932
|
+
unrecognizedObjectKeys: "passthrough",
|
|
933
|
+
allowUnrecognizedUnionMembers: true,
|
|
934
|
+
allowUnrecognizedEnumValues: true,
|
|
935
|
+
breadcrumbsPrefix: ["response"],
|
|
936
|
+
});
|
|
616
937
|
}
|
|
617
938
|
if (_response.error.reason === "status-code") {
|
|
618
|
-
switch (
|
|
619
|
-
case
|
|
620
|
-
throw new MavenAGI.
|
|
939
|
+
switch (_response.error.statusCode) {
|
|
940
|
+
case 404:
|
|
941
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
621
942
|
unrecognizedObjectKeys: "passthrough",
|
|
622
943
|
allowUnrecognizedUnionMembers: true,
|
|
623
944
|
allowUnrecognizedEnumValues: true,
|
|
624
945
|
breadcrumbsPrefix: ["response"],
|
|
625
946
|
}));
|
|
626
|
-
case
|
|
627
|
-
throw new MavenAGI.
|
|
947
|
+
case 400:
|
|
948
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
628
949
|
unrecognizedObjectKeys: "passthrough",
|
|
629
950
|
allowUnrecognizedUnionMembers: true,
|
|
630
951
|
allowUnrecognizedEnumValues: true,
|
|
631
952
|
breadcrumbsPrefix: ["response"],
|
|
632
953
|
}));
|
|
633
|
-
case
|
|
634
|
-
throw new MavenAGI.
|
|
954
|
+
case 500:
|
|
955
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
635
956
|
unrecognizedObjectKeys: "passthrough",
|
|
636
957
|
allowUnrecognizedUnionMembers: true,
|
|
637
958
|
allowUnrecognizedEnumValues: true,
|