mavenagi 0.0.0-alpha.9 → 1.0.0
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 +15 -0
- package/Client.js +10 -0
- package/README.md +78 -22
- package/api/resources/actions/client/Client.d.ts +21 -4
- package/api/resources/actions/client/Client.js +33 -19
- package/api/resources/actions/types/ActionBase.d.ts +2 -2
- package/api/resources/actions/types/ActionRequest.d.ts +12 -4
- package/api/resources/actions/types/ActionResponse.d.ts +12 -4
- package/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
- package/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
- package/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
- package/api/resources/actions/types/Precondition.d.ts +31 -0
- package/api/resources/actions/types/PreconditionBase.d.ts +8 -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/actions/types/PreconditionOperator.js +6 -0
- package/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
- package/api/resources/actions/types/index.d.ts +9 -1
- package/api/resources/actions/types/index.js +9 -1
- package/api/resources/appSettings/client/Client.d.ts +47 -0
- package/api/resources/appSettings/client/Client.js +125 -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/types/AppUser.d.ts +3 -4
- package/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/api/resources/commons/types/AppUserRequest.d.ts +22 -1
- package/api/resources/commons/types/AppUserResponse.d.ts +38 -1
- package/api/resources/commons/types/EntityType.d.ts +3 -1
- package/api/resources/commons/types/EntityType.js +2 -0
- package/api/resources/commons/types/Feedback.d.ts +32 -8
- package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/api/resources/commons/types/UserData.d.ts +10 -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 +6 -2
- package/api/resources/commons/types/index.js +6 -2
- package/api/resources/conversation/client/Client.d.ts +79 -36
- package/api/resources/conversation/client/Client.js +227 -91
- package/api/resources/conversation/client/index.d.ts +1 -1
- package/api/resources/conversation/client/index.js +1 -1
- package/api/resources/conversation/client/requests/ConversationGetRequest.d.ts +15 -0
- package/api/resources/conversation/client/requests/index.d.ts +1 -0
- package/api/resources/conversation/client/requests/index.js +1 -0
- package/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/api/resources/conversation/types/AskRequest.d.ts +21 -5
- package/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -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/Attachment.d.ts +9 -0
- package/api/resources/conversation/types/BotChartResponse.d.ts +11 -0
- package/api/resources/conversation/types/BotChartResponse.js +4 -0
- package/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/api/resources/conversation/types/BotResponse.d.ts +4 -1
- package/api/resources/conversation/types/BotResponseMetadata.d.ts +2 -0
- package/api/resources/conversation/types/Capability.d.ts +15 -1
- package/api/resources/conversation/types/Capability.js +2 -0
- package/api/resources/conversation/types/CategorizationResponse.d.ts +6 -0
- package/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/api/resources/conversation/types/ChartSpecSchema.d.ts +7 -0
- package/api/resources/conversation/types/ChartSpecSchema.js +6 -0
- package/api/resources/conversation/types/ConversationAnalysis.d.ts +16 -0
- package/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +12 -2
- 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 +0 -2
- package/api/resources/conversation/types/ConversationResponse.d.ts +51 -2
- package/api/resources/conversation/types/FeedbackRequest.d.ts +24 -1
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/api/resources/conversation/types/ResponseConfig.d.ts +4 -4
- 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 +1 -3
- package/api/resources/conversation/types/UserMessage.d.ts +5 -4
- 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 +8 -2
- package/api/resources/conversation/types/index.js +8 -2
- package/api/resources/index.d.ts +4 -0
- package/api/resources/index.js +4 -0
- package/api/resources/knowledge/client/Client.d.ts +13 -4
- package/api/resources/knowledge/client/Client.js +55 -41
- package/api/resources/translations/client/Client.d.ts +52 -0
- package/api/resources/translations/client/Client.js +130 -0
- package/api/resources/translations/client/index.d.ts +1 -0
- package/api/resources/translations/client/index.js +1 -0
- package/api/resources/translations/index.d.ts +2 -0
- package/api/resources/translations/index.js +2 -0
- package/api/resources/translations/types/TranslationRequest.d.ts +16 -0
- package/api/resources/translations/types/TranslationRequest.js +4 -0
- package/api/resources/translations/types/TranslationResponse.d.ts +13 -0
- package/api/resources/translations/types/TranslationResponse.js +4 -0
- package/api/resources/translations/types/index.d.ts +2 -0
- package/api/resources/translations/types/index.js +2 -0
- package/api/resources/triggers/client/Client.d.ts +10 -1
- package/api/resources/triggers/client/Client.js +22 -16
- package/api/resources/triggers/types/index.d.ts +0 -3
- package/api/resources/triggers/types/index.js +0 -3
- package/api/resources/users/client/Client.d.ts +27 -12
- package/api/resources/users/client/Client.js +33 -23
- 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 +243 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/core/runtime/runtime.d.ts +1 -0
- package/core/runtime/runtime.js +1 -0
- package/core/schemas/Schema.d.ts +8 -4
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/core/schemas/builders/bigint/bigint.js +46 -0
- package/core/schemas/builders/bigint/index.d.ts +1 -0
- package/core/schemas/builders/bigint/index.js +1 -0
- package/core/schemas/builders/index.d.ts +1 -0
- package/core/schemas/builders/index.js +1 -0
- 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/getErrorMessageForIncorrectType.js +4 -0
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +15 -0
- package/dist/Client.js +10 -0
- package/dist/api/resources/actions/client/Client.d.ts +21 -4
- package/dist/api/resources/actions/client/Client.js +33 -19
- package/dist/api/resources/actions/types/ActionBase.d.ts +2 -2
- package/dist/api/resources/actions/types/ActionRequest.d.ts +12 -4
- package/dist/api/resources/actions/types/ActionResponse.d.ts +12 -4
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.js +4 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.js +4 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.d.ts +10 -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/PreconditionBase.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionBase.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/TagsPrecondition.d.ts +8 -0
- package/dist/api/resources/actions/types/TagsPrecondition.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +9 -1
- package/dist/api/resources/actions/types/index.js +9 -1
- package/dist/api/resources/appSettings/client/Client.d.ts +47 -0
- package/dist/api/resources/appSettings/client/Client.js +125 -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/commons/types/AppUser.d.ts +3 -4
- package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +22 -1
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +38 -1
- package/dist/api/resources/commons/types/EntityType.d.ts +3 -1
- package/dist/api/resources/commons/types/EntityType.js +2 -0
- package/dist/api/resources/commons/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/commons/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/commons/types/Feedback.d.ts +32 -8
- 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/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 +6 -2
- package/dist/api/resources/commons/types/index.js +6 -2
- package/dist/api/resources/conversation/client/Client.d.ts +79 -36
- package/dist/api/resources/conversation/client/Client.js +227 -91
- package/dist/api/resources/conversation/client/index.d.ts +1 -1
- package/dist/api/resources/conversation/client/index.js +1 -1
- package/dist/api/resources/conversation/client/requests/ConversationGetRequest.d.ts +15 -0
- package/dist/api/resources/conversation/client/requests/ConversationGetRequest.js +4 -0
- package/dist/api/resources/conversation/client/requests/index.d.ts +1 -0
- package/dist/api/resources/conversation/client/requests/index.js +1 -0
- package/dist/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +21 -5
- 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/Attachment.d.ts +9 -0
- package/dist/api/resources/conversation/types/Attachment.js +4 -0
- package/dist/api/resources/conversation/types/BotChartResponse.d.ts +11 -0
- package/dist/api/resources/conversation/types/BotChartResponse.js +4 -0
- package/dist/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/api/resources/conversation/types/BotResponse.d.ts +4 -1
- package/dist/api/resources/conversation/types/BotResponseMetadata.d.ts +2 -0
- package/dist/api/resources/conversation/types/Capability.d.ts +15 -1
- package/dist/api/resources/conversation/types/Capability.js +2 -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/ChartSpecSchema.d.ts +7 -0
- package/dist/api/resources/conversation/types/ChartSpecSchema.js +6 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.d.ts +16 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +12 -2
- 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 +0 -2
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +51 -2
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +24 -1
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/dist/api/resources/conversation/types/ResponseConfig.d.ts +4 -4
- 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 +1 -3
- package/dist/api/resources/conversation/types/UserMessage.d.ts +5 -4
- 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 +8 -2
- package/dist/api/resources/conversation/types/index.js +8 -2
- package/dist/api/resources/index.d.ts +4 -0
- package/dist/api/resources/index.js +4 -0
- package/dist/api/resources/knowledge/client/Client.d.ts +13 -4
- package/dist/api/resources/knowledge/client/Client.js +55 -41
- package/dist/api/resources/translations/client/Client.d.ts +52 -0
- package/dist/api/resources/translations/client/Client.js +130 -0
- package/dist/api/resources/translations/client/index.d.ts +1 -0
- package/dist/api/resources/translations/client/index.js +1 -0
- package/dist/api/resources/translations/index.d.ts +2 -0
- package/dist/api/resources/translations/index.js +2 -0
- package/dist/api/resources/translations/types/TranslationRequest.d.ts +16 -0
- package/dist/api/resources/translations/types/TranslationRequest.js +4 -0
- package/dist/api/resources/translations/types/TranslationResponse.d.ts +13 -0
- package/dist/api/resources/translations/types/TranslationResponse.js +4 -0
- package/dist/api/resources/translations/types/index.d.ts +2 -0
- package/dist/api/resources/translations/types/index.js +2 -0
- package/dist/api/resources/triggers/client/Client.d.ts +10 -1
- package/dist/api/resources/triggers/client/Client.js +22 -16
- package/dist/api/resources/triggers/types/index.d.ts +0 -3
- package/dist/api/resources/triggers/types/index.js +0 -3
- package/dist/api/resources/users/client/Client.d.ts +27 -12
- package/dist/api/resources/users/client/Client.js +33 -23
- 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 +243 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/dist/core/runtime/runtime.d.ts +1 -0
- package/dist/core/runtime/runtime.js +1 -0
- package/dist/core/schemas/Schema.d.ts +8 -4
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +46 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
- package/dist/core/schemas/builders/bigint/index.js +1 -0
- package/dist/core/schemas/builders/index.d.ts +1 -0
- package/dist/core/schemas/builders/index.js +1 -0
- 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/getErrorMessageForIncorrectType.js +4 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/actions/types/ActionBase.d.ts +1 -2
- package/dist/serialization/resources/actions/types/ActionBase.js +2 -2
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.js +11 -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/PreconditionBase.d.ts +13 -0
- package/dist/serialization/resources/actions/types/PreconditionBase.js +8 -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/TagsPrecondition.d.ts +13 -0
- package/dist/serialization/resources/actions/types/TagsPrecondition.js +10 -0
- package/dist/serialization/resources/actions/types/index.d.ts +9 -1
- package/dist/serialization/resources/actions/types/index.js +9 -1
- 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 +4 -4
- package/dist/serialization/resources/commons/types/AppUser.js +4 -4
- package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/dist/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
- package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +4 -1
- package/dist/serialization/resources/commons/types/AppUserRequest.js +7 -1
- package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +6 -1
- package/dist/serialization/resources/commons/types/AppUserResponse.js +9 -1
- package/dist/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/EntityType.js +2 -0
- package/dist/serialization/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +1 -1
- package/dist/serialization/resources/{triggers → commons}/types/EventTriggerResponse.js +1 -1
- package/dist/serialization/resources/commons/types/Feedback.d.ts +6 -7
- package/dist/serialization/resources/commons/types/Feedback.js +9 -8
- package/dist/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.js +9 -0
- 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 +6 -2
- package/dist/serialization/resources/commons/types/index.js +6 -2
- 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 +5 -5
- package/dist/serialization/resources/conversation/types/AskRequest.js +5 -5
- 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/{actions/types/Preconditions.d.ts → conversation/types/Attachment.d.ts} +4 -3
- package/dist/serialization/resources/conversation/types/Attachment.js +8 -0
- package/dist/serialization/resources/conversation/types/BotChartResponse.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/BotChartResponse.js +10 -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/BotResponse.d.ts +5 -1
- package/dist/serialization/resources/conversation/types/BotResponse.js +2 -0
- package/dist/serialization/resources/conversation/types/BotResponseMetadata.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/BotResponseMetadata.js +1 -0
- package/dist/serialization/resources/conversation/types/Capability.d.ts +1 -1
- package/dist/serialization/resources/conversation/types/Capability.js +1 -1
- package/dist/serialization/resources/conversation/types/CategorizationResponse.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/dist/serialization/resources/conversation/types/ChartSpecSchema.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/ChartSpecSchema.js +5 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.d.ts +17 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.js +12 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +6 -1
- package/dist/serialization/resources/conversation/types/ConversationBase.js +6 -1
- 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 +0 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +0 -2
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -2
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +2 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- 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 +3 -3
- package/dist/serialization/resources/conversation/types/ResponseConfig.js +3 -3
- 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 +0 -2
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
- package/dist/serialization/resources/conversation/types/UserMessage.d.ts +5 -5
- package/dist/serialization/resources/conversation/types/UserMessage.js +5 -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 +8 -2
- package/dist/serialization/resources/conversation/types/index.js +8 -2
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +3 -0
- package/dist/serialization/resources/translations/index.d.ts +1 -0
- package/dist/serialization/resources/translations/index.js +1 -0
- package/dist/serialization/resources/translations/types/TranslationRequest.d.ts +13 -0
- package/dist/serialization/resources/translations/types/TranslationRequest.js +8 -0
- package/dist/serialization/resources/translations/types/TranslationResponse.d.ts +12 -0
- package/dist/serialization/resources/translations/types/TranslationResponse.js +7 -0
- package/dist/serialization/resources/translations/types/index.d.ts +2 -0
- package/dist/serialization/resources/translations/types/index.js +2 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
- package/dist/serialization/resources/triggers/types/index.d.ts +0 -3
- package/dist/serialization/resources/triggers/types/index.js +0 -3
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +12 -2
- package/reference.md +1953 -0
- package/serialization/resources/actions/types/ActionBase.d.ts +1 -2
- package/serialization/resources/actions/types/ActionBase.js +2 -2
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
- package/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
- package/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
- package/serialization/resources/actions/types/MetadataPrecondition.js +11 -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/PreconditionBase.d.ts +13 -0
- package/serialization/resources/actions/types/PreconditionBase.js +8 -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/TagsPrecondition.d.ts +13 -0
- package/serialization/resources/actions/types/TagsPrecondition.js +10 -0
- package/serialization/resources/actions/types/index.d.ts +9 -1
- package/serialization/resources/actions/types/index.js +9 -1
- 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 +4 -4
- package/serialization/resources/commons/types/AppUser.js +4 -4
- package/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
- package/serialization/resources/commons/types/AppUserRequest.d.ts +4 -1
- package/serialization/resources/commons/types/AppUserRequest.js +7 -1
- package/serialization/resources/commons/types/AppUserResponse.d.ts +6 -1
- package/serialization/resources/commons/types/AppUserResponse.js +9 -1
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +2 -0
- package/serialization/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +1 -1
- package/serialization/resources/{triggers → commons}/types/EventTriggerResponse.js +1 -1
- package/serialization/resources/commons/types/Feedback.d.ts +6 -7
- package/serialization/resources/commons/types/Feedback.js +9 -8
- package/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/serialization/resources/commons/types/FeedbackBase.js +9 -0
- 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 +6 -2
- package/serialization/resources/commons/types/index.js +6 -2
- 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 +5 -5
- package/serialization/resources/conversation/types/AskRequest.js +5 -5
- 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/{actions/types/Preconditions.d.ts → conversation/types/Attachment.d.ts} +4 -3
- package/serialization/resources/conversation/types/Attachment.js +8 -0
- package/serialization/resources/conversation/types/BotChartResponse.d.ts +15 -0
- package/serialization/resources/conversation/types/BotChartResponse.js +10 -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/BotResponse.d.ts +5 -1
- package/serialization/resources/conversation/types/BotResponse.js +2 -0
- package/serialization/resources/conversation/types/BotResponseMetadata.d.ts +1 -0
- package/serialization/resources/conversation/types/BotResponseMetadata.js +1 -0
- package/serialization/resources/conversation/types/Capability.d.ts +1 -1
- package/serialization/resources/conversation/types/Capability.js +1 -1
- package/serialization/resources/conversation/types/CategorizationResponse.d.ts +12 -0
- package/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/serialization/resources/conversation/types/ChartSpecSchema.d.ts +10 -0
- package/serialization/resources/conversation/types/ChartSpecSchema.js +5 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.d.ts +17 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.js +12 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +6 -1
- package/serialization/resources/conversation/types/ConversationBase.js +6 -1
- 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 +0 -2
- package/serialization/resources/conversation/types/ConversationRequest.js +0 -2
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -2
- package/serialization/resources/conversation/types/ConversationResponse.js +2 -2
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- 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 +3 -3
- package/serialization/resources/conversation/types/ResponseConfig.js +3 -3
- 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 +0 -2
- package/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
- package/serialization/resources/conversation/types/UserMessage.d.ts +5 -5
- package/serialization/resources/conversation/types/UserMessage.js +5 -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 +8 -2
- package/serialization/resources/conversation/types/index.js +8 -2
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +3 -0
- package/serialization/resources/translations/index.d.ts +1 -0
- package/serialization/resources/translations/index.js +1 -0
- package/serialization/resources/translations/types/TranslationRequest.d.ts +13 -0
- package/serialization/resources/translations/types/TranslationRequest.js +8 -0
- package/serialization/resources/translations/types/TranslationResponse.d.ts +12 -0
- package/serialization/resources/translations/types/TranslationResponse.js +7 -0
- package/serialization/resources/translations/types/index.d.ts +2 -0
- package/serialization/resources/translations/types/index.js +2 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
- package/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
- package/serialization/resources/triggers/types/index.d.ts +0 -3
- package/serialization/resources/triggers/types/index.js +0 -3
- package/version.d.ts +1 -0
- package/version.js +1 -0
- package/api/resources/actions/types/Preconditions.d.ts +0 -7
- package/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
- package/api/resources/commons/types/User.d.ts +0 -10
- package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/api/resources/actions/types/Preconditions.d.ts +0 -7
- package/dist/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
- package/dist/api/resources/commons/types/User.d.ts +0 -10
- package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/serialization/resources/actions/types/Preconditions.js +0 -7
- package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
- package/dist/serialization/resources/commons/types/AppUserIdentification.js +0 -8
- package/dist/serialization/resources/commons/types/User.d.ts +0 -15
- package/dist/serialization/resources/commons/types/User.js +0 -10
- 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/serialization/resources/actions/types/Preconditions.js +0 -7
- package/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
- package/serialization/resources/commons/types/AppUserIdentification.js +0 -8
- package/serialization/resources/commons/types/User.d.ts +0 -15
- package/serialization/resources/commons/types/User.js +0 -10
- 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/api/resources/actions/types/{Preconditions.js → ConversationExecutedActionPrecondition.js} +0 -0
- /package/api/resources/{commons/types/AppUserIdentification.js → actions/types/ConversationPrecondition.js} +0 -0
- /package/api/resources/{commons/types/User.js → actions/types/MetadataPrecondition.js} +0 -0
- /package/api/resources/{conversation/types/ConversationContext.js → actions/types/Precondition.js} +0 -0
- /package/api/resources/{conversation/types/ConversationMessageContext.js → actions/types/PreconditionBase.js} +0 -0
- /package/api/resources/{triggers/types/EventTriggerBase.js → actions/types/PreconditionGroup.js} +0 -0
- /package/api/resources/{triggers/types/EventTriggerResponse.js → actions/types/TagsPrecondition.js} +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/{dist/api/resources/triggers → api/resources/commons}/types/EventTriggerBase.js +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
- /package/{dist/api/resources/triggers → api/resources/commons}/types/EventTriggerResponse.js +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/{dist/api/resources/actions/types/Preconditions.js → api/resources/commons/types/FeedbackBase.js} +0 -0
- /package/{dist/api/resources/commons/types/AppUserIdentification.js → api/resources/commons/types/UserData.js} +0 -0
- /package/{dist/api/resources/commons/types/User.js → api/resources/conversation/client/requests/ConversationGetRequest.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationContext.js → api/resources/conversation/types/AskStreamActionEvent.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationMessageContext.js → api/resources/conversation/types/Attachment.js} +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
|
@@ -21,7 +21,7 @@ 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.
|
|
@@ -36,12 +36,18 @@ export class Conversation {
|
|
|
36
36
|
* referenceId: "string"
|
|
37
37
|
* },
|
|
38
38
|
* messages: [{}],
|
|
39
|
-
* context: {},
|
|
40
|
-
* id: "string",
|
|
41
39
|
* responseConfig: {
|
|
42
|
-
* capabilities: [
|
|
40
|
+
* capabilities: ["MARKDOWN"],
|
|
43
41
|
* isCopilot: true,
|
|
44
|
-
* responseLength:
|
|
42
|
+
* 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"
|
|
45
51
|
* }
|
|
46
52
|
* })
|
|
47
53
|
*/
|
|
@@ -57,18 +63,20 @@ export class Conversation {
|
|
|
57
63
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
58
64
|
"X-Fern-Language": "JavaScript",
|
|
59
65
|
"X-Fern-SDK-Name": "mavenagi",
|
|
60
|
-
"X-Fern-SDK-Version": "
|
|
66
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
67
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
61
68
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
62
69
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
63
70
|
},
|
|
64
71
|
contentType: "application/json",
|
|
65
|
-
|
|
72
|
+
requestType: "json",
|
|
73
|
+
body: serializers.ConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
66
74
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
67
75
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
68
76
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
69
77
|
});
|
|
70
78
|
if (_response.ok) {
|
|
71
|
-
return
|
|
79
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
72
80
|
unrecognizedObjectKeys: "passthrough",
|
|
73
81
|
allowUnrecognizedUnionMembers: true,
|
|
74
82
|
allowUnrecognizedEnumValues: true,
|
|
@@ -78,21 +86,21 @@ export class Conversation {
|
|
|
78
86
|
if (_response.error.reason === "status-code") {
|
|
79
87
|
switch (_response.error.statusCode) {
|
|
80
88
|
case 404:
|
|
81
|
-
throw new MavenAGI.NotFoundError(
|
|
89
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
82
90
|
unrecognizedObjectKeys: "passthrough",
|
|
83
91
|
allowUnrecognizedUnionMembers: true,
|
|
84
92
|
allowUnrecognizedEnumValues: true,
|
|
85
93
|
breadcrumbsPrefix: ["response"],
|
|
86
94
|
}));
|
|
87
95
|
case 400:
|
|
88
|
-
throw new MavenAGI.BadRequestError(
|
|
96
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
89
97
|
unrecognizedObjectKeys: "passthrough",
|
|
90
98
|
allowUnrecognizedUnionMembers: true,
|
|
91
99
|
allowUnrecognizedEnumValues: true,
|
|
92
100
|
breadcrumbsPrefix: ["response"],
|
|
93
101
|
}));
|
|
94
102
|
case 500:
|
|
95
|
-
throw new MavenAGI.ServerError(
|
|
103
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
96
104
|
unrecognizedObjectKeys: "passthrough",
|
|
97
105
|
allowUnrecognizedUnionMembers: true,
|
|
98
106
|
allowUnrecognizedEnumValues: true,
|
|
@@ -124,6 +132,7 @@ export class Conversation {
|
|
|
124
132
|
* Get a conversation
|
|
125
133
|
*
|
|
126
134
|
* @param {string} conversationId - The ID of the conversation to get
|
|
135
|
+
* @param {MavenAGI.ConversationGetRequest} request
|
|
127
136
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
137
|
*
|
|
129
138
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -131,11 +140,18 @@ export class Conversation {
|
|
|
131
140
|
* @throws {@link MavenAGI.ServerError}
|
|
132
141
|
*
|
|
133
142
|
* @example
|
|
134
|
-
* await client.conversation.get("string"
|
|
143
|
+
* await client.conversation.get("string", {
|
|
144
|
+
* appId: "string"
|
|
145
|
+
* })
|
|
135
146
|
*/
|
|
136
|
-
get(conversationId, requestOptions) {
|
|
147
|
+
get(conversationId, request = {}, requestOptions) {
|
|
137
148
|
var _a, _b;
|
|
138
149
|
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
const { appId } = request;
|
|
151
|
+
const _queryParams = {};
|
|
152
|
+
if (appId != null) {
|
|
153
|
+
_queryParams["appId"] = appId;
|
|
154
|
+
}
|
|
139
155
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
140
156
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}`),
|
|
141
157
|
method: "GET",
|
|
@@ -145,17 +161,20 @@ export class Conversation {
|
|
|
145
161
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
146
162
|
"X-Fern-Language": "JavaScript",
|
|
147
163
|
"X-Fern-SDK-Name": "mavenagi",
|
|
148
|
-
"X-Fern-SDK-Version": "
|
|
164
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
165
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
149
166
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
150
167
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
151
168
|
},
|
|
152
169
|
contentType: "application/json",
|
|
170
|
+
queryParameters: _queryParams,
|
|
171
|
+
requestType: "json",
|
|
153
172
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
154
173
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
155
174
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
156
175
|
});
|
|
157
176
|
if (_response.ok) {
|
|
158
|
-
return
|
|
177
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
159
178
|
unrecognizedObjectKeys: "passthrough",
|
|
160
179
|
allowUnrecognizedUnionMembers: true,
|
|
161
180
|
allowUnrecognizedEnumValues: true,
|
|
@@ -165,21 +184,21 @@ export class Conversation {
|
|
|
165
184
|
if (_response.error.reason === "status-code") {
|
|
166
185
|
switch (_response.error.statusCode) {
|
|
167
186
|
case 404:
|
|
168
|
-
throw new MavenAGI.NotFoundError(
|
|
187
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
169
188
|
unrecognizedObjectKeys: "passthrough",
|
|
170
189
|
allowUnrecognizedUnionMembers: true,
|
|
171
190
|
allowUnrecognizedEnumValues: true,
|
|
172
191
|
breadcrumbsPrefix: ["response"],
|
|
173
192
|
}));
|
|
174
193
|
case 400:
|
|
175
|
-
throw new MavenAGI.BadRequestError(
|
|
194
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
176
195
|
unrecognizedObjectKeys: "passthrough",
|
|
177
196
|
allowUnrecognizedUnionMembers: true,
|
|
178
197
|
allowUnrecognizedEnumValues: true,
|
|
179
198
|
breadcrumbsPrefix: ["response"],
|
|
180
199
|
}));
|
|
181
200
|
case 500:
|
|
182
|
-
throw new MavenAGI.ServerError(
|
|
201
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
183
202
|
unrecognizedObjectKeys: "passthrough",
|
|
184
203
|
allowUnrecognizedUnionMembers: true,
|
|
185
204
|
allowUnrecognizedEnumValues: true,
|
|
@@ -220,10 +239,16 @@ export class Conversation {
|
|
|
220
239
|
*
|
|
221
240
|
* @example
|
|
222
241
|
* await client.conversation.appendNewMessages("string", [{
|
|
242
|
+
* conversationMessageId: {
|
|
243
|
+
* referenceId: "string"
|
|
244
|
+
* },
|
|
245
|
+
* userId: {
|
|
246
|
+
* referenceId: "string"
|
|
247
|
+
* },
|
|
223
248
|
* text: "string",
|
|
224
|
-
* userMessageType:
|
|
225
|
-
*
|
|
226
|
-
*
|
|
249
|
+
* userMessageType: "USER",
|
|
250
|
+
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
251
|
+
* updatedAt: new Date("2024-01-15T09:30:00.000Z")
|
|
227
252
|
* }])
|
|
228
253
|
*/
|
|
229
254
|
appendNewMessages(conversationId, request, requestOptions) {
|
|
@@ -238,12 +263,14 @@ export class Conversation {
|
|
|
238
263
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
239
264
|
"X-Fern-Language": "JavaScript",
|
|
240
265
|
"X-Fern-SDK-Name": "mavenagi",
|
|
241
|
-
"X-Fern-SDK-Version": "
|
|
266
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
267
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
242
268
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
243
269
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
244
270
|
},
|
|
245
271
|
contentType: "application/json",
|
|
246
|
-
|
|
272
|
+
requestType: "json",
|
|
273
|
+
body: serializers.conversation.appendNewMessages.Request.jsonOrThrow(request, {
|
|
247
274
|
unrecognizedObjectKeys: "strip",
|
|
248
275
|
}),
|
|
249
276
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -251,7 +278,7 @@ export class Conversation {
|
|
|
251
278
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
252
279
|
});
|
|
253
280
|
if (_response.ok) {
|
|
254
|
-
return
|
|
281
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
255
282
|
unrecognizedObjectKeys: "passthrough",
|
|
256
283
|
allowUnrecognizedUnionMembers: true,
|
|
257
284
|
allowUnrecognizedEnumValues: true,
|
|
@@ -261,21 +288,21 @@ export class Conversation {
|
|
|
261
288
|
if (_response.error.reason === "status-code") {
|
|
262
289
|
switch (_response.error.statusCode) {
|
|
263
290
|
case 404:
|
|
264
|
-
throw new MavenAGI.NotFoundError(
|
|
291
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
265
292
|
unrecognizedObjectKeys: "passthrough",
|
|
266
293
|
allowUnrecognizedUnionMembers: true,
|
|
267
294
|
allowUnrecognizedEnumValues: true,
|
|
268
295
|
breadcrumbsPrefix: ["response"],
|
|
269
296
|
}));
|
|
270
297
|
case 400:
|
|
271
|
-
throw new MavenAGI.BadRequestError(
|
|
298
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
272
299
|
unrecognizedObjectKeys: "passthrough",
|
|
273
300
|
allowUnrecognizedUnionMembers: true,
|
|
274
301
|
allowUnrecognizedEnumValues: true,
|
|
275
302
|
breadcrumbsPrefix: ["response"],
|
|
276
303
|
}));
|
|
277
304
|
case 500:
|
|
278
|
-
throw new MavenAGI.ServerError(
|
|
305
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
279
306
|
unrecognizedObjectKeys: "passthrough",
|
|
280
307
|
allowUnrecognizedUnionMembers: true,
|
|
281
308
|
allowUnrecognizedEnumValues: true,
|
|
@@ -304,7 +331,7 @@ export class Conversation {
|
|
|
304
331
|
});
|
|
305
332
|
}
|
|
306
333
|
/**
|
|
307
|
-
* Ask a question
|
|
334
|
+
* Ask a question
|
|
308
335
|
*
|
|
309
336
|
* @param {string} conversationId - The ID of a new or existing conversation to use as context for the question
|
|
310
337
|
* @param {MavenAGI.AskRequest} request
|
|
@@ -315,11 +342,18 @@ export class Conversation {
|
|
|
315
342
|
* @throws {@link MavenAGI.ServerError}
|
|
316
343
|
*
|
|
317
344
|
* @example
|
|
318
|
-
* await client.conversation.ask("
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
345
|
+
* await client.conversation.ask("conversation-0", {
|
|
346
|
+
* conversationMessageId: {
|
|
347
|
+
* referenceId: "message-0"
|
|
348
|
+
* },
|
|
349
|
+
* userId: {
|
|
350
|
+
* referenceId: "user-0"
|
|
351
|
+
* },
|
|
352
|
+
* text: "How do I reset my password?",
|
|
353
|
+
* attachments: [{
|
|
354
|
+
* type: "image/png",
|
|
355
|
+
* content: "iVBORw0KGgo..."
|
|
356
|
+
* }]
|
|
323
357
|
* })
|
|
324
358
|
*/
|
|
325
359
|
ask(conversationId, request, requestOptions) {
|
|
@@ -334,18 +368,20 @@ export class Conversation {
|
|
|
334
368
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
335
369
|
"X-Fern-Language": "JavaScript",
|
|
336
370
|
"X-Fern-SDK-Name": "mavenagi",
|
|
337
|
-
"X-Fern-SDK-Version": "
|
|
371
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
372
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
338
373
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
339
374
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
340
375
|
},
|
|
341
376
|
contentType: "application/json",
|
|
342
|
-
|
|
377
|
+
requestType: "json",
|
|
378
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
343
379
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
344
380
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
345
381
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
346
382
|
});
|
|
347
383
|
if (_response.ok) {
|
|
348
|
-
return
|
|
384
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
349
385
|
unrecognizedObjectKeys: "passthrough",
|
|
350
386
|
allowUnrecognizedUnionMembers: true,
|
|
351
387
|
allowUnrecognizedEnumValues: true,
|
|
@@ -355,21 +391,21 @@ export class Conversation {
|
|
|
355
391
|
if (_response.error.reason === "status-code") {
|
|
356
392
|
switch (_response.error.statusCode) {
|
|
357
393
|
case 404:
|
|
358
|
-
throw new MavenAGI.NotFoundError(
|
|
394
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
359
395
|
unrecognizedObjectKeys: "passthrough",
|
|
360
396
|
allowUnrecognizedUnionMembers: true,
|
|
361
397
|
allowUnrecognizedEnumValues: true,
|
|
362
398
|
breadcrumbsPrefix: ["response"],
|
|
363
399
|
}));
|
|
364
400
|
case 400:
|
|
365
|
-
throw new MavenAGI.BadRequestError(
|
|
401
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
366
402
|
unrecognizedObjectKeys: "passthrough",
|
|
367
403
|
allowUnrecognizedUnionMembers: true,
|
|
368
404
|
allowUnrecognizedEnumValues: true,
|
|
369
405
|
breadcrumbsPrefix: ["response"],
|
|
370
406
|
}));
|
|
371
407
|
case 500:
|
|
372
|
-
throw new MavenAGI.ServerError(
|
|
408
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
373
409
|
unrecognizedObjectKeys: "passthrough",
|
|
374
410
|
allowUnrecognizedUnionMembers: true,
|
|
375
411
|
allowUnrecognizedEnumValues: true,
|
|
@@ -398,7 +434,7 @@ export class Conversation {
|
|
|
398
434
|
});
|
|
399
435
|
}
|
|
400
436
|
/**
|
|
401
|
-
* Ask a question
|
|
437
|
+
* 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.
|
|
402
438
|
*/
|
|
403
439
|
askStream(conversationId, request, requestOptions) {
|
|
404
440
|
var _a, _b;
|
|
@@ -412,13 +448,15 @@ export class Conversation {
|
|
|
412
448
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
413
449
|
"X-Fern-Language": "JavaScript",
|
|
414
450
|
"X-Fern-SDK-Name": "mavenagi",
|
|
415
|
-
"X-Fern-SDK-Version": "
|
|
451
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
452
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
416
453
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
417
454
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
418
455
|
},
|
|
419
456
|
contentType: "application/json",
|
|
420
|
-
|
|
421
|
-
|
|
457
|
+
requestType: "json",
|
|
458
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
459
|
+
responseType: "sse",
|
|
422
460
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
423
461
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
424
462
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -427,7 +465,7 @@ export class Conversation {
|
|
|
427
465
|
return new core.Stream({
|
|
428
466
|
stream: _response.body,
|
|
429
467
|
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
430
|
-
return
|
|
468
|
+
return serializers.StreamResponse.parseOrThrow(data, {
|
|
431
469
|
unrecognizedObjectKeys: "passthrough",
|
|
432
470
|
allowUnrecognizedUnionMembers: true,
|
|
433
471
|
allowUnrecognizedEnumValues: true,
|
|
@@ -444,21 +482,21 @@ export class Conversation {
|
|
|
444
482
|
if (_response.error.reason === "status-code") {
|
|
445
483
|
switch (_response.error.statusCode) {
|
|
446
484
|
case 404:
|
|
447
|
-
throw new MavenAGI.NotFoundError(
|
|
485
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
448
486
|
unrecognizedObjectKeys: "passthrough",
|
|
449
487
|
allowUnrecognizedUnionMembers: true,
|
|
450
488
|
allowUnrecognizedEnumValues: true,
|
|
451
489
|
breadcrumbsPrefix: ["response"],
|
|
452
490
|
}));
|
|
453
491
|
case 400:
|
|
454
|
-
throw new MavenAGI.BadRequestError(
|
|
492
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
455
493
|
unrecognizedObjectKeys: "passthrough",
|
|
456
494
|
allowUnrecognizedUnionMembers: true,
|
|
457
495
|
allowUnrecognizedEnumValues: true,
|
|
458
496
|
breadcrumbsPrefix: ["response"],
|
|
459
497
|
}));
|
|
460
498
|
case 500:
|
|
461
|
-
throw new MavenAGI.ServerError(
|
|
499
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
462
500
|
unrecognizedObjectKeys: "passthrough",
|
|
463
501
|
allowUnrecognizedUnionMembers: true,
|
|
464
502
|
allowUnrecognizedEnumValues: true,
|
|
@@ -499,7 +537,9 @@ export class Conversation {
|
|
|
499
537
|
*
|
|
500
538
|
* @example
|
|
501
539
|
* await client.conversation.generateMavenSuggestions("string", {
|
|
502
|
-
*
|
|
540
|
+
* conversationMessageIds: [{
|
|
541
|
+
* referenceId: "string"
|
|
542
|
+
* }]
|
|
503
543
|
* })
|
|
504
544
|
*/
|
|
505
545
|
generateMavenSuggestions(conversationId, request, requestOptions) {
|
|
@@ -514,20 +554,109 @@ export class Conversation {
|
|
|
514
554
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
515
555
|
"X-Fern-Language": "JavaScript",
|
|
516
556
|
"X-Fern-SDK-Name": "mavenagi",
|
|
517
|
-
"X-Fern-SDK-Version": "
|
|
557
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
558
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
518
559
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
519
560
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
520
561
|
},
|
|
521
562
|
contentType: "application/json",
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
563
|
+
requestType: "json",
|
|
564
|
+
body: serializers.GenerateMavenSuggestionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
565
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
566
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
567
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
568
|
+
});
|
|
569
|
+
if (_response.ok) {
|
|
570
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
571
|
+
unrecognizedObjectKeys: "passthrough",
|
|
572
|
+
allowUnrecognizedUnionMembers: true,
|
|
573
|
+
allowUnrecognizedEnumValues: true,
|
|
574
|
+
breadcrumbsPrefix: ["response"],
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
if (_response.error.reason === "status-code") {
|
|
578
|
+
switch (_response.error.statusCode) {
|
|
579
|
+
case 404:
|
|
580
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
581
|
+
unrecognizedObjectKeys: "passthrough",
|
|
582
|
+
allowUnrecognizedUnionMembers: true,
|
|
583
|
+
allowUnrecognizedEnumValues: true,
|
|
584
|
+
breadcrumbsPrefix: ["response"],
|
|
585
|
+
}));
|
|
586
|
+
case 400:
|
|
587
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
588
|
+
unrecognizedObjectKeys: "passthrough",
|
|
589
|
+
allowUnrecognizedUnionMembers: true,
|
|
590
|
+
allowUnrecognizedEnumValues: true,
|
|
591
|
+
breadcrumbsPrefix: ["response"],
|
|
592
|
+
}));
|
|
593
|
+
case 500:
|
|
594
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
595
|
+
unrecognizedObjectKeys: "passthrough",
|
|
596
|
+
allowUnrecognizedUnionMembers: true,
|
|
597
|
+
allowUnrecognizedEnumValues: true,
|
|
598
|
+
breadcrumbsPrefix: ["response"],
|
|
599
|
+
}));
|
|
600
|
+
default:
|
|
601
|
+
throw new errors.MavenAGIError({
|
|
602
|
+
statusCode: _response.error.statusCode,
|
|
603
|
+
body: _response.error.body,
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
switch (_response.error.reason) {
|
|
608
|
+
case "non-json":
|
|
609
|
+
throw new errors.MavenAGIError({
|
|
610
|
+
statusCode: _response.error.statusCode,
|
|
611
|
+
body: _response.error.rawBody,
|
|
612
|
+
});
|
|
613
|
+
case "timeout":
|
|
614
|
+
throw new errors.MavenAGITimeoutError();
|
|
615
|
+
case "unknown":
|
|
616
|
+
throw new errors.MavenAGIError({
|
|
617
|
+
message: _response.error.errorMessage,
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Uses an LLM flow to categorize the conversation. Experimental.
|
|
624
|
+
*
|
|
625
|
+
* @param {string} conversationId - The ID of the conversation to categorize
|
|
626
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
627
|
+
*
|
|
628
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
629
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
630
|
+
* @throws {@link MavenAGI.ServerError}
|
|
631
|
+
*
|
|
632
|
+
* @example
|
|
633
|
+
* await client.conversation.categorize("string")
|
|
634
|
+
*/
|
|
635
|
+
categorize(conversationId, requestOptions) {
|
|
636
|
+
var _a, _b;
|
|
637
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
638
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
639
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/categorize`),
|
|
640
|
+
method: "POST",
|
|
641
|
+
headers: {
|
|
642
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
643
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
644
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
645
|
+
"X-Fern-Language": "JavaScript",
|
|
646
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
647
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
648
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
649
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
650
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
651
|
+
},
|
|
652
|
+
contentType: "application/json",
|
|
653
|
+
requestType: "json",
|
|
525
654
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
526
655
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
527
656
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
528
657
|
});
|
|
529
658
|
if (_response.ok) {
|
|
530
|
-
return
|
|
659
|
+
return serializers.CategorizationResponse.parseOrThrow(_response.body, {
|
|
531
660
|
unrecognizedObjectKeys: "passthrough",
|
|
532
661
|
allowUnrecognizedUnionMembers: true,
|
|
533
662
|
allowUnrecognizedEnumValues: true,
|
|
@@ -537,21 +666,21 @@ export class Conversation {
|
|
|
537
666
|
if (_response.error.reason === "status-code") {
|
|
538
667
|
switch (_response.error.statusCode) {
|
|
539
668
|
case 404:
|
|
540
|
-
throw new MavenAGI.NotFoundError(
|
|
669
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
541
670
|
unrecognizedObjectKeys: "passthrough",
|
|
542
671
|
allowUnrecognizedUnionMembers: true,
|
|
543
672
|
allowUnrecognizedEnumValues: true,
|
|
544
673
|
breadcrumbsPrefix: ["response"],
|
|
545
674
|
}));
|
|
546
675
|
case 400:
|
|
547
|
-
throw new MavenAGI.BadRequestError(
|
|
676
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
548
677
|
unrecognizedObjectKeys: "passthrough",
|
|
549
678
|
allowUnrecognizedUnionMembers: true,
|
|
550
679
|
allowUnrecognizedEnumValues: true,
|
|
551
680
|
breadcrumbsPrefix: ["response"],
|
|
552
681
|
}));
|
|
553
682
|
case 500:
|
|
554
|
-
throw new MavenAGI.ServerError(
|
|
683
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
555
684
|
unrecognizedObjectKeys: "passthrough",
|
|
556
685
|
allowUnrecognizedUnionMembers: true,
|
|
557
686
|
allowUnrecognizedEnumValues: true,
|
|
@@ -580,7 +709,7 @@ export class Conversation {
|
|
|
580
709
|
});
|
|
581
710
|
}
|
|
582
711
|
/**
|
|
583
|
-
*
|
|
712
|
+
* Update feedback or create it if it doesn't exist
|
|
584
713
|
*
|
|
585
714
|
* @param {MavenAGI.FeedbackRequest} request
|
|
586
715
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -591,11 +720,17 @@ export class Conversation {
|
|
|
591
720
|
*
|
|
592
721
|
* @example
|
|
593
722
|
* await client.conversation.createFeedback({
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
*
|
|
723
|
+
* feedbackId: {
|
|
724
|
+
* referenceId: "feedback-0"
|
|
725
|
+
* },
|
|
726
|
+
* conversationId: {
|
|
727
|
+
* referenceId: "conversation-0"
|
|
728
|
+
* },
|
|
729
|
+
* conversationMessageId: {
|
|
730
|
+
* referenceId: "message-1"
|
|
731
|
+
* },
|
|
732
|
+
* type: "THUMBS_UP",
|
|
733
|
+
* text: "Great answer!"
|
|
599
734
|
* })
|
|
600
735
|
*/
|
|
601
736
|
createFeedback(request, requestOptions) {
|
|
@@ -610,37 +745,44 @@ export class Conversation {
|
|
|
610
745
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
611
746
|
"X-Fern-Language": "JavaScript",
|
|
612
747
|
"X-Fern-SDK-Name": "mavenagi",
|
|
613
|
-
"X-Fern-SDK-Version": "
|
|
748
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
749
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
614
750
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
615
751
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
616
752
|
},
|
|
617
753
|
contentType: "application/json",
|
|
618
|
-
|
|
754
|
+
requestType: "json",
|
|
755
|
+
body: serializers.FeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
619
756
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
620
757
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
621
758
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
622
759
|
});
|
|
623
760
|
if (_response.ok) {
|
|
624
|
-
return
|
|
761
|
+
return serializers.Feedback.parseOrThrow(_response.body, {
|
|
762
|
+
unrecognizedObjectKeys: "passthrough",
|
|
763
|
+
allowUnrecognizedUnionMembers: true,
|
|
764
|
+
allowUnrecognizedEnumValues: true,
|
|
765
|
+
breadcrumbsPrefix: ["response"],
|
|
766
|
+
});
|
|
625
767
|
}
|
|
626
768
|
if (_response.error.reason === "status-code") {
|
|
627
769
|
switch (_response.error.statusCode) {
|
|
628
770
|
case 404:
|
|
629
|
-
throw new MavenAGI.NotFoundError(
|
|
771
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
630
772
|
unrecognizedObjectKeys: "passthrough",
|
|
631
773
|
allowUnrecognizedUnionMembers: true,
|
|
632
774
|
allowUnrecognizedEnumValues: true,
|
|
633
775
|
breadcrumbsPrefix: ["response"],
|
|
634
776
|
}));
|
|
635
777
|
case 400:
|
|
636
|
-
throw new MavenAGI.BadRequestError(
|
|
778
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
637
779
|
unrecognizedObjectKeys: "passthrough",
|
|
638
780
|
allowUnrecognizedUnionMembers: true,
|
|
639
781
|
allowUnrecognizedEnumValues: true,
|
|
640
782
|
breadcrumbsPrefix: ["response"],
|
|
641
783
|
}));
|
|
642
784
|
case 500:
|
|
643
|
-
throw new MavenAGI.ServerError(
|
|
785
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
644
786
|
unrecognizedObjectKeys: "passthrough",
|
|
645
787
|
allowUnrecognizedUnionMembers: true,
|
|
646
788
|
allowUnrecognizedEnumValues: true,
|
|
@@ -682,16 +824,6 @@ export class Conversation {
|
|
|
682
824
|
* @example
|
|
683
825
|
* await client.conversation.submitActionForm("string", {
|
|
684
826
|
* actionFormId: "string",
|
|
685
|
-
* userContext: {
|
|
686
|
-
* name: "string",
|
|
687
|
-
* id: {
|
|
688
|
-
* "string": "string"
|
|
689
|
-
* },
|
|
690
|
-
* email: "string",
|
|
691
|
-
* context: {
|
|
692
|
-
* "string": "string"
|
|
693
|
-
* }
|
|
694
|
-
* },
|
|
695
827
|
* parameters: {
|
|
696
828
|
* "string": {
|
|
697
829
|
* "key": "value"
|
|
@@ -711,18 +843,20 @@ export class Conversation {
|
|
|
711
843
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
712
844
|
"X-Fern-Language": "JavaScript",
|
|
713
845
|
"X-Fern-SDK-Name": "mavenagi",
|
|
714
|
-
"X-Fern-SDK-Version": "
|
|
846
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
847
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
715
848
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
716
849
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
717
850
|
},
|
|
718
851
|
contentType: "application/json",
|
|
719
|
-
|
|
852
|
+
requestType: "json",
|
|
853
|
+
body: serializers.SubmitActionFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
720
854
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
721
855
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
722
856
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
723
857
|
});
|
|
724
858
|
if (_response.ok) {
|
|
725
|
-
return
|
|
859
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
726
860
|
unrecognizedObjectKeys: "passthrough",
|
|
727
861
|
allowUnrecognizedUnionMembers: true,
|
|
728
862
|
allowUnrecognizedEnumValues: true,
|
|
@@ -732,21 +866,21 @@ export class Conversation {
|
|
|
732
866
|
if (_response.error.reason === "status-code") {
|
|
733
867
|
switch (_response.error.statusCode) {
|
|
734
868
|
case 404:
|
|
735
|
-
throw new MavenAGI.NotFoundError(
|
|
869
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
736
870
|
unrecognizedObjectKeys: "passthrough",
|
|
737
871
|
allowUnrecognizedUnionMembers: true,
|
|
738
872
|
allowUnrecognizedEnumValues: true,
|
|
739
873
|
breadcrumbsPrefix: ["response"],
|
|
740
874
|
}));
|
|
741
875
|
case 400:
|
|
742
|
-
throw new MavenAGI.BadRequestError(
|
|
876
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
743
877
|
unrecognizedObjectKeys: "passthrough",
|
|
744
878
|
allowUnrecognizedUnionMembers: true,
|
|
745
879
|
allowUnrecognizedEnumValues: true,
|
|
746
880
|
breadcrumbsPrefix: ["response"],
|
|
747
881
|
}));
|
|
748
882
|
case 500:
|
|
749
|
-
throw new MavenAGI.ServerError(
|
|
883
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
750
884
|
unrecognizedObjectKeys: "passthrough",
|
|
751
885
|
allowUnrecognizedUnionMembers: true,
|
|
752
886
|
allowUnrecognizedEnumValues: true,
|
|
@@ -775,7 +909,7 @@ export class Conversation {
|
|
|
775
909
|
});
|
|
776
910
|
}
|
|
777
911
|
/**
|
|
778
|
-
* Add metadata to an existing conversation
|
|
912
|
+
* Add metadata to an existing conversation. If a metadata field already exists, it will be overwritten.
|
|
779
913
|
*
|
|
780
914
|
* @param {string} conversationId - The ID of a conversation the metadata being added belongs to
|
|
781
915
|
* @param {Record<string, string>} request
|
|
@@ -802,12 +936,14 @@ export class Conversation {
|
|
|
802
936
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
803
937
|
"X-Fern-Language": "JavaScript",
|
|
804
938
|
"X-Fern-SDK-Name": "mavenagi",
|
|
805
|
-
"X-Fern-SDK-Version": "
|
|
939
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
940
|
+
"User-Agent": "mavenagi/1.0.0",
|
|
806
941
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
807
942
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
808
943
|
},
|
|
809
944
|
contentType: "application/json",
|
|
810
|
-
|
|
945
|
+
requestType: "json",
|
|
946
|
+
body: serializers.conversation.addConversationMetadata.Request.jsonOrThrow(request, {
|
|
811
947
|
unrecognizedObjectKeys: "strip",
|
|
812
948
|
}),
|
|
813
949
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -815,7 +951,7 @@ export class Conversation {
|
|
|
815
951
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
816
952
|
});
|
|
817
953
|
if (_response.ok) {
|
|
818
|
-
return
|
|
954
|
+
return serializers.conversation.addConversationMetadata.Response.parseOrThrow(_response.body, {
|
|
819
955
|
unrecognizedObjectKeys: "passthrough",
|
|
820
956
|
allowUnrecognizedUnionMembers: true,
|
|
821
957
|
allowUnrecognizedEnumValues: true,
|
|
@@ -825,21 +961,21 @@ export class Conversation {
|
|
|
825
961
|
if (_response.error.reason === "status-code") {
|
|
826
962
|
switch (_response.error.statusCode) {
|
|
827
963
|
case 404:
|
|
828
|
-
throw new MavenAGI.NotFoundError(
|
|
964
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
829
965
|
unrecognizedObjectKeys: "passthrough",
|
|
830
966
|
allowUnrecognizedUnionMembers: true,
|
|
831
967
|
allowUnrecognizedEnumValues: true,
|
|
832
968
|
breadcrumbsPrefix: ["response"],
|
|
833
969
|
}));
|
|
834
970
|
case 400:
|
|
835
|
-
throw new MavenAGI.BadRequestError(
|
|
971
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
836
972
|
unrecognizedObjectKeys: "passthrough",
|
|
837
973
|
allowUnrecognizedUnionMembers: true,
|
|
838
974
|
allowUnrecognizedEnumValues: true,
|
|
839
975
|
breadcrumbsPrefix: ["response"],
|
|
840
976
|
}));
|
|
841
977
|
case 500:
|
|
842
|
-
throw new MavenAGI.ServerError(
|
|
978
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
843
979
|
unrecognizedObjectKeys: "passthrough",
|
|
844
980
|
allowUnrecognizedUnionMembers: true,
|
|
845
981
|
allowUnrecognizedEnumValues: true,
|