@credal/sdk 0.0.10 → 0.0.12
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/api/resources/common/types/Collaborator.d.ts +8 -0
- package/api/resources/common/types/Collaborator.js +5 -0
- package/api/resources/common/types/Role.d.ts +8 -0
- package/api/resources/common/types/Role.js +10 -0
- package/api/resources/common/types/index.d.ts +2 -0
- package/api/resources/common/types/index.js +2 -0
- package/api/resources/copilots/client/Client.d.ts +75 -1
- package/api/resources/copilots/client/Client.js +309 -4
- package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +22 -0
- package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +5 -0
- package/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +1 -1
- package/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +32 -0
- package/api/resources/copilots/client/requests/CreateCopilotRequest.js +5 -0
- package/api/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +13 -0
- package/api/resources/copilots/client/requests/DeleteCopilotRequest.js +5 -0
- package/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
- package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +22 -0
- package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +5 -0
- package/api/resources/copilots/client/requests/SendMessageRequest.d.ts +1 -1
- package/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +27 -0
- package/api/resources/copilots/client/requests/UpdateConfigurationRequest.js +5 -0
- package/api/resources/copilots/client/requests/index.d.ts +5 -0
- package/api/resources/copilots/types/AiEndpointConfiguration.d.ts +7 -0
- package/api/resources/copilots/types/AiEndpointConfiguration.js +5 -0
- package/api/resources/copilots/types/Configuration.d.ts +10 -0
- package/api/resources/copilots/types/Configuration.js +5 -0
- package/api/resources/copilots/types/CreateCopilotResponse.d.ts +6 -0
- package/api/resources/copilots/types/CreateCopilotResponse.js +5 -0
- package/api/resources/copilots/types/DeleteCopilotResponse.d.ts +6 -0
- package/api/resources/copilots/types/DeleteCopilotResponse.js +5 -0
- package/api/resources/copilots/types/index.d.ts +4 -0
- package/api/resources/copilots/types/index.js +4 -0
- package/api/resources/documentCatalog/client/Client.js +2 -2
- package/api/resources/documentCollections/client/Client.d.ts +107 -1
- package/api/resources/documentCollections/client/Client.js +349 -2
- package/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -1
- package/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +32 -0
- package/api/resources/documentCollections/client/requests/CreateCollectionRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +31 -0
- package/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
- package/api/resources/documentCollections/client/requests/DeleteCollectionRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +28 -0
- package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +31 -0
- package/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/index.d.ts +5 -0
- package/api/resources/documentCollections/index.d.ts +1 -0
- package/api/resources/documentCollections/index.js +1 -0
- package/api/resources/documentCollections/types/CreateCollectionResponse.d.ts +6 -0
- package/api/resources/documentCollections/types/CreateCollectionResponse.js +5 -0
- package/api/resources/documentCollections/types/DeleteCollectionResponse.d.ts +6 -0
- package/api/resources/documentCollections/types/DeleteCollectionResponse.js +5 -0
- package/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +10 -0
- package/api/resources/documentCollections/types/MongoCollectionSyncConfig.js +5 -0
- package/api/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +8 -0
- package/api/resources/documentCollections/types/MongoCollectionSyncResponse.js +5 -0
- package/api/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +9 -0
- package/api/resources/documentCollections/types/MongoSourceFieldsConfig.js +5 -0
- package/api/resources/documentCollections/types/index.d.ts +5 -0
- package/api/resources/documentCollections/types/index.js +21 -0
- package/api/resources/index.d.ts +2 -1
- package/api/resources/index.js +3 -2
- package/api/resources/permissionsService/client/Client.js +3 -3
- package/api/resources/search/client/Client.js +1 -1
- package/api/resources/users/client/Client.js +1 -1
- package/dist/api/resources/common/types/Collaborator.d.ts +8 -0
- package/dist/api/resources/common/types/Collaborator.js +5 -0
- package/dist/api/resources/common/types/Role.d.ts +8 -0
- package/dist/api/resources/common/types/Role.js +10 -0
- package/dist/api/resources/common/types/index.d.ts +2 -0
- package/dist/api/resources/common/types/index.js +2 -0
- package/dist/api/resources/copilots/client/Client.d.ts +75 -1
- package/dist/api/resources/copilots/client/Client.js +309 -4
- package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +22 -0
- package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +1 -1
- package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +32 -0
- package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +13 -0
- package/dist/api/resources/copilots/client/requests/DeleteCopilotRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
- package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +22 -0
- package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/SendMessageRequest.d.ts +1 -1
- package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +27 -0
- package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/index.d.ts +5 -0
- package/dist/api/resources/copilots/types/AiEndpointConfiguration.d.ts +7 -0
- package/dist/api/resources/copilots/types/AiEndpointConfiguration.js +5 -0
- package/dist/api/resources/copilots/types/Configuration.d.ts +10 -0
- package/dist/api/resources/copilots/types/Configuration.js +5 -0
- package/dist/api/resources/copilots/types/CreateCopilotResponse.d.ts +6 -0
- package/dist/api/resources/copilots/types/CreateCopilotResponse.js +5 -0
- package/dist/api/resources/copilots/types/DeleteCopilotResponse.d.ts +6 -0
- package/dist/api/resources/copilots/types/DeleteCopilotResponse.js +5 -0
- package/dist/api/resources/copilots/types/index.d.ts +4 -0
- package/dist/api/resources/copilots/types/index.js +4 -0
- package/dist/api/resources/documentCatalog/client/Client.js +2 -2
- package/dist/api/resources/documentCollections/client/Client.d.ts +107 -1
- package/dist/api/resources/documentCollections/client/Client.js +349 -2
- package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -1
- package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +32 -0
- package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +31 -0
- package/dist/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
- package/dist/api/resources/documentCollections/client/requests/DeleteCollectionRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +28 -0
- package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +31 -0
- package/dist/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/index.d.ts +5 -0
- package/dist/api/resources/documentCollections/index.d.ts +1 -0
- package/dist/api/resources/documentCollections/index.js +1 -0
- package/dist/api/resources/documentCollections/types/CreateCollectionResponse.d.ts +6 -0
- package/dist/api/resources/documentCollections/types/CreateCollectionResponse.js +5 -0
- package/dist/api/resources/documentCollections/types/DeleteCollectionResponse.d.ts +6 -0
- package/dist/api/resources/documentCollections/types/DeleteCollectionResponse.js +5 -0
- package/dist/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +10 -0
- package/dist/api/resources/documentCollections/types/MongoCollectionSyncConfig.js +5 -0
- package/dist/api/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +8 -0
- package/dist/api/resources/documentCollections/types/MongoCollectionSyncResponse.js +5 -0
- package/dist/api/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +9 -0
- package/dist/api/resources/documentCollections/types/MongoSourceFieldsConfig.js +5 -0
- package/dist/api/resources/documentCollections/types/index.d.ts +5 -0
- package/dist/api/resources/documentCollections/types/index.js +21 -0
- package/dist/api/resources/index.d.ts +2 -1
- package/dist/api/resources/index.js +3 -2
- package/dist/api/resources/permissionsService/client/Client.js +3 -3
- package/dist/api/resources/search/client/Client.js +1 -1
- package/dist/api/resources/users/client/Client.js +1 -1
- package/dist/serialization/resources/common/types/Collaborator.d.ts +14 -0
- package/dist/serialization/resources/common/types/Collaborator.js +35 -0
- package/dist/serialization/resources/common/types/Role.d.ts +10 -0
- package/dist/serialization/resources/common/types/Role.js +34 -0
- package/dist/serialization/resources/common/types/index.d.ts +2 -0
- package/dist/serialization/resources/common/types/index.js +2 -0
- package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +13 -0
- package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +34 -0
- package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.d.ts +15 -0
- package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +36 -0
- package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +12 -0
- package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +33 -0
- package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +13 -0
- package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +34 -0
- package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +14 -0
- package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +35 -0
- package/dist/serialization/resources/copilots/client/requests/index.d.ts +5 -0
- package/dist/serialization/resources/copilots/client/requests/index.js +11 -1
- package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.d.ts +13 -0
- package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.js +34 -0
- package/dist/serialization/resources/copilots/types/Configuration.d.ts +16 -0
- package/dist/serialization/resources/copilots/types/Configuration.js +37 -0
- package/dist/serialization/resources/copilots/types/CreateCopilotResponse.d.ts +12 -0
- package/dist/serialization/resources/copilots/types/CreateCopilotResponse.js +33 -0
- package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.d.ts +12 -0
- package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.js +33 -0
- package/dist/serialization/resources/copilots/types/index.d.ts +4 -0
- package/dist/serialization/resources/copilots/types/index.js +4 -0
- package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +15 -0
- package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +36 -0
- package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +15 -0
- package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +36 -0
- package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
- package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +33 -0
- package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +14 -0
- package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +35 -0
- package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +15 -0
- package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +36 -0
- package/dist/serialization/resources/documentCollections/client/requests/index.d.ts +5 -0
- package/dist/serialization/resources/documentCollections/client/requests/index.js +11 -1
- package/dist/serialization/resources/documentCollections/index.d.ts +1 -0
- package/dist/serialization/resources/documentCollections/index.js +1 -0
- package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.d.ts +12 -0
- package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.js +33 -0
- package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.d.ts +12 -0
- package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +33 -0
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +16 -0
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +37 -0
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +14 -0
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +35 -0
- package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +15 -0
- package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +36 -0
- package/dist/serialization/resources/documentCollections/types/index.d.ts +5 -0
- package/dist/serialization/resources/documentCollections/types/index.js +21 -0
- package/dist/serialization/resources/index.d.ts +2 -1
- package/dist/serialization/resources/index.js +3 -2
- package/package.json +1 -1
- package/reference.md +959 -60
- package/serialization/resources/common/types/Collaborator.d.ts +14 -0
- package/serialization/resources/common/types/Collaborator.js +35 -0
- package/serialization/resources/common/types/Role.d.ts +10 -0
- package/serialization/resources/common/types/Role.js +34 -0
- package/serialization/resources/common/types/index.d.ts +2 -0
- package/serialization/resources/common/types/index.js +2 -0
- package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +13 -0
- package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +34 -0
- package/serialization/resources/copilots/client/requests/CreateCopilotRequest.d.ts +15 -0
- package/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +36 -0
- package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +12 -0
- package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +33 -0
- package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +13 -0
- package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +34 -0
- package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +14 -0
- package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +35 -0
- package/serialization/resources/copilots/client/requests/index.d.ts +5 -0
- package/serialization/resources/copilots/client/requests/index.js +11 -1
- package/serialization/resources/copilots/types/AiEndpointConfiguration.d.ts +13 -0
- package/serialization/resources/copilots/types/AiEndpointConfiguration.js +34 -0
- package/serialization/resources/copilots/types/Configuration.d.ts +16 -0
- package/serialization/resources/copilots/types/Configuration.js +37 -0
- package/serialization/resources/copilots/types/CreateCopilotResponse.d.ts +12 -0
- package/serialization/resources/copilots/types/CreateCopilotResponse.js +33 -0
- package/serialization/resources/copilots/types/DeleteCopilotResponse.d.ts +12 -0
- package/serialization/resources/copilots/types/DeleteCopilotResponse.js +33 -0
- package/serialization/resources/copilots/types/index.d.ts +4 -0
- package/serialization/resources/copilots/types/index.js +4 -0
- package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +15 -0
- package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +36 -0
- package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +15 -0
- package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +36 -0
- package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
- package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +33 -0
- package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +14 -0
- package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +35 -0
- package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +15 -0
- package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +36 -0
- package/serialization/resources/documentCollections/client/requests/index.d.ts +5 -0
- package/serialization/resources/documentCollections/client/requests/index.js +11 -1
- package/serialization/resources/documentCollections/index.d.ts +1 -0
- package/serialization/resources/documentCollections/index.js +1 -0
- package/serialization/resources/documentCollections/types/CreateCollectionResponse.d.ts +12 -0
- package/serialization/resources/documentCollections/types/CreateCollectionResponse.js +33 -0
- package/serialization/resources/documentCollections/types/DeleteCollectionResponse.d.ts +12 -0
- package/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +33 -0
- package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +16 -0
- package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +37 -0
- package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +14 -0
- package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +35 -0
- package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +15 -0
- package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +36 -0
- package/serialization/resources/documentCollections/types/index.d.ts +5 -0
- package/serialization/resources/documentCollections/types/index.js +21 -0
- package/serialization/resources/index.d.ts +2 -1
- package/serialization/resources/index.js +3 -2
|
@@ -18,3 +18,5 @@ __exportStar(require("./ResourceIdentifier"), exports);
|
|
|
18
18
|
__exportStar(require("./ExternalResourceId"), exports);
|
|
19
19
|
__exportStar(require("./Url"), exports);
|
|
20
20
|
__exportStar(require("./ResourceType"), exports);
|
|
21
|
+
__exportStar(require("./Collaborator"), exports);
|
|
22
|
+
__exportStar(require("./Role"), exports);
|
|
@@ -20,7 +20,24 @@ export declare class Copilots {
|
|
|
20
20
|
protected readonly _options: Copilots.Options;
|
|
21
21
|
constructor(_options?: Copilots.Options);
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Create a new copilot. The API key used will be added to the copilot for future Requests
|
|
24
|
+
*
|
|
25
|
+
* @param {Credal.CreateCopilotRequest} request
|
|
26
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await credal.copilots.createCopilot({
|
|
30
|
+
* name: "Customer Copilot",
|
|
31
|
+
* description: "This copilot is used to answer customer requests based on internal documentation.",
|
|
32
|
+
* collaborators: [{
|
|
33
|
+
* email: "test@gmail.com",
|
|
34
|
+
* role: Credal.Role.Editor
|
|
35
|
+
* }]
|
|
36
|
+
* })
|
|
37
|
+
*/
|
|
38
|
+
createCopilot(request: Credal.CreateCopilotRequest, requestOptions?: Copilots.RequestOptions): Promise<Credal.CreateCopilotResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* OPTIONAL. Create a new conversation with the Copilot. 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.
|
|
24
41
|
*
|
|
25
42
|
* @param {Credal.CreateConversationRequest} request
|
|
26
43
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -60,5 +77,62 @@ export declare class Copilots {
|
|
|
60
77
|
* })
|
|
61
78
|
*/
|
|
62
79
|
sendMessage(request: Credal.SendMessageRequest, requestOptions?: Copilots.RequestOptions): Promise<Credal.SendAgentMessageResponse>;
|
|
80
|
+
/**
|
|
81
|
+
* Link a collection with a copilot. The API Key used must be added to both the collection and the copilot beforehand.
|
|
82
|
+
*
|
|
83
|
+
* @param {Credal.AddCollectionToCopilotRequest} request
|
|
84
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await credal.copilots.addCollectionToCopilot({
|
|
88
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
89
|
+
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
90
|
+
* })
|
|
91
|
+
*/
|
|
92
|
+
addCollectionToCopilot(request: Credal.AddCollectionToCopilotRequest, requestOptions?: Copilots.RequestOptions): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Unlink a collection with a copilot. The API Key used must be added to both the collection and the copilot beforehand.
|
|
95
|
+
*
|
|
96
|
+
* @param {Credal.RemoveCollectionFromCopilotRequest} request
|
|
97
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* await credal.copilots.removeCollectionFromCopilot({
|
|
101
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
102
|
+
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
103
|
+
* })
|
|
104
|
+
*/
|
|
105
|
+
removeCollectionFromCopilot(request: Credal.RemoveCollectionFromCopilotRequest, requestOptions?: Copilots.RequestOptions): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Update the configuration for a copilot
|
|
108
|
+
*
|
|
109
|
+
* @param {Credal.UpdateConfigurationRequest} request
|
|
110
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await credal.copilots.updateConfiguration({
|
|
114
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
115
|
+
* configuration: {
|
|
116
|
+
* name: "Customer Copilot",
|
|
117
|
+
* description: "This copilot is used to answer customer requests based on internal documentation.",
|
|
118
|
+
* prompt: "You are a polite, helpful assistant used to answer customer requests.",
|
|
119
|
+
* aiEndpointConfiguration: {
|
|
120
|
+
* baseUrl: "https://api.openai.com/v1/",
|
|
121
|
+
* apiKey: "<YOUR_API_KEY_HERE>"
|
|
122
|
+
* }
|
|
123
|
+
* }
|
|
124
|
+
* })
|
|
125
|
+
*/
|
|
126
|
+
updateConfiguration(request: Credal.UpdateConfigurationRequest, requestOptions?: Copilots.RequestOptions): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* @param {Credal.DeleteCopilotRequest} request
|
|
129
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* await credal.copilots.deleteCopilot({
|
|
133
|
+
* id: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
|
|
134
|
+
* })
|
|
135
|
+
*/
|
|
136
|
+
deleteCopilot(request: Credal.DeleteCopilotRequest, requestOptions?: Copilots.RequestOptions): Promise<Credal.DeleteCopilotResponse>;
|
|
63
137
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
64
138
|
}
|
|
@@ -49,7 +49,72 @@ class Copilots {
|
|
|
49
49
|
this._options = _options;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Create a new copilot. The API key used will be added to the copilot for future Requests
|
|
53
|
+
*
|
|
54
|
+
* @param {Credal.CreateCopilotRequest} request
|
|
55
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await credal.copilots.createCopilot({
|
|
59
|
+
* name: "Customer Copilot",
|
|
60
|
+
* description: "This copilot is used to answer customer requests based on internal documentation.",
|
|
61
|
+
* collaborators: [{
|
|
62
|
+
* email: "test@gmail.com",
|
|
63
|
+
* role: Credal.Role.Editor
|
|
64
|
+
* }]
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
createCopilot(request, requestOptions) {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
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.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/createCopilot"),
|
|
72
|
+
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.12",
|
|
78
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
79
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
80
|
+
},
|
|
81
|
+
contentType: "application/json",
|
|
82
|
+
body: yield serializers.CreateCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
83
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
84
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
85
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
|
+
});
|
|
87
|
+
if (_response.ok) {
|
|
88
|
+
return yield serializers.CreateCopilotResponse.parseOrThrow(_response.body, {
|
|
89
|
+
unrecognizedObjectKeys: "passthrough",
|
|
90
|
+
allowUnrecognizedUnionMembers: true,
|
|
91
|
+
allowUnrecognizedEnumValues: true,
|
|
92
|
+
breadcrumbsPrefix: ["response"],
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (_response.error.reason === "status-code") {
|
|
96
|
+
throw new errors.CredalError({
|
|
97
|
+
statusCode: _response.error.statusCode,
|
|
98
|
+
body: _response.error.body,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
switch (_response.error.reason) {
|
|
102
|
+
case "non-json":
|
|
103
|
+
throw new errors.CredalError({
|
|
104
|
+
statusCode: _response.error.statusCode,
|
|
105
|
+
body: _response.error.rawBody,
|
|
106
|
+
});
|
|
107
|
+
case "timeout":
|
|
108
|
+
throw new errors.CredalTimeoutError();
|
|
109
|
+
case "unknown":
|
|
110
|
+
throw new errors.CredalError({
|
|
111
|
+
message: _response.error.errorMessage,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* OPTIONAL. Create a new conversation with the Copilot. 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.
|
|
53
118
|
*
|
|
54
119
|
* @param {Credal.CreateConversationRequest} request
|
|
55
120
|
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -70,7 +135,7 @@ class Copilots {
|
|
|
70
135
|
Authorization: yield this._getAuthorizationHeader(),
|
|
71
136
|
"X-Fern-Language": "JavaScript",
|
|
72
137
|
"X-Fern-SDK-Name": "@credal/sdk",
|
|
73
|
-
"X-Fern-SDK-Version": "0.0.
|
|
138
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
74
139
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
75
140
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
76
141
|
},
|
|
@@ -134,7 +199,7 @@ class Copilots {
|
|
|
134
199
|
Authorization: yield this._getAuthorizationHeader(),
|
|
135
200
|
"X-Fern-Language": "JavaScript",
|
|
136
201
|
"X-Fern-SDK-Name": "@credal/sdk",
|
|
137
|
-
"X-Fern-SDK-Version": "0.0.
|
|
202
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
138
203
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
139
204
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
140
205
|
},
|
|
@@ -191,7 +256,7 @@ class Copilots {
|
|
|
191
256
|
Authorization: yield this._getAuthorizationHeader(),
|
|
192
257
|
"X-Fern-Language": "JavaScript",
|
|
193
258
|
"X-Fern-SDK-Name": "@credal/sdk",
|
|
194
|
-
"X-Fern-SDK-Version": "0.0.
|
|
259
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
195
260
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
196
261
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
197
262
|
},
|
|
@@ -230,6 +295,246 @@ class Copilots {
|
|
|
230
295
|
}
|
|
231
296
|
});
|
|
232
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Link a collection with a copilot. The API Key used must be added to both the collection and the copilot beforehand.
|
|
300
|
+
*
|
|
301
|
+
* @param {Credal.AddCollectionToCopilotRequest} request
|
|
302
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* await credal.copilots.addCollectionToCopilot({
|
|
306
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
307
|
+
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
308
|
+
* })
|
|
309
|
+
*/
|
|
310
|
+
addCollectionToCopilot(request, requestOptions) {
|
|
311
|
+
var _a, _b;
|
|
312
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
313
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
314
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/addCollectionToCopilot"),
|
|
315
|
+
method: "POST",
|
|
316
|
+
headers: {
|
|
317
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
318
|
+
"X-Fern-Language": "JavaScript",
|
|
319
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
320
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
321
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
322
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
323
|
+
},
|
|
324
|
+
contentType: "application/json",
|
|
325
|
+
body: yield serializers.AddCollectionToCopilotRequest.jsonOrThrow(request, {
|
|
326
|
+
unrecognizedObjectKeys: "strip",
|
|
327
|
+
}),
|
|
328
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
329
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
330
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
331
|
+
});
|
|
332
|
+
if (_response.ok) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (_response.error.reason === "status-code") {
|
|
336
|
+
throw new errors.CredalError({
|
|
337
|
+
statusCode: _response.error.statusCode,
|
|
338
|
+
body: _response.error.body,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
switch (_response.error.reason) {
|
|
342
|
+
case "non-json":
|
|
343
|
+
throw new errors.CredalError({
|
|
344
|
+
statusCode: _response.error.statusCode,
|
|
345
|
+
body: _response.error.rawBody,
|
|
346
|
+
});
|
|
347
|
+
case "timeout":
|
|
348
|
+
throw new errors.CredalTimeoutError();
|
|
349
|
+
case "unknown":
|
|
350
|
+
throw new errors.CredalError({
|
|
351
|
+
message: _response.error.errorMessage,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Unlink a collection with a copilot. The API Key used must be added to both the collection and the copilot beforehand.
|
|
358
|
+
*
|
|
359
|
+
* @param {Credal.RemoveCollectionFromCopilotRequest} request
|
|
360
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
* await credal.copilots.removeCollectionFromCopilot({
|
|
364
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
365
|
+
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
366
|
+
* })
|
|
367
|
+
*/
|
|
368
|
+
removeCollectionFromCopilot(request, requestOptions) {
|
|
369
|
+
var _a, _b;
|
|
370
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
371
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
372
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/removeCollectionFromCopilot"),
|
|
373
|
+
method: "POST",
|
|
374
|
+
headers: {
|
|
375
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
376
|
+
"X-Fern-Language": "JavaScript",
|
|
377
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
378
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
379
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
380
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
381
|
+
},
|
|
382
|
+
contentType: "application/json",
|
|
383
|
+
body: yield serializers.RemoveCollectionFromCopilotRequest.jsonOrThrow(request, {
|
|
384
|
+
unrecognizedObjectKeys: "strip",
|
|
385
|
+
}),
|
|
386
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
387
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
388
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
389
|
+
});
|
|
390
|
+
if (_response.ok) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
if (_response.error.reason === "status-code") {
|
|
394
|
+
throw new errors.CredalError({
|
|
395
|
+
statusCode: _response.error.statusCode,
|
|
396
|
+
body: _response.error.body,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
switch (_response.error.reason) {
|
|
400
|
+
case "non-json":
|
|
401
|
+
throw new errors.CredalError({
|
|
402
|
+
statusCode: _response.error.statusCode,
|
|
403
|
+
body: _response.error.rawBody,
|
|
404
|
+
});
|
|
405
|
+
case "timeout":
|
|
406
|
+
throw new errors.CredalTimeoutError();
|
|
407
|
+
case "unknown":
|
|
408
|
+
throw new errors.CredalError({
|
|
409
|
+
message: _response.error.errorMessage,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Update the configuration for a copilot
|
|
416
|
+
*
|
|
417
|
+
* @param {Credal.UpdateConfigurationRequest} request
|
|
418
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* await credal.copilots.updateConfiguration({
|
|
422
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
423
|
+
* configuration: {
|
|
424
|
+
* name: "Customer Copilot",
|
|
425
|
+
* description: "This copilot is used to answer customer requests based on internal documentation.",
|
|
426
|
+
* prompt: "You are a polite, helpful assistant used to answer customer requests.",
|
|
427
|
+
* aiEndpointConfiguration: {
|
|
428
|
+
* baseUrl: "https://api.openai.com/v1/",
|
|
429
|
+
* apiKey: "<YOUR_API_KEY_HERE>"
|
|
430
|
+
* }
|
|
431
|
+
* }
|
|
432
|
+
* })
|
|
433
|
+
*/
|
|
434
|
+
updateConfiguration(request, requestOptions) {
|
|
435
|
+
var _a, _b;
|
|
436
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
437
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
438
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/updateConfiguration"),
|
|
439
|
+
method: "POST",
|
|
440
|
+
headers: {
|
|
441
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
442
|
+
"X-Fern-Language": "JavaScript",
|
|
443
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
444
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
445
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
446
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
447
|
+
},
|
|
448
|
+
contentType: "application/json",
|
|
449
|
+
body: yield serializers.UpdateConfigurationRequest.jsonOrThrow(request, {
|
|
450
|
+
unrecognizedObjectKeys: "strip",
|
|
451
|
+
}),
|
|
452
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
453
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
454
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
455
|
+
});
|
|
456
|
+
if (_response.ok) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
if (_response.error.reason === "status-code") {
|
|
460
|
+
throw new errors.CredalError({
|
|
461
|
+
statusCode: _response.error.statusCode,
|
|
462
|
+
body: _response.error.body,
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
switch (_response.error.reason) {
|
|
466
|
+
case "non-json":
|
|
467
|
+
throw new errors.CredalError({
|
|
468
|
+
statusCode: _response.error.statusCode,
|
|
469
|
+
body: _response.error.rawBody,
|
|
470
|
+
});
|
|
471
|
+
case "timeout":
|
|
472
|
+
throw new errors.CredalTimeoutError();
|
|
473
|
+
case "unknown":
|
|
474
|
+
throw new errors.CredalError({
|
|
475
|
+
message: _response.error.errorMessage,
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* @param {Credal.DeleteCopilotRequest} request
|
|
482
|
+
* @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* await credal.copilots.deleteCopilot({
|
|
486
|
+
* id: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
|
|
487
|
+
* })
|
|
488
|
+
*/
|
|
489
|
+
deleteCopilot(request, requestOptions) {
|
|
490
|
+
var _a, _b;
|
|
491
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
492
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
493
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/copilots/deleteCopilot"),
|
|
494
|
+
method: "DELETE",
|
|
495
|
+
headers: {
|
|
496
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
497
|
+
"X-Fern-Language": "JavaScript",
|
|
498
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
499
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
500
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
501
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
502
|
+
},
|
|
503
|
+
contentType: "application/json",
|
|
504
|
+
body: yield serializers.DeleteCopilotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
505
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
506
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
507
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
508
|
+
});
|
|
509
|
+
if (_response.ok) {
|
|
510
|
+
return yield serializers.DeleteCopilotResponse.parseOrThrow(_response.body, {
|
|
511
|
+
unrecognizedObjectKeys: "passthrough",
|
|
512
|
+
allowUnrecognizedUnionMembers: true,
|
|
513
|
+
allowUnrecognizedEnumValues: true,
|
|
514
|
+
breadcrumbsPrefix: ["response"],
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
if (_response.error.reason === "status-code") {
|
|
518
|
+
throw new errors.CredalError({
|
|
519
|
+
statusCode: _response.error.statusCode,
|
|
520
|
+
body: _response.error.body,
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
switch (_response.error.reason) {
|
|
524
|
+
case "non-json":
|
|
525
|
+
throw new errors.CredalError({
|
|
526
|
+
statusCode: _response.error.statusCode,
|
|
527
|
+
body: _response.error.rawBody,
|
|
528
|
+
});
|
|
529
|
+
case "timeout":
|
|
530
|
+
throw new errors.CredalTimeoutError();
|
|
531
|
+
case "unknown":
|
|
532
|
+
throw new errors.CredalError({
|
|
533
|
+
message: _response.error.errorMessage,
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
}
|
|
233
538
|
_getAuthorizationHeader() {
|
|
234
539
|
var _a;
|
|
235
540
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
8
|
+
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface AddCollectionToCopilotRequest {
|
|
12
|
+
/**
|
|
13
|
+
* Credal-generated copilot ID to add the collection to.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
copilotId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Credal-generated collection ID to add.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
collectionId: string;
|
|
22
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export interface CreateConversationRequest {
|
|
12
12
|
/**
|
|
13
|
-
* Credal-generated
|
|
13
|
+
* Credal-generated Copilot ID to specify which agent to route the request to.
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
16
|
agentId: string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Credal from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* name: "Customer Copilot",
|
|
9
|
+
* description: "This copilot is used to answer customer requests based on internal documentation.",
|
|
10
|
+
* collaborators: [{
|
|
11
|
+
* email: "test@gmail.com",
|
|
12
|
+
* role: Credal.Role.Editor
|
|
13
|
+
* }]
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
export interface CreateCopilotRequest {
|
|
17
|
+
/**
|
|
18
|
+
* A descriptive name for the copilot.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* An in depth name for the copilot's function. Useful for routing requests to the right copilot.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
description: string;
|
|
27
|
+
/**
|
|
28
|
+
* A list of collaborator emails and roles that will have access to the copilot.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
collaborators: Credal.Collaborator[];
|
|
32
|
+
}
|
|
@@ -16,7 +16,7 @@ import * as Credal from "../../../../index";
|
|
|
16
16
|
*/
|
|
17
17
|
export interface ProvideMessageFeedbackRequest {
|
|
18
18
|
/**
|
|
19
|
-
* Credal-generated
|
|
19
|
+
* Credal-generated Copilot ID to specify which agent to route the request to.
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
22
|
agentId: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* copilotId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
8
|
+
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface RemoveCollectionFromCopilotRequest {
|
|
12
|
+
/**
|
|
13
|
+
* Credal-generated copilot ID to add the collection to.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
copilotId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Credal-generated collection ID to add.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
collectionId: string;
|
|
22
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export interface SendMessageRequest {
|
|
13
13
|
/**
|
|
14
|
-
* Credal-generated
|
|
14
|
+
* Credal-generated Copilot ID to specify which agent to route the request to.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
agentId: string;
|