@credal/sdk 0.0.24 → 0.0.25
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 +10 -6
- package/api/resources/common/types/Operator.d.ts +1 -1
- package/api/resources/common/types/ResourceIdentifier.d.ts +1 -1
- package/api/resources/common/types/ResourceType.d.ts +1 -1
- package/api/resources/common/types/Role.d.ts +1 -1
- package/api/resources/copilots/client/Client.d.ts +4 -0
- package/api/resources/copilots/client/Client.js +55 -117
- package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +2 -8
- package/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +2 -8
- package/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +3 -12
- package/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +4 -16
- package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +2 -8
- package/api/resources/copilots/client/requests/SendMessageRequest.d.ts +5 -20
- package/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +19 -20
- package/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +1 -4
- package/api/resources/copilots/types/ErrorChunk.d.ts +7 -0
- package/api/resources/copilots/types/ErrorChunk.js +5 -0
- package/api/resources/copilots/types/ErrorChunkData.d.ts +6 -0
- package/api/resources/copilots/types/ErrorChunkData.js +5 -0
- package/api/resources/copilots/types/FeedbackEnum.d.ts +1 -1
- package/api/resources/copilots/types/Filter.d.ts +1 -1
- package/api/resources/copilots/types/SendMessageResponse.d.ts +3 -5
- package/api/resources/copilots/types/StreamingChunk.d.ts +4 -1
- package/api/resources/copilots/types/index.d.ts +2 -0
- package/api/resources/copilots/types/index.js +2 -0
- package/api/resources/documentCatalog/client/Client.d.ts +4 -0
- package/api/resources/documentCatalog/client/Client.js +31 -45
- package/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +10 -40
- package/api/resources/documentCollections/client/Client.d.ts +4 -0
- package/api/resources/documentCollections/client/Client.js +43 -81
- package/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -4
- package/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +3 -12
- package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +1 -4
- package/api/resources/index.js +17 -7
- package/api/resources/permissionsService/client/Client.d.ts +4 -0
- package/api/resources/permissionsService/client/Client.js +31 -45
- package/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +3 -12
- package/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +3 -12
- package/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +4 -16
- package/api/resources/permissionsService/types/Action.d.ts +1 -1
- package/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +1 -1
- package/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +1 -1
- package/api/resources/permissionsService/types/Principal.d.ts +1 -1
- package/api/resources/search/client/Client.d.ts +4 -0
- package/api/resources/search/client/Client.js +23 -21
- package/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +3 -12
- package/api/resources/users/client/Client.d.ts +4 -0
- package/api/resources/users/client/Client.js +23 -21
- package/core/auth/BearerToken.d.ts +1 -1
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +2 -2
- package/core/fetcher/Fetcher.js +6 -5
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/createRequestUrl.js +1 -2
- package/core/fetcher/getFetchFn.js +18 -9
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.js +5 -5
- package/core/fetcher/getResponseBody.js +1 -2
- package/core/fetcher/makeRequest.d.ts +1 -1
- package/core/fetcher/requestWithRetries.js +4 -5
- package/core/fetcher/signals.d.ts +0 -1
- package/core/fetcher/signals.js +2 -3
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/core/index.js +17 -7
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/runtime.d.ts +1 -1
- package/core/runtime/runtime.js +51 -41
- package/core/schemas/Schema.d.ts +7 -5
- package/core/schemas/Schema.js +2 -0
- package/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/core/schemas/builders/bigint/bigint.js +22 -19
- package/core/schemas/builders/date/date.js +1 -2
- package/core/schemas/builders/enum/enum.js +1 -2
- package/core/schemas/builders/lazy/lazy.d.ts +1 -1
- package/core/schemas/builders/lazy/lazy.js +3 -4
- package/core/schemas/builders/lazy/lazyObject.js +1 -2
- package/core/schemas/builders/list/list.js +1 -2
- package/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/core/schemas/builders/object/object.d.ts +1 -1
- package/core/schemas/builders/object/object.js +31 -3
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/core/schemas/builders/object/property.js +2 -3
- package/core/schemas/builders/object/types.d.ts +16 -11
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
- package/core/schemas/builders/object-like/types.d.ts +1 -1
- package/core/schemas/builders/record/record.js +2 -4
- package/core/schemas/builders/record/types.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +67 -4
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/core/schemas/builders/set/set.js +1 -2
- package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
- package/core/schemas/builders/union/discriminant.js +1 -2
- package/core/schemas/builders/union/types.d.ts +6 -6
- package/core/schemas/builders/union/union.d.ts +1 -1
- package/core/schemas/builders/union/union.js +1 -2
- package/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +4 -4
- package/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/core/schemas/utils/entries.d.ts +1 -1
- package/core/schemas/utils/entries.js +1 -2
- package/core/schemas/utils/filterObject.d.ts +1 -1
- package/core/schemas/utils/filterObject.js +1 -2
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
- package/core/schemas/utils/isPlainObject.js +1 -2
- package/core/schemas/utils/keys.d.ts +1 -1
- package/core/schemas/utils/keys.js +1 -2
- package/core/schemas/utils/maybeSkipValidation.js +1 -2
- package/core/schemas/utils/partition.js +1 -2
- package/core/streaming-fetcher/Stream.d.ts +0 -1
- package/core/streaming-fetcher/Stream.js +20 -21
- package/dist/Client.d.ts +10 -6
- package/dist/api/resources/common/types/Operator.d.ts +1 -1
- package/dist/api/resources/common/types/ResourceIdentifier.d.ts +1 -1
- package/dist/api/resources/common/types/ResourceType.d.ts +1 -1
- package/dist/api/resources/common/types/Role.d.ts +1 -1
- package/dist/api/resources/copilots/client/Client.d.ts +4 -0
- package/dist/api/resources/copilots/client/Client.js +55 -117
- package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +2 -8
- package/dist/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +2 -8
- package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +3 -12
- package/dist/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +4 -16
- package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +2 -8
- package/dist/api/resources/copilots/client/requests/SendMessageRequest.d.ts +5 -20
- package/dist/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +19 -20
- package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +1 -4
- package/dist/api/resources/copilots/types/ErrorChunk.d.ts +7 -0
- package/dist/api/resources/copilots/types/ErrorChunk.js +5 -0
- package/dist/api/resources/copilots/types/ErrorChunkData.d.ts +6 -0
- package/dist/api/resources/copilots/types/ErrorChunkData.js +5 -0
- package/dist/api/resources/copilots/types/FeedbackEnum.d.ts +1 -1
- package/dist/api/resources/copilots/types/Filter.d.ts +1 -1
- package/dist/api/resources/copilots/types/SendMessageResponse.d.ts +3 -5
- package/dist/api/resources/copilots/types/StreamingChunk.d.ts +4 -1
- package/dist/api/resources/copilots/types/index.d.ts +2 -0
- package/dist/api/resources/copilots/types/index.js +2 -0
- package/dist/api/resources/documentCatalog/client/Client.d.ts +4 -0
- package/dist/api/resources/documentCatalog/client/Client.js +31 -45
- package/dist/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +10 -40
- package/dist/api/resources/documentCollections/client/Client.d.ts +4 -0
- package/dist/api/resources/documentCollections/client/Client.js +43 -81
- package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -4
- package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +3 -12
- package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +1 -4
- package/dist/api/resources/index.js +17 -7
- package/dist/api/resources/permissionsService/client/Client.d.ts +4 -0
- package/dist/api/resources/permissionsService/client/Client.js +31 -45
- package/dist/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +3 -12
- package/dist/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +3 -12
- package/dist/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +4 -16
- package/dist/api/resources/permissionsService/types/Action.d.ts +1 -1
- package/dist/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +1 -1
- package/dist/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +1 -1
- package/dist/api/resources/permissionsService/types/Principal.d.ts +1 -1
- package/dist/api/resources/search/client/Client.d.ts +4 -0
- package/dist/api/resources/search/client/Client.js +23 -21
- package/dist/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +3 -12
- package/dist/api/resources/users/client/Client.d.ts +4 -0
- package/dist/api/resources/users/client/Client.js +23 -21
- package/dist/core/auth/BearerToken.d.ts +1 -1
- package/dist/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +2 -2
- package/dist/core/fetcher/Fetcher.js +6 -5
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.js +1 -2
- package/dist/core/fetcher/getFetchFn.js +18 -9
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.js +5 -5
- package/dist/core/fetcher/getResponseBody.js +1 -2
- package/dist/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/core/fetcher/requestWithRetries.js +4 -5
- package/dist/core/fetcher/signals.d.ts +0 -1
- package/dist/core/fetcher/signals.js +2 -3
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/dist/core/index.js +17 -7
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/runtime.d.ts +1 -1
- package/dist/core/runtime/runtime.js +51 -41
- package/dist/core/schemas/Schema.d.ts +7 -5
- package/dist/core/schemas/Schema.js +2 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/dist/core/schemas/builders/bigint/bigint.js +22 -19
- package/dist/core/schemas/builders/date/date.js +1 -2
- package/dist/core/schemas/builders/enum/enum.js +1 -2
- package/dist/core/schemas/builders/lazy/lazy.d.ts +1 -1
- package/dist/core/schemas/builders/lazy/lazy.js +3 -4
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -2
- package/dist/core/schemas/builders/list/list.js +1 -2
- package/dist/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/dist/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/dist/core/schemas/builders/object/object.d.ts +1 -1
- package/dist/core/schemas/builders/object/object.js +31 -3
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/dist/core/schemas/builders/object/property.js +2 -3
- package/dist/core/schemas/builders/object/types.d.ts +16 -11
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
- package/dist/core/schemas/builders/object-like/types.d.ts +1 -1
- package/dist/core/schemas/builders/record/record.js +2 -4
- package/dist/core/schemas/builders/record/types.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +67 -4
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/dist/core/schemas/builders/set/set.js +1 -2
- package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
- package/dist/core/schemas/builders/union/discriminant.js +1 -2
- package/dist/core/schemas/builders/union/types.d.ts +6 -6
- package/dist/core/schemas/builders/union/union.d.ts +1 -1
- package/dist/core/schemas/builders/union/union.js +1 -2
- package/dist/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +4 -4
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/dist/core/schemas/utils/entries.d.ts +1 -1
- package/dist/core/schemas/utils/entries.js +1 -2
- package/dist/core/schemas/utils/filterObject.d.ts +1 -1
- package/dist/core/schemas/utils/filterObject.js +1 -2
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
- package/dist/core/schemas/utils/isPlainObject.js +1 -2
- package/dist/core/schemas/utils/keys.d.ts +1 -1
- package/dist/core/schemas/utils/keys.js +1 -2
- package/dist/core/schemas/utils/maybeSkipValidation.js +1 -2
- package/dist/core/schemas/utils/partition.js +1 -2
- package/dist/core/streaming-fetcher/Stream.d.ts +0 -1
- package/dist/core/streaming-fetcher/Stream.js +20 -21
- package/dist/environments.d.ts +1 -1
- package/dist/errors/CredalError.js +2 -1
- package/dist/errors/CredalTimeoutError.d.ts +1 -1
- package/dist/errors/CredalTimeoutError.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -8
- package/dist/serialization/resources/common/types/Collaborator.js +17 -7
- package/dist/serialization/resources/common/types/ExternalResourceId.js +17 -7
- package/dist/serialization/resources/common/types/Operator.js +17 -7
- package/dist/serialization/resources/common/types/ResourceIdentifier.js +17 -7
- package/dist/serialization/resources/common/types/ResourceType.js +17 -7
- package/dist/serialization/resources/common/types/Role.js +17 -7
- package/dist/serialization/resources/common/types/Url.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/CreateConversationRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/ProvideMessageFeedbackRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/SendMessageRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/StreamMessageRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +17 -7
- package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.js +17 -7
- package/dist/serialization/resources/copilots/types/BlockedChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/BooleanFieldSchema.js +17 -7
- package/dist/serialization/resources/copilots/types/CollectionFilteredData.js +17 -7
- package/dist/serialization/resources/copilots/types/Configuration.js +17 -7
- package/dist/serialization/resources/copilots/types/CreateConversationResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/CreateCopilotResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/DataChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/DataFilter.js +17 -7
- package/dist/serialization/resources/copilots/types/DatetimeFieldSchema.js +17 -7
- package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/EndOfMessageChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/ErrorChunk.d.ts +13 -0
- package/dist/serialization/resources/copilots/types/ErrorChunk.js +44 -0
- package/dist/serialization/resources/copilots/types/ErrorChunkData.d.ts +12 -0
- package/dist/serialization/resources/copilots/types/ErrorChunkData.js +43 -0
- package/dist/serialization/resources/copilots/types/FeedbackEnum.js +17 -7
- package/dist/serialization/resources/copilots/types/Filter.js +17 -7
- package/dist/serialization/resources/copilots/types/FinalChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/InitialChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/InputVariable.js +17 -7
- package/dist/serialization/resources/copilots/types/InsertedAuditLog.js +17 -7
- package/dist/serialization/resources/copilots/types/MessageBlocked.js +17 -7
- package/dist/serialization/resources/copilots/types/MessageFeedback.js +17 -7
- package/dist/serialization/resources/copilots/types/MessageReply.js +17 -7
- package/dist/serialization/resources/copilots/types/NumberFieldSchema.js +17 -7
- package/dist/serialization/resources/copilots/types/PolicyTrigger.js +17 -7
- package/dist/serialization/resources/copilots/types/ReferencedSource.js +17 -7
- package/dist/serialization/resources/copilots/types/ResponseChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/SendAgentMessageResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/SendMessageResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/StreamingChunk.d.ts +5 -1
- package/dist/serialization/resources/copilots/types/StreamingChunk.js +19 -7
- package/dist/serialization/resources/copilots/types/StringFieldSchema.js +17 -7
- package/dist/serialization/resources/copilots/types/WebSearchResult.js +17 -7
- package/dist/serialization/resources/copilots/types/index.d.ts +2 -0
- package/dist/serialization/resources/copilots/types/index.js +2 -0
- package/dist/serialization/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/DocumentMetadataPatch.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/DocumentMetadataPatchRequest.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/SyncSourceByUrlRequest.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/SyncSourceByUrlResponse.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/UploadDocumentResponse.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.js +17 -7
- package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +17 -7
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +17 -7
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +17 -7
- package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +17 -7
- package/dist/serialization/resources/index.js +17 -7
- package/dist/serialization/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js +17 -7
- package/dist/serialization/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js +17 -7
- package/dist/serialization/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +17 -7
- package/dist/serialization/resources/permissionsService/types/Action.js +17 -7
- package/dist/serialization/resources/permissionsService/types/AuthorizedResource.js +17 -7
- package/dist/serialization/resources/permissionsService/types/AuthorizedResourceListPage.js +17 -7
- package/dist/serialization/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +17 -7
- package/dist/serialization/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +17 -7
- package/dist/serialization/resources/permissionsService/types/Group.js +17 -7
- package/dist/serialization/resources/permissionsService/types/Principal.js +17 -7
- package/dist/serialization/resources/permissionsService/types/PrincipalListPage.js +17 -7
- package/dist/serialization/resources/permissionsService/types/ResourceAuthorizationResult.js +17 -7
- package/dist/serialization/resources/permissionsService/types/User.js +17 -7
- package/dist/serialization/resources/search/client/requests/SearchDocumentCollectionRequest.js +17 -7
- package/dist/serialization/resources/search/types/DocumentCollectionSearchOptions.js +17 -7
- package/dist/serialization/resources/search/types/DocumentCollectionSearchResult.js +17 -7
- package/dist/serialization/resources/search/types/SearchDocumentCollectionResponse.js +17 -7
- package/dist/serialization/resources/search/types/SearchResultChunk.js +17 -7
- package/dist/serialization/resources/search/types/SingleFieldFilter.js +17 -7
- package/dist/serialization/resources/users/client/index.js +17 -7
- package/dist/serialization/resources/users/client/metadata.js +17 -7
- package/dist/serialization/resources/users/types/UserMetadataPatch.js +17 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/environments.d.ts +1 -1
- package/errors/CredalError.js +2 -1
- package/errors/CredalTimeoutError.d.ts +1 -1
- package/errors/CredalTimeoutError.js +2 -2
- package/index.d.ts +1 -0
- package/index.js +19 -8
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +16 -17
- package/scripts/rename-to-esm-files.js +115 -0
- package/serialization/resources/common/types/Collaborator.js +17 -7
- package/serialization/resources/common/types/ExternalResourceId.js +17 -7
- package/serialization/resources/common/types/Operator.js +17 -7
- package/serialization/resources/common/types/ResourceIdentifier.js +17 -7
- package/serialization/resources/common/types/ResourceType.js +17 -7
- package/serialization/resources/common/types/Role.js +17 -7
- package/serialization/resources/common/types/Url.js +17 -7
- package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/CreateConversationRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/ProvideMessageFeedbackRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/SendMessageRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/StreamMessageRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +17 -7
- package/serialization/resources/copilots/types/AiEndpointConfiguration.js +17 -7
- package/serialization/resources/copilots/types/BlockedChunk.js +17 -7
- package/serialization/resources/copilots/types/BooleanFieldSchema.js +17 -7
- package/serialization/resources/copilots/types/CollectionFilteredData.js +17 -7
- package/serialization/resources/copilots/types/Configuration.js +17 -7
- package/serialization/resources/copilots/types/CreateConversationResponse.js +17 -7
- package/serialization/resources/copilots/types/CreateCopilotResponse.js +17 -7
- package/serialization/resources/copilots/types/DataChunk.js +17 -7
- package/serialization/resources/copilots/types/DataFilter.js +17 -7
- package/serialization/resources/copilots/types/DatetimeFieldSchema.js +17 -7
- package/serialization/resources/copilots/types/DeleteCopilotResponse.js +17 -7
- package/serialization/resources/copilots/types/EndOfMessageChunk.js +17 -7
- package/serialization/resources/copilots/types/ErrorChunk.d.ts +13 -0
- package/serialization/resources/copilots/types/ErrorChunk.js +44 -0
- package/serialization/resources/copilots/types/ErrorChunkData.d.ts +12 -0
- package/serialization/resources/copilots/types/ErrorChunkData.js +43 -0
- package/serialization/resources/copilots/types/FeedbackEnum.js +17 -7
- package/serialization/resources/copilots/types/Filter.js +17 -7
- package/serialization/resources/copilots/types/FinalChunk.js +17 -7
- package/serialization/resources/copilots/types/InitialChunk.js +17 -7
- package/serialization/resources/copilots/types/InputVariable.js +17 -7
- package/serialization/resources/copilots/types/InsertedAuditLog.js +17 -7
- package/serialization/resources/copilots/types/MessageBlocked.js +17 -7
- package/serialization/resources/copilots/types/MessageFeedback.js +17 -7
- package/serialization/resources/copilots/types/MessageReply.js +17 -7
- package/serialization/resources/copilots/types/NumberFieldSchema.js +17 -7
- package/serialization/resources/copilots/types/PolicyTrigger.js +17 -7
- package/serialization/resources/copilots/types/ReferencedSource.js +17 -7
- package/serialization/resources/copilots/types/ResponseChunk.js +17 -7
- package/serialization/resources/copilots/types/SendAgentMessageResponse.js +17 -7
- package/serialization/resources/copilots/types/SendMessageResponse.js +17 -7
- package/serialization/resources/copilots/types/StreamingChunk.d.ts +5 -1
- package/serialization/resources/copilots/types/StreamingChunk.js +19 -7
- package/serialization/resources/copilots/types/StringFieldSchema.js +17 -7
- package/serialization/resources/copilots/types/WebSearchResult.js +17 -7
- package/serialization/resources/copilots/types/index.d.ts +2 -0
- package/serialization/resources/copilots/types/index.js +2 -0
- package/serialization/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.js +17 -7
- package/serialization/resources/documentCatalog/types/DocumentMetadataPatch.js +17 -7
- package/serialization/resources/documentCatalog/types/DocumentMetadataPatchRequest.js +17 -7
- package/serialization/resources/documentCatalog/types/SyncSourceByUrlRequest.js +17 -7
- package/serialization/resources/documentCatalog/types/SyncSourceByUrlResponse.js +17 -7
- package/serialization/resources/documentCatalog/types/UploadDocumentResponse.js +17 -7
- package/serialization/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +17 -7
- package/serialization/resources/documentCollections/types/CreateCollectionResponse.js +17 -7
- package/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +17 -7
- package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +17 -7
- package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +17 -7
- package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +17 -7
- package/serialization/resources/index.js +17 -7
- package/serialization/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js +17 -7
- package/serialization/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js +17 -7
- package/serialization/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +17 -7
- package/serialization/resources/permissionsService/types/Action.js +17 -7
- package/serialization/resources/permissionsService/types/AuthorizedResource.js +17 -7
- package/serialization/resources/permissionsService/types/AuthorizedResourceListPage.js +17 -7
- package/serialization/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +17 -7
- package/serialization/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +17 -7
- package/serialization/resources/permissionsService/types/Group.js +17 -7
- package/serialization/resources/permissionsService/types/Principal.js +17 -7
- package/serialization/resources/permissionsService/types/PrincipalListPage.js +17 -7
- package/serialization/resources/permissionsService/types/ResourceAuthorizationResult.js +17 -7
- package/serialization/resources/permissionsService/types/User.js +17 -7
- package/serialization/resources/search/client/requests/SearchDocumentCollectionRequest.js +17 -7
- package/serialization/resources/search/types/DocumentCollectionSearchOptions.js +17 -7
- package/serialization/resources/search/types/DocumentCollectionSearchResult.js +17 -7
- package/serialization/resources/search/types/SearchDocumentCollectionResponse.js +17 -7
- package/serialization/resources/search/types/SearchResultChunk.js +17 -7
- package/serialization/resources/search/types/SingleFieldFilter.js +17 -7
- package/serialization/resources/users/client/index.js +17 -7
- package/serialization/resources/users/client/metadata.js +17 -7
- package/serialization/resources/users/types/UserMetadataPatch.js +17 -7
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/Client.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { Users } from "./api/resources/users/client/Client";
|
|
|
12
12
|
export declare namespace CredalClient {
|
|
13
13
|
interface Options {
|
|
14
14
|
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
15
|
+
/** Specify a custom URL to connect the client to. */
|
|
16
|
+
baseUrl?: core.Supplier<string>;
|
|
15
17
|
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
16
18
|
fetcher?: core.FetchFunction;
|
|
17
19
|
}
|
|
@@ -22,21 +24,23 @@ export declare namespace CredalClient {
|
|
|
22
24
|
maxRetries?: number;
|
|
23
25
|
/** A hook to abort the request. */
|
|
24
26
|
abortSignal?: AbortSignal;
|
|
27
|
+
/** Additional headers to include in the request. */
|
|
28
|
+
headers?: Record<string, string>;
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
export declare class CredalClient {
|
|
28
32
|
protected readonly _options: CredalClient.Options;
|
|
29
|
-
constructor(_options?: CredalClient.Options);
|
|
30
33
|
protected _copilots: Copilots | undefined;
|
|
31
|
-
get copilots(): Copilots;
|
|
32
34
|
protected _documentCatalog: DocumentCatalog | undefined;
|
|
33
|
-
get documentCatalog(): DocumentCatalog;
|
|
34
35
|
protected _documentCollections: DocumentCollections | undefined;
|
|
35
|
-
get documentCollections(): DocumentCollections;
|
|
36
36
|
protected _permissionsService: PermissionsService | undefined;
|
|
37
|
-
get permissionsService(): PermissionsService;
|
|
38
37
|
protected _search: Search | undefined;
|
|
39
|
-
get search(): Search;
|
|
40
38
|
protected _users: Users | undefined;
|
|
39
|
+
constructor(_options?: CredalClient.Options);
|
|
40
|
+
get copilots(): Copilots;
|
|
41
|
+
get documentCatalog(): DocumentCatalog;
|
|
42
|
+
get documentCollections(): DocumentCollections;
|
|
43
|
+
get permissionsService(): PermissionsService;
|
|
44
|
+
get search(): Search;
|
|
41
45
|
get users(): Users;
|
|
42
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type Operator = "<" | ">" | "<=" | ">=" | "!=" | "==" | "contains";
|
|
5
5
|
export declare const Operator: {
|
|
6
6
|
readonly LessThan: "<";
|
|
7
7
|
readonly GreaterThan: ">";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Credal from "../../../index";
|
|
5
|
-
export
|
|
5
|
+
export type ResourceIdentifier = Credal.ResourceIdentifier.ExternalResourceId | Credal.ResourceIdentifier.Url;
|
|
6
6
|
export declare namespace ResourceIdentifier {
|
|
7
7
|
interface ExternalResourceId extends Credal.ExternalResourceId {
|
|
8
8
|
type: "external-resource-id";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type ResourceType = "GOOGLE_DRIVE_ITEM" | "MICROSOFT_DRIVE_ITEM" | "ZENDESK_TICKET" | "ZENDESK_ARTICLE" | "ZENDESK_GROUP" | "ZENDESK_ARTICLE_SECTION" | "ZENDESK_ARTICLE_CATEGORY" | "CONFLUENCE_PAGE" | "CONFLUENCE_SPACE" | "JIRA_TICKET" | "JIRA_PROJECT" | "SALESFORCE_TASK" | "BOX_FILE" | "BOX_FOLDER" | "NOTION_PAGE" | "NOTION_DATABASE" | "SLACK_CHANNEL" | "MONGO_COLLECTION_SYNC" | "UNKNOWN";
|
|
5
5
|
export declare const ResourceType: {
|
|
6
6
|
readonly GoogleDriveItem: "GOOGLE_DRIVE_ITEM";
|
|
7
7
|
readonly MicrosoftDriveItem: "MICROSOFT_DRIVE_ITEM";
|
|
@@ -7,6 +7,8 @@ import * as Credal from "../../../index";
|
|
|
7
7
|
export declare namespace Copilots {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
@@ -17,6 +19,8 @@ export declare namespace Copilots {
|
|
|
17
19
|
maxRetries?: number;
|
|
18
20
|
/** A hook to abort the request. */
|
|
19
21
|
abortSignal?: AbortSignal;
|
|
22
|
+
/** Additional headers to include in the request. */
|
|
23
|
+
headers?: Record<string, string>;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
export declare class Copilots {
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -65,20 +75,12 @@ class Copilots {
|
|
|
65
75
|
* })
|
|
66
76
|
*/
|
|
67
77
|
createCopilot(request, requestOptions) {
|
|
68
|
-
var _a, _b;
|
|
69
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
var _a, _b, _c;
|
|
70
80
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
81
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/createCopilot"),
|
|
72
82
|
method: "POST",
|
|
73
|
-
headers: {
|
|
74
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
75
|
-
"X-Fern-Language": "JavaScript",
|
|
76
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
77
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
78
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
79
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
80
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
81
|
-
},
|
|
83
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
84
|
contentType: "application/json",
|
|
83
85
|
requestType: "json",
|
|
84
86
|
body: serializers.CreateCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -107,7 +109,7 @@ class Copilots {
|
|
|
107
109
|
body: _response.error.rawBody,
|
|
108
110
|
});
|
|
109
111
|
case "timeout":
|
|
110
|
-
throw new errors.CredalTimeoutError();
|
|
112
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/createCopilot.");
|
|
111
113
|
case "unknown":
|
|
112
114
|
throw new errors.CredalError({
|
|
113
115
|
message: _response.error.errorMessage,
|
|
@@ -128,20 +130,12 @@ class Copilots {
|
|
|
128
130
|
* })
|
|
129
131
|
*/
|
|
130
132
|
createConversation(request, requestOptions) {
|
|
131
|
-
var _a, _b;
|
|
132
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
var _a, _b, _c;
|
|
133
135
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
134
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
136
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/createConversation"),
|
|
135
137
|
method: "POST",
|
|
136
|
-
headers: {
|
|
137
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
138
|
-
"X-Fern-Language": "JavaScript",
|
|
139
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
140
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
141
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
142
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
143
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
144
|
-
},
|
|
138
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
145
139
|
contentType: "application/json",
|
|
146
140
|
requestType: "json",
|
|
147
141
|
body: serializers.CreateConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -170,7 +164,7 @@ class Copilots {
|
|
|
170
164
|
body: _response.error.rawBody,
|
|
171
165
|
});
|
|
172
166
|
case "timeout":
|
|
173
|
-
throw new errors.CredalTimeoutError();
|
|
167
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/createConversation.");
|
|
174
168
|
case "unknown":
|
|
175
169
|
throw new errors.CredalError({
|
|
176
170
|
message: _response.error.errorMessage,
|
|
@@ -195,20 +189,12 @@ class Copilots {
|
|
|
195
189
|
* })
|
|
196
190
|
*/
|
|
197
191
|
provideMessageFeedback(request, requestOptions) {
|
|
198
|
-
var _a, _b;
|
|
199
192
|
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
var _a, _b, _c;
|
|
200
194
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
201
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
195
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/provideMessageFeedback"),
|
|
202
196
|
method: "POST",
|
|
203
|
-
headers: {
|
|
204
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
205
|
-
"X-Fern-Language": "JavaScript",
|
|
206
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
207
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
208
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
209
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
210
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
211
|
-
},
|
|
197
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
212
198
|
contentType: "application/json",
|
|
213
199
|
requestType: "json",
|
|
214
200
|
body: serializers.ProvideMessageFeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -232,7 +218,7 @@ class Copilots {
|
|
|
232
218
|
body: _response.error.rawBody,
|
|
233
219
|
});
|
|
234
220
|
case "timeout":
|
|
235
|
-
throw new errors.CredalTimeoutError();
|
|
221
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/provideMessageFeedback.");
|
|
236
222
|
case "unknown":
|
|
237
223
|
throw new errors.CredalError({
|
|
238
224
|
message: _response.error.errorMessage,
|
|
@@ -259,20 +245,12 @@ class Copilots {
|
|
|
259
245
|
* })
|
|
260
246
|
*/
|
|
261
247
|
sendMessage(request, requestOptions) {
|
|
262
|
-
var _a, _b;
|
|
263
248
|
return __awaiter(this, void 0, void 0, function* () {
|
|
249
|
+
var _a, _b, _c;
|
|
264
250
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
265
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
251
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/sendMessage"),
|
|
266
252
|
method: "POST",
|
|
267
|
-
headers: {
|
|
268
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
269
|
-
"X-Fern-Language": "JavaScript",
|
|
270
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
271
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
272
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
273
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
274
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
275
|
-
},
|
|
253
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
276
254
|
contentType: "application/json",
|
|
277
255
|
requestType: "json",
|
|
278
256
|
body: serializers.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -301,7 +279,7 @@ class Copilots {
|
|
|
301
279
|
body: _response.error.rawBody,
|
|
302
280
|
});
|
|
303
281
|
case "timeout":
|
|
304
|
-
throw new errors.CredalTimeoutError();
|
|
282
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/sendMessage.");
|
|
305
283
|
case "unknown":
|
|
306
284
|
throw new errors.CredalError({
|
|
307
285
|
message: _response.error.errorMessage,
|
|
@@ -313,20 +291,12 @@ class Copilots {
|
|
|
313
291
|
* This endpoint allows you to send a message to a specific copilot and get the response back as a streamed set of Server-Sent Events.
|
|
314
292
|
*/
|
|
315
293
|
streamMessage(request, requestOptions) {
|
|
316
|
-
var _a, _b;
|
|
317
294
|
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
var _a, _b, _c;
|
|
318
296
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
319
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
297
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/streamMessage"),
|
|
320
298
|
method: "POST",
|
|
321
|
-
headers: {
|
|
322
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
323
|
-
"X-Fern-Language": "JavaScript",
|
|
324
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
325
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
326
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
327
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
328
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
329
|
-
},
|
|
299
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
330
300
|
contentType: "application/json",
|
|
331
301
|
requestType: "json",
|
|
332
302
|
body: serializers.StreamMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -366,7 +336,7 @@ class Copilots {
|
|
|
366
336
|
body: _response.error.rawBody,
|
|
367
337
|
});
|
|
368
338
|
case "timeout":
|
|
369
|
-
throw new errors.CredalTimeoutError();
|
|
339
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/streamMessage.");
|
|
370
340
|
case "unknown":
|
|
371
341
|
throw new errors.CredalError({
|
|
372
342
|
message: _response.error.errorMessage,
|
|
@@ -387,20 +357,12 @@ class Copilots {
|
|
|
387
357
|
* })
|
|
388
358
|
*/
|
|
389
359
|
addCollectionToCopilot(request, requestOptions) {
|
|
390
|
-
var _a, _b;
|
|
391
360
|
return __awaiter(this, void 0, void 0, function* () {
|
|
361
|
+
var _a, _b, _c;
|
|
392
362
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
393
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
363
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/addCollectionToCopilot"),
|
|
394
364
|
method: "POST",
|
|
395
|
-
headers: {
|
|
396
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
397
|
-
"X-Fern-Language": "JavaScript",
|
|
398
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
399
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
400
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
401
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
402
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
403
|
-
},
|
|
365
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
404
366
|
contentType: "application/json",
|
|
405
367
|
requestType: "json",
|
|
406
368
|
body: serializers.AddCollectionToCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -424,7 +386,7 @@ class Copilots {
|
|
|
424
386
|
body: _response.error.rawBody,
|
|
425
387
|
});
|
|
426
388
|
case "timeout":
|
|
427
|
-
throw new errors.CredalTimeoutError();
|
|
389
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/addCollectionToCopilot.");
|
|
428
390
|
case "unknown":
|
|
429
391
|
throw new errors.CredalError({
|
|
430
392
|
message: _response.error.errorMessage,
|
|
@@ -445,20 +407,12 @@ class Copilots {
|
|
|
445
407
|
* })
|
|
446
408
|
*/
|
|
447
409
|
removeCollectionFromCopilot(request, requestOptions) {
|
|
448
|
-
var _a, _b;
|
|
449
410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
411
|
+
var _a, _b, _c;
|
|
450
412
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
451
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
413
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/removeCollectionFromCopilot"),
|
|
452
414
|
method: "POST",
|
|
453
|
-
headers: {
|
|
454
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
455
|
-
"X-Fern-Language": "JavaScript",
|
|
456
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
457
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
458
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
459
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
460
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
461
|
-
},
|
|
415
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
462
416
|
contentType: "application/json",
|
|
463
417
|
requestType: "json",
|
|
464
418
|
body: serializers.RemoveCollectionFromCopilotRequest.jsonOrThrow(request, {
|
|
@@ -484,7 +438,7 @@ class Copilots {
|
|
|
484
438
|
body: _response.error.rawBody,
|
|
485
439
|
});
|
|
486
440
|
case "timeout":
|
|
487
|
-
throw new errors.CredalTimeoutError();
|
|
441
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/removeCollectionFromCopilot.");
|
|
488
442
|
case "unknown":
|
|
489
443
|
throw new errors.CredalError({
|
|
490
444
|
message: _response.error.errorMessage,
|
|
@@ -513,20 +467,12 @@ class Copilots {
|
|
|
513
467
|
* })
|
|
514
468
|
*/
|
|
515
469
|
updateConfiguration(request, requestOptions) {
|
|
516
|
-
var _a, _b;
|
|
517
470
|
return __awaiter(this, void 0, void 0, function* () {
|
|
471
|
+
var _a, _b, _c;
|
|
518
472
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
519
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
473
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/updateConfiguration"),
|
|
520
474
|
method: "POST",
|
|
521
|
-
headers: {
|
|
522
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
523
|
-
"X-Fern-Language": "JavaScript",
|
|
524
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
525
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
526
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
527
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
528
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
529
|
-
},
|
|
475
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
530
476
|
contentType: "application/json",
|
|
531
477
|
requestType: "json",
|
|
532
478
|
body: serializers.UpdateConfigurationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -550,7 +496,7 @@ class Copilots {
|
|
|
550
496
|
body: _response.error.rawBody,
|
|
551
497
|
});
|
|
552
498
|
case "timeout":
|
|
553
|
-
throw new errors.CredalTimeoutError();
|
|
499
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/copilots/updateConfiguration.");
|
|
554
500
|
case "unknown":
|
|
555
501
|
throw new errors.CredalError({
|
|
556
502
|
message: _response.error.errorMessage,
|
|
@@ -568,20 +514,12 @@ class Copilots {
|
|
|
568
514
|
* })
|
|
569
515
|
*/
|
|
570
516
|
deleteCopilot(request, requestOptions) {
|
|
571
|
-
var _a, _b;
|
|
572
517
|
return __awaiter(this, void 0, void 0, function* () {
|
|
518
|
+
var _a, _b, _c;
|
|
573
519
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
574
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
520
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/copilots/deleteCopilot"),
|
|
575
521
|
method: "DELETE",
|
|
576
|
-
headers: {
|
|
577
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
578
|
-
"X-Fern-Language": "JavaScript",
|
|
579
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
580
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
581
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
582
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
583
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
584
|
-
},
|
|
522
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
585
523
|
contentType: "application/json",
|
|
586
524
|
requestType: "json",
|
|
587
525
|
body: serializers.DeleteCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -610,7 +548,7 @@ class Copilots {
|
|
|
610
548
|
body: _response.error.rawBody,
|
|
611
549
|
});
|
|
612
550
|
case "timeout":
|
|
613
|
-
throw new errors.CredalTimeoutError();
|
|
551
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling DELETE /v0/copilots/deleteCopilot.");
|
|
614
552
|
case "unknown":
|
|
615
553
|
throw new errors.CredalError({
|
|
616
554
|
message: _response.error.errorMessage,
|
|
@@ -619,12 +557,12 @@ class Copilots {
|
|
|
619
557
|
});
|
|
620
558
|
}
|
|
621
559
|
_getAuthorizationHeader() {
|
|
622
|
-
var _a;
|
|
623
560
|
return __awaiter(this, void 0, void 0, function* () {
|
|
561
|
+
var _a;
|
|
624
562
|
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["CREDAL_API_KEY"];
|
|
625
563
|
if (bearer == null) {
|
|
626
564
|
throw new errors.CredalError({
|
|
627
|
-
message: "Please specify
|
|
565
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
628
566
|
});
|
|
629
567
|
}
|
|
630
568
|
return `Bearer ${bearer}`;
|
|
@@ -9,14 +9,8 @@
|
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface AddCollectionToCopilotRequest {
|
|
12
|
-
/**
|
|
13
|
-
* Credal-generated copilot ID to add the collection to.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
12
|
+
/** Credal-generated copilot ID to add the collection to. */
|
|
16
13
|
copilotId: string;
|
|
17
|
-
/**
|
|
18
|
-
* Credal-generated collection ID to add.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
14
|
+
/** Credal-generated collection ID to add. */
|
|
21
15
|
collectionId: string;
|
|
22
16
|
}
|
|
@@ -9,14 +9,8 @@
|
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface CreateConversationRequest {
|
|
12
|
-
/**
|
|
13
|
-
* Credal-generated Copilot ID to specify which agent to route the request to.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
12
|
+
/** Credal-generated Copilot ID to specify which agent to route the request to. */
|
|
16
13
|
agentId: string;
|
|
17
|
-
/**
|
|
18
|
-
* End-user for the conversation.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
14
|
+
/** End-user for the conversation. */
|
|
21
15
|
userEmail: string;
|
|
22
16
|
}
|
|
@@ -14,19 +14,10 @@ import * as Credal from "../../../../index";
|
|
|
14
14
|
* }
|
|
15
15
|
*/
|
|
16
16
|
export interface CreateCopilotRequest {
|
|
17
|
-
/**
|
|
18
|
-
* A descriptive name for the copilot.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
17
|
+
/** A descriptive name for the copilot. */
|
|
21
18
|
name: string;
|
|
22
|
-
/**
|
|
23
|
-
* An in depth name for the copilot's function. Useful for routing requests to the right copilot.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
19
|
+
/** An in depth name for the copilot's function. Useful for routing requests to the right copilot. */
|
|
26
20
|
description: string;
|
|
27
|
-
/**
|
|
28
|
-
* A list of collaborator emails and roles that will have access to the copilot.
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
21
|
+
/** A list of collaborator emails and roles that will have access to the copilot. */
|
|
31
22
|
collaborators: Credal.Collaborator[];
|
|
32
23
|
}
|
|
@@ -16,24 +16,12 @@ import * as Credal from "../../../../index";
|
|
|
16
16
|
* }
|
|
17
17
|
*/
|
|
18
18
|
export interface ProvideMessageFeedbackRequest {
|
|
19
|
-
/**
|
|
20
|
-
* Credal-generated Copilot ID to specify which agent to route the request to.
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
19
|
+
/** Credal-generated Copilot ID to specify which agent to route the request to. */
|
|
23
20
|
agentId: string;
|
|
24
|
-
/**
|
|
25
|
-
* The user profile you want to use when providing feedback.
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
21
|
+
/** The user profile you want to use when providing feedback. */
|
|
28
22
|
userEmail: string;
|
|
29
|
-
/**
|
|
30
|
-
* The message ID for which feedback is being provided.
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
23
|
+
/** The message ID for which feedback is being provided. */
|
|
33
24
|
messageId: string;
|
|
34
|
-
/**
|
|
35
|
-
* The feedback provided by the user.
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
25
|
+
/** The feedback provided by the user. */
|
|
38
26
|
messageFeedback: Credal.MessageFeedback;
|
|
39
27
|
}
|
|
@@ -9,14 +9,8 @@
|
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface RemoveCollectionFromCopilotRequest {
|
|
12
|
-
/**
|
|
13
|
-
* Credal-generated copilot ID to add the collection to.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
12
|
+
/** Credal-generated copilot ID to add the collection to. */
|
|
16
13
|
copilotId: string;
|
|
17
|
-
/**
|
|
18
|
-
* Credal-generated collection ID to add.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
14
|
+
/** Credal-generated collection ID to add. */
|
|
21
15
|
collectionId: string;
|
|
22
16
|
}
|
|
@@ -18,29 +18,14 @@ import * as Credal from "../../../../index";
|
|
|
18
18
|
* }
|
|
19
19
|
*/
|
|
20
20
|
export interface SendMessageRequest {
|
|
21
|
-
/**
|
|
22
|
-
* Credal-generated Copilot ID to specify which agent to route the request to.
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
21
|
+
/** Credal-generated Copilot ID to specify which agent to route the request to. */
|
|
25
22
|
agentId: string;
|
|
26
|
-
/**
|
|
27
|
-
* The message you want to send to your copilot.
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
23
|
+
/** The message you want to send to your copilot. */
|
|
30
24
|
message: string;
|
|
31
|
-
/**
|
|
32
|
-
* The user profile you want to use when sending the message.
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
25
|
+
/** The user profile you want to use when sending the message. */
|
|
35
26
|
userEmail: string;
|
|
36
|
-
/**
|
|
37
|
-
* Credal-generated conversation ID for sending follow up messages. Conversation ID is returned after initial message. Optional, to be left off for first messages on new conversations.
|
|
38
|
-
*
|
|
39
|
-
*/
|
|
27
|
+
/** Credal-generated conversation ID for sending follow up messages. Conversation ID is returned after initial message. Optional, to be left off for first messages on new conversations. */
|
|
40
28
|
conversationId?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Optional input variables to be used in the message. Map the name of the variable to a list of urls.
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
29
|
+
/** Optional input variables to be used in the message. Map the name of the variable to a list of urls. */
|
|
45
30
|
inputVariables?: Credal.InputVariable[];
|
|
46
31
|
}
|
|
@@ -30,31 +30,30 @@ import * as Credal from "../../../../index";
|
|
|
30
30
|
* ids: ["82e4b12a-6990-45d4-8ebd-85c00e030c25", "82e4b12a-6990-45d4-8ebd-85c00e030c24"]
|
|
31
31
|
* }]
|
|
32
32
|
* }
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* {
|
|
36
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c25",
|
|
37
|
+
* message: "Is Credal SOC 2 compliant?",
|
|
38
|
+
* email: "ravin@credal.ai",
|
|
39
|
+
* inputVariables: [{
|
|
40
|
+
* name: "input1",
|
|
41
|
+
* ids: ["82e4b12a-6990-45d4-8ebd-85c00e030c24"]
|
|
42
|
+
* }, {
|
|
43
|
+
* name: "input2",
|
|
44
|
+
* ids: ["82e4b12a-6990-45d4-8ebd-85c00e030c25", "82e4b12a-6990-45d4-8ebd-85c00e030c26"]
|
|
45
|
+
* }]
|
|
46
|
+
* }
|
|
33
47
|
*/
|
|
34
48
|
export interface StreamMessageRequest {
|
|
35
|
-
/**
|
|
36
|
-
* Credal-generated Copilot ID to specify which agent to route the request to.
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
49
|
+
/** Credal-generated Copilot ID to specify which agent to route the request to. */
|
|
39
50
|
copilotId: string;
|
|
40
|
-
/**
|
|
41
|
-
* The message you want to send to your copilot.
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
51
|
+
/** The message you want to send to your copilot. */
|
|
44
52
|
message: string;
|
|
45
|
-
/**
|
|
46
|
-
* The user profile you want to use when sending the message.
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
53
|
+
/** The user profile you want to use when sending the message. */
|
|
49
54
|
email: string;
|
|
50
|
-
/**
|
|
51
|
-
* Credal-generated conversation ID for sending follow up messages. Conversation ID is returned after initial message. Optional, to be left off for first messages on new conversations.
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
55
|
+
/** Credal-generated conversation ID for sending follow up messages. Conversation ID is returned after initial message. Optional, to be left off for first messages on new conversations. */
|
|
54
56
|
conversationId?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Optional input variables to be used in the message. Map the name of the variable to a list of urls.
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
57
|
+
/** Optional input variables to be used in the message. Map the name of the variable to a list of urls. */
|
|
59
58
|
inputVariables?: Credal.InputVariable[];
|
|
60
59
|
}
|