@credal/sdk 0.0.24 → 0.0.26
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 +14 -10
- package/api/resources/copilots/client/Client.js +65 -127
- 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 +5 -14
- 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 +3 -6
- 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 +7 -3
- package/api/resources/documentCollections/client/Client.js +46 -84
- 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 +14 -10
- package/dist/api/resources/copilots/client/Client.js +65 -127
- 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 +5 -14
- 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 +3 -6
- 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 +7 -3
- package/dist/api/resources/documentCollections/client/Client.js +46 -84
- 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/reference.md +13 -13
- 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,21 +19,23 @@ 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 {
|
|
23
27
|
protected readonly _options: Copilots.Options;
|
|
24
28
|
constructor(_options?: Copilots.Options);
|
|
25
29
|
/**
|
|
26
|
-
* Create a new
|
|
30
|
+
* Create a new agent. The API key used will be added to the agent for future Requests
|
|
27
31
|
*
|
|
28
32
|
* @param {Credal.CreateCopilotRequest} request
|
|
29
33
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
34
|
*
|
|
31
35
|
* @example
|
|
32
36
|
* await client.copilots.createCopilot({
|
|
33
|
-
* name: "Customer
|
|
34
|
-
* description: "This
|
|
37
|
+
* name: "Customer Agent",
|
|
38
|
+
* description: "This agent is used to answer customer requests based on internal documentation.",
|
|
35
39
|
* collaborators: [{
|
|
36
40
|
* email: "test@gmail.com",
|
|
37
41
|
* role: "editor"
|
|
@@ -40,7 +44,7 @@ export declare class Copilots {
|
|
|
40
44
|
*/
|
|
41
45
|
createCopilot(request: Credal.CreateCopilotRequest, requestOptions?: Copilots.RequestOptions): Promise<Credal.CreateCopilotResponse>;
|
|
42
46
|
/**
|
|
43
|
-
* OPTIONAL. Create a new conversation with the
|
|
47
|
+
* OPTIONAL. Create a new conversation with the Agent. The conversation ID can be used in the `sendMessage` endpoint. The `sendMessage` endpoint automatically creates new conversations upon first request, but calling this endpoint can simplify certain use cases where it is helpful for the application to have the conversation ID before the first message is sent.
|
|
44
48
|
*
|
|
45
49
|
* @param {Credal.CreateConversationRequest} request
|
|
46
50
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -89,11 +93,11 @@ export declare class Copilots {
|
|
|
89
93
|
*/
|
|
90
94
|
sendMessage(request: Credal.SendMessageRequest, requestOptions?: Copilots.RequestOptions): Promise<Credal.SendAgentMessageResponse>;
|
|
91
95
|
/**
|
|
92
|
-
* This endpoint allows you to send a message to a specific
|
|
96
|
+
* This endpoint allows you to send a message to a specific agent and get the response back as a streamed set of Server-Sent Events.
|
|
93
97
|
*/
|
|
94
98
|
streamMessage(request: Credal.StreamMessageRequest, requestOptions?: Copilots.RequestOptions): Promise<core.Stream<Credal.StreamingChunk>>;
|
|
95
99
|
/**
|
|
96
|
-
* Link a collection with a
|
|
100
|
+
* Link a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
97
101
|
*
|
|
98
102
|
* @param {Credal.AddCollectionToCopilotRequest} request
|
|
99
103
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -106,7 +110,7 @@ export declare class Copilots {
|
|
|
106
110
|
*/
|
|
107
111
|
addCollectionToCopilot(request: Credal.AddCollectionToCopilotRequest, requestOptions?: Copilots.RequestOptions): Promise<void>;
|
|
108
112
|
/**
|
|
109
|
-
* Unlink a collection with a
|
|
113
|
+
* Unlink a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
110
114
|
*
|
|
111
115
|
* @param {Credal.RemoveCollectionFromCopilotRequest} request
|
|
112
116
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -119,7 +123,7 @@ export declare class Copilots {
|
|
|
119
123
|
*/
|
|
120
124
|
removeCollectionFromCopilot(request: Credal.RemoveCollectionFromCopilotRequest, requestOptions?: Copilots.RequestOptions): Promise<void>;
|
|
121
125
|
/**
|
|
122
|
-
* Update the configuration for a
|
|
126
|
+
* Update the configuration for a agent
|
|
123
127
|
*
|
|
124
128
|
* @param {Credal.UpdateConfigurationRequest} request
|
|
125
129
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -128,8 +132,8 @@ export declare class Copilots {
|
|
|
128
132
|
* await client.copilots.updateConfiguration({
|
|
129
133
|
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
130
134
|
* configuration: {
|
|
131
|
-
* name: "Customer
|
|
132
|
-
* description: "This
|
|
135
|
+
* name: "Customer Agent",
|
|
136
|
+
* description: "This agent is used to answer customer requests based on internal documentation.",
|
|
133
137
|
* prompt: "You are a polite, helpful assistant used to answer customer requests.",
|
|
134
138
|
* aiEndpointConfiguration: {
|
|
135
139
|
* baseUrl: "https://api.openai.com/v1/",
|
|
@@ -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) {
|
|
@@ -49,15 +59,15 @@ class Copilots {
|
|
|
49
59
|
this._options = _options;
|
|
50
60
|
}
|
|
51
61
|
/**
|
|
52
|
-
* Create a new
|
|
62
|
+
* Create a new agent. The API key used will be added to the agent for future Requests
|
|
53
63
|
*
|
|
54
64
|
* @param {Credal.CreateCopilotRequest} request
|
|
55
65
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
66
|
*
|
|
57
67
|
* @example
|
|
58
68
|
* await client.copilots.createCopilot({
|
|
59
|
-
* name: "Customer
|
|
60
|
-
* description: "This
|
|
69
|
+
* name: "Customer Agent",
|
|
70
|
+
* description: "This agent is used to answer customer requests based on internal documentation.",
|
|
61
71
|
* collaborators: [{
|
|
62
72
|
* email: "test@gmail.com",
|
|
63
73
|
* role: "editor"
|
|
@@ -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.26", "User-Agent": "@credal/sdk/0.0.26", "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,
|
|
@@ -116,7 +118,7 @@ class Copilots {
|
|
|
116
118
|
});
|
|
117
119
|
}
|
|
118
120
|
/**
|
|
119
|
-
* OPTIONAL. Create a new conversation with the
|
|
121
|
+
* OPTIONAL. Create a new conversation with the Agent. The conversation ID can be used in the `sendMessage` endpoint. The `sendMessage` endpoint automatically creates new conversations upon first request, but calling this endpoint can simplify certain use cases where it is helpful for the application to have the conversation ID before the first message is sent.
|
|
120
122
|
*
|
|
121
123
|
* @param {Credal.CreateConversationRequest} request
|
|
122
124
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -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.26", "User-Agent": "@credal/sdk/0.0.26", "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.26", "User-Agent": "@credal/sdk/0.0.26", "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.26", "User-Agent": "@credal/sdk/0.0.26", "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,
|
|
@@ -310,23 +288,15 @@ class Copilots {
|
|
|
310
288
|
});
|
|
311
289
|
}
|
|
312
290
|
/**
|
|
313
|
-
* This endpoint allows you to send a message to a specific
|
|
291
|
+
* This endpoint allows you to send a message to a specific agent 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.26", "User-Agent": "@credal/sdk/0.0.26", "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,
|
|
@@ -375,7 +345,7 @@ class Copilots {
|
|
|
375
345
|
});
|
|
376
346
|
}
|
|
377
347
|
/**
|
|
378
|
-
* Link a collection with a
|
|
348
|
+
* Link a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
379
349
|
*
|
|
380
350
|
* @param {Credal.AddCollectionToCopilotRequest} request
|
|
381
351
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -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.26", "User-Agent": "@credal/sdk/0.0.26", "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,
|
|
@@ -433,7 +395,7 @@ class Copilots {
|
|
|
433
395
|
});
|
|
434
396
|
}
|
|
435
397
|
/**
|
|
436
|
-
* Unlink a collection with a
|
|
398
|
+
* Unlink a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
437
399
|
*
|
|
438
400
|
* @param {Credal.RemoveCollectionFromCopilotRequest} request
|
|
439
401
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -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.26", "User-Agent": "@credal/sdk/0.0.26", "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,
|
|
@@ -493,7 +447,7 @@ class Copilots {
|
|
|
493
447
|
});
|
|
494
448
|
}
|
|
495
449
|
/**
|
|
496
|
-
* Update the configuration for a
|
|
450
|
+
* Update the configuration for a agent
|
|
497
451
|
*
|
|
498
452
|
* @param {Credal.UpdateConfigurationRequest} request
|
|
499
453
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -502,8 +456,8 @@ class Copilots {
|
|
|
502
456
|
* await client.copilots.updateConfiguration({
|
|
503
457
|
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
504
458
|
* configuration: {
|
|
505
|
-
* name: "Customer
|
|
506
|
-
* description: "This
|
|
459
|
+
* name: "Customer Agent",
|
|
460
|
+
* description: "This agent is used to answer customer requests based on internal documentation.",
|
|
507
461
|
* prompt: "You are a polite, helpful assistant used to answer customer requests.",
|
|
508
462
|
* aiEndpointConfiguration: {
|
|
509
463
|
* baseUrl: "https://api.openai.com/v1/",
|
|
@@ -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.26", "User-Agent": "@credal/sdk/0.0.26", "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.26", "User-Agent": "@credal/sdk/0.0.26", "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 Agent 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 Agent 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
|
}
|