@credal/sdk 0.1.11 → 0.1.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/dist/cjs/BaseClient.d.ts +2 -1
- package/dist/cjs/BaseClient.js +47 -0
- package/dist/cjs/Client.d.ts +16 -16
- package/dist/cjs/Client.js +8 -49
- package/dist/cjs/api/resources/copilots/client/Client.d.ts +21 -21
- package/dist/cjs/api/resources/copilots/client/Client.js +14 -13
- package/dist/cjs/api/resources/documentCatalog/client/Client.d.ts +12 -12
- package/dist/cjs/api/resources/documentCatalog/client/Client.js +10 -9
- package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +18 -18
- package/dist/cjs/api/resources/documentCollections/client/Client.js +13 -12
- package/dist/cjs/api/resources/search/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/search/client/Client.js +7 -6
- package/dist/cjs/api/resources/users/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/users/client/Client.js +7 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +2 -1
- package/dist/esm/BaseClient.mjs +13 -1
- package/dist/esm/Client.d.mts +16 -16
- package/dist/esm/Client.mjs +13 -21
- package/dist/esm/api/resources/copilots/client/Client.d.mts +21 -21
- package/dist/esm/api/resources/copilots/client/Client.mjs +12 -11
- package/dist/esm/api/resources/documentCatalog/client/Client.d.mts +12 -12
- package/dist/esm/api/resources/documentCatalog/client/Client.mjs +8 -7
- package/dist/esm/api/resources/documentCollections/client/Client.d.mts +18 -18
- package/dist/esm/api/resources/documentCollections/client/Client.mjs +11 -10
- package/dist/esm/api/resources/search/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/search/client/Client.mjs +5 -4
- package/dist/esm/api/resources/users/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/users/client/Client.mjs +5 -4
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +21 -21
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as core from "./core/index.js";
|
|
2
2
|
import type * as environments from "./environments.js";
|
|
3
3
|
export interface BaseClientOptions {
|
|
4
4
|
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
@@ -29,3 +29,4 @@ export interface BaseRequestOptions {
|
|
|
29
29
|
/** Additional headers to include in the request. */
|
|
30
30
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
31
31
|
}
|
|
32
|
+
export declare function normalizeClientOptions<T extends BaseClientOptions>(options: T): T;
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.normalizeClientOptions = normalizeClientOptions;
|
|
38
|
+
const headers_js_1 = require("./core/headers.js");
|
|
39
|
+
const core = __importStar(require("./core/index.js"));
|
|
40
|
+
function normalizeClientOptions(options) {
|
|
41
|
+
const headers = (0, headers_js_1.mergeHeaders)({
|
|
42
|
+
"X-Fern-Language": "JavaScript",
|
|
43
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
44
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
45
|
+
"User-Agent": "@credal/sdk/0.1.12",
|
|
46
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
47
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
48
|
+
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
49
|
+
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
50
|
+
}
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { CopilotsClient } from "./api/resources/copilots/client/Client.js";
|
|
2
|
+
import { DocumentCatalogClient } from "./api/resources/documentCatalog/client/Client.js";
|
|
3
|
+
import { DocumentCollectionsClient } from "./api/resources/documentCollections/client/Client.js";
|
|
4
|
+
import { SearchClient } from "./api/resources/search/client/Client.js";
|
|
5
|
+
import { UsersClient } from "./api/resources/users/client/Client.js";
|
|
6
6
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
7
7
|
export declare namespace CredalClient {
|
|
8
8
|
interface Options extends BaseClientOptions {
|
|
@@ -12,15 +12,15 @@ export declare namespace CredalClient {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class CredalClient {
|
|
14
14
|
protected readonly _options: CredalClient.Options;
|
|
15
|
-
protected _copilots:
|
|
16
|
-
protected _documentCatalog:
|
|
17
|
-
protected _documentCollections:
|
|
18
|
-
protected _search:
|
|
19
|
-
protected _users:
|
|
20
|
-
constructor(
|
|
21
|
-
get copilots():
|
|
22
|
-
get documentCatalog():
|
|
23
|
-
get documentCollections():
|
|
24
|
-
get search():
|
|
25
|
-
get users():
|
|
15
|
+
protected _copilots: CopilotsClient | undefined;
|
|
16
|
+
protected _documentCatalog: DocumentCatalogClient | undefined;
|
|
17
|
+
protected _documentCollections: DocumentCollectionsClient | undefined;
|
|
18
|
+
protected _search: SearchClient | undefined;
|
|
19
|
+
protected _users: UsersClient | undefined;
|
|
20
|
+
constructor(options?: CredalClient.Options);
|
|
21
|
+
get copilots(): CopilotsClient;
|
|
22
|
+
get documentCatalog(): DocumentCatalogClient;
|
|
23
|
+
get documentCollections(): DocumentCollectionsClient;
|
|
24
|
+
get search(): SearchClient;
|
|
25
|
+
get users(): UsersClient;
|
|
26
26
|
}
|
package/dist/cjs/Client.js
CHANGED
|
@@ -1,38 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
4
|
exports.CredalClient = void 0;
|
|
38
5
|
const Client_js_1 = require("./api/resources/copilots/client/Client.js");
|
|
@@ -40,38 +7,30 @@ const Client_js_2 = require("./api/resources/documentCatalog/client/Client.js");
|
|
|
40
7
|
const Client_js_3 = require("./api/resources/documentCollections/client/Client.js");
|
|
41
8
|
const Client_js_4 = require("./api/resources/search/client/Client.js");
|
|
42
9
|
const Client_js_5 = require("./api/resources/users/client/Client.js");
|
|
43
|
-
const
|
|
44
|
-
const core = __importStar(require("./core/index.js"));
|
|
10
|
+
const BaseClient_js_1 = require("./BaseClient.js");
|
|
45
11
|
class CredalClient {
|
|
46
|
-
constructor(
|
|
47
|
-
this._options =
|
|
48
|
-
"X-Fern-Language": "JavaScript",
|
|
49
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
50
|
-
"X-Fern-SDK-Version": "0.1.11",
|
|
51
|
-
"User-Agent": "@credal/sdk/0.1.11",
|
|
52
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
53
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
54
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
12
|
+
constructor(options = {}) {
|
|
13
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
55
14
|
}
|
|
56
15
|
get copilots() {
|
|
57
16
|
var _a;
|
|
58
|
-
return ((_a = this._copilots) !== null && _a !== void 0 ? _a : (this._copilots = new Client_js_1.
|
|
17
|
+
return ((_a = this._copilots) !== null && _a !== void 0 ? _a : (this._copilots = new Client_js_1.CopilotsClient(this._options)));
|
|
59
18
|
}
|
|
60
19
|
get documentCatalog() {
|
|
61
20
|
var _a;
|
|
62
|
-
return ((_a = this._documentCatalog) !== null && _a !== void 0 ? _a : (this._documentCatalog = new Client_js_2.
|
|
21
|
+
return ((_a = this._documentCatalog) !== null && _a !== void 0 ? _a : (this._documentCatalog = new Client_js_2.DocumentCatalogClient(this._options)));
|
|
63
22
|
}
|
|
64
23
|
get documentCollections() {
|
|
65
24
|
var _a;
|
|
66
|
-
return ((_a = this._documentCollections) !== null && _a !== void 0 ? _a : (this._documentCollections = new Client_js_3.
|
|
25
|
+
return ((_a = this._documentCollections) !== null && _a !== void 0 ? _a : (this._documentCollections = new Client_js_3.DocumentCollectionsClient(this._options)));
|
|
67
26
|
}
|
|
68
27
|
get search() {
|
|
69
28
|
var _a;
|
|
70
|
-
return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new Client_js_4.
|
|
29
|
+
return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new Client_js_4.SearchClient(this._options)));
|
|
71
30
|
}
|
|
72
31
|
get users() {
|
|
73
32
|
var _a;
|
|
74
|
-
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_5.
|
|
33
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_5.UsersClient(this._options)));
|
|
75
34
|
}
|
|
76
35
|
}
|
|
77
36
|
exports.CredalClient = CredalClient;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
3
|
import type * as Credal from "../../../index.js";
|
|
4
|
-
export declare namespace
|
|
4
|
+
export declare namespace CopilotsClient {
|
|
5
5
|
interface Options extends BaseClientOptions {
|
|
6
6
|
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class CopilotsClient {
|
|
11
|
+
protected readonly _options: CopilotsClient.Options;
|
|
12
|
+
constructor(options?: CopilotsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Create a new agent. The API key used will be added to the agent for future Requests
|
|
15
15
|
*
|
|
16
16
|
* @param {Credal.CreateCopilotRequest} request
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* await client.copilots.createCopilot({
|
|
@@ -26,13 +26,13 @@ export declare class Copilots {
|
|
|
26
26
|
* }]
|
|
27
27
|
* })
|
|
28
28
|
*/
|
|
29
|
-
createCopilot(request: Credal.CreateCopilotRequest, requestOptions?:
|
|
29
|
+
createCopilot(request: Credal.CreateCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.CreateCopilotResponse>;
|
|
30
30
|
private __createCopilot;
|
|
31
31
|
/**
|
|
32
32
|
* 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.
|
|
33
33
|
*
|
|
34
34
|
* @param {Credal.CreateConversationRequest} request
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* await client.copilots.createConversation({
|
|
@@ -40,11 +40,11 @@ export declare class Copilots {
|
|
|
40
40
|
* userEmail: "ravin@credal.ai"
|
|
41
41
|
* })
|
|
42
42
|
*/
|
|
43
|
-
createConversation(request: Credal.CreateConversationRequest, requestOptions?:
|
|
43
|
+
createConversation(request: Credal.CreateConversationRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.CreateConversationResponse>;
|
|
44
44
|
private __createConversation;
|
|
45
45
|
/**
|
|
46
46
|
* @param {Credal.ProvideMessageFeedbackRequest} request
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
* await client.copilots.provideMessageFeedback({
|
|
@@ -58,11 +58,11 @@ export declare class Copilots {
|
|
|
58
58
|
* }
|
|
59
59
|
* })
|
|
60
60
|
*/
|
|
61
|
-
provideMessageFeedback(request: Credal.ProvideMessageFeedbackRequest, requestOptions?:
|
|
61
|
+
provideMessageFeedback(request: Credal.ProvideMessageFeedbackRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
62
62
|
private __provideMessageFeedback;
|
|
63
63
|
/**
|
|
64
64
|
* @param {Credal.SendMessageRequest} request
|
|
65
|
-
* @param {
|
|
65
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
66
|
*
|
|
67
67
|
* @example
|
|
68
68
|
* await client.copilots.sendMessage({
|
|
@@ -78,18 +78,18 @@ export declare class Copilots {
|
|
|
78
78
|
* }]
|
|
79
79
|
* })
|
|
80
80
|
*/
|
|
81
|
-
sendMessage(request: Credal.SendMessageRequest, requestOptions?:
|
|
81
|
+
sendMessage(request: Credal.SendMessageRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.SendAgentMessageResponse>;
|
|
82
82
|
private __sendMessage;
|
|
83
83
|
/**
|
|
84
84
|
* 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.
|
|
85
85
|
*/
|
|
86
|
-
streamMessage(request: Credal.StreamMessageRequest, requestOptions?:
|
|
86
|
+
streamMessage(request: Credal.StreamMessageRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<core.Stream<Credal.StreamingChunk>>;
|
|
87
87
|
private __streamMessage;
|
|
88
88
|
/**
|
|
89
89
|
* Link a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
90
90
|
*
|
|
91
91
|
* @param {Credal.AddCollectionToCopilotRequest} request
|
|
92
|
-
* @param {
|
|
92
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
93
|
*
|
|
94
94
|
* @example
|
|
95
95
|
* await client.copilots.addCollectionToCopilot({
|
|
@@ -97,13 +97,13 @@ export declare class Copilots {
|
|
|
97
97
|
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
98
98
|
* })
|
|
99
99
|
*/
|
|
100
|
-
addCollectionToCopilot(request: Credal.AddCollectionToCopilotRequest, requestOptions?:
|
|
100
|
+
addCollectionToCopilot(request: Credal.AddCollectionToCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
101
101
|
private __addCollectionToCopilot;
|
|
102
102
|
/**
|
|
103
103
|
* Unlink a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
104
104
|
*
|
|
105
105
|
* @param {Credal.RemoveCollectionFromCopilotRequest} request
|
|
106
|
-
* @param {
|
|
106
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
107
107
|
*
|
|
108
108
|
* @example
|
|
109
109
|
* await client.copilots.removeCollectionFromCopilot({
|
|
@@ -111,13 +111,13 @@ export declare class Copilots {
|
|
|
111
111
|
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
112
112
|
* })
|
|
113
113
|
*/
|
|
114
|
-
removeCollectionFromCopilot(request: Credal.RemoveCollectionFromCopilotRequest, requestOptions?:
|
|
114
|
+
removeCollectionFromCopilot(request: Credal.RemoveCollectionFromCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
115
115
|
private __removeCollectionFromCopilot;
|
|
116
116
|
/**
|
|
117
117
|
* Update the configuration for a agent
|
|
118
118
|
*
|
|
119
119
|
* @param {Credal.UpdateConfigurationRequest} request
|
|
120
|
-
* @param {
|
|
120
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
121
121
|
*
|
|
122
122
|
* @example
|
|
123
123
|
* await client.copilots.updateConfiguration({
|
|
@@ -133,18 +133,18 @@ export declare class Copilots {
|
|
|
133
133
|
* }
|
|
134
134
|
* })
|
|
135
135
|
*/
|
|
136
|
-
updateConfiguration(request: Credal.UpdateConfigurationRequest, requestOptions?:
|
|
136
|
+
updateConfiguration(request: Credal.UpdateConfigurationRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
137
137
|
private __updateConfiguration;
|
|
138
138
|
/**
|
|
139
139
|
* @param {Credal.DeleteCopilotRequest} request
|
|
140
|
-
* @param {
|
|
140
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
141
141
|
*
|
|
142
142
|
* @example
|
|
143
143
|
* await client.copilots.deleteCopilot({
|
|
144
144
|
* id: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
|
|
145
145
|
* })
|
|
146
146
|
*/
|
|
147
|
-
deleteCopilot(request: Credal.DeleteCopilotRequest, requestOptions?:
|
|
147
|
+
deleteCopilot(request: Credal.DeleteCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.DeleteCopilotResponse>;
|
|
148
148
|
private __deleteCopilot;
|
|
149
149
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
150
150
|
}
|
|
@@ -43,20 +43,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.CopilotsClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
51
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
|
-
class
|
|
52
|
-
constructor(
|
|
53
|
-
this._options =
|
|
52
|
+
class CopilotsClient {
|
|
53
|
+
constructor(options = {}) {
|
|
54
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
56
57
|
* Create a new agent. The API key used will be added to the agent for future Requests
|
|
57
58
|
*
|
|
58
59
|
* @param {Credal.CreateCopilotRequest} request
|
|
59
|
-
* @param {
|
|
60
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
61
|
*
|
|
61
62
|
* @example
|
|
62
63
|
* await client.copilots.createCopilot({
|
|
@@ -120,7 +121,7 @@ class Copilots {
|
|
|
120
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.
|
|
121
122
|
*
|
|
122
123
|
* @param {Credal.CreateConversationRequest} request
|
|
123
|
-
* @param {
|
|
124
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
125
|
*
|
|
125
126
|
* @example
|
|
126
127
|
* await client.copilots.createConversation({
|
|
@@ -178,7 +179,7 @@ class Copilots {
|
|
|
178
179
|
}
|
|
179
180
|
/**
|
|
180
181
|
* @param {Credal.ProvideMessageFeedbackRequest} request
|
|
181
|
-
* @param {
|
|
182
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
182
183
|
*
|
|
183
184
|
* @example
|
|
184
185
|
* await client.copilots.provideMessageFeedback({
|
|
@@ -242,7 +243,7 @@ class Copilots {
|
|
|
242
243
|
}
|
|
243
244
|
/**
|
|
244
245
|
* @param {Credal.SendMessageRequest} request
|
|
245
|
-
* @param {
|
|
246
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
246
247
|
*
|
|
247
248
|
* @example
|
|
248
249
|
* await client.copilots.sendMessage({
|
|
@@ -373,7 +374,7 @@ class Copilots {
|
|
|
373
374
|
* Link a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
374
375
|
*
|
|
375
376
|
* @param {Credal.AddCollectionToCopilotRequest} request
|
|
376
|
-
* @param {
|
|
377
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
377
378
|
*
|
|
378
379
|
* @example
|
|
379
380
|
* await client.copilots.addCollectionToCopilot({
|
|
@@ -433,7 +434,7 @@ class Copilots {
|
|
|
433
434
|
* Unlink a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
434
435
|
*
|
|
435
436
|
* @param {Credal.RemoveCollectionFromCopilotRequest} request
|
|
436
|
-
* @param {
|
|
437
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
437
438
|
*
|
|
438
439
|
* @example
|
|
439
440
|
* await client.copilots.removeCollectionFromCopilot({
|
|
@@ -493,7 +494,7 @@ class Copilots {
|
|
|
493
494
|
* Update the configuration for a agent
|
|
494
495
|
*
|
|
495
496
|
* @param {Credal.UpdateConfigurationRequest} request
|
|
496
|
-
* @param {
|
|
497
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
497
498
|
*
|
|
498
499
|
* @example
|
|
499
500
|
* await client.copilots.updateConfiguration({
|
|
@@ -559,7 +560,7 @@ class Copilots {
|
|
|
559
560
|
}
|
|
560
561
|
/**
|
|
561
562
|
* @param {Credal.DeleteCopilotRequest} request
|
|
562
|
-
* @param {
|
|
563
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
563
564
|
*
|
|
564
565
|
* @example
|
|
565
566
|
* await client.copilots.deleteCopilot({
|
|
@@ -627,4 +628,4 @@ class Copilots {
|
|
|
627
628
|
});
|
|
628
629
|
}
|
|
629
630
|
}
|
|
630
|
-
exports.
|
|
631
|
+
exports.CopilotsClient = CopilotsClient;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
3
|
import type * as Credal from "../../../index.js";
|
|
4
|
-
export declare namespace
|
|
4
|
+
export declare namespace DocumentCatalogClient {
|
|
5
5
|
interface Options extends BaseClientOptions {
|
|
6
6
|
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class DocumentCatalogClient {
|
|
11
|
+
protected readonly _options: DocumentCatalogClient.Options;
|
|
12
|
+
constructor(options?: DocumentCatalogClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Credal.UploadDocumentContentsRequest} request
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* await client.documentCatalog.uploadDocumentContents({
|
|
@@ -23,21 +23,21 @@ export declare class DocumentCatalog {
|
|
|
23
23
|
* uploadAsUserEmail: "jack@credal.ai"
|
|
24
24
|
* })
|
|
25
25
|
*/
|
|
26
|
-
uploadDocumentContents(request: Credal.UploadDocumentContentsRequest, requestOptions?:
|
|
26
|
+
uploadDocumentContents(request: Credal.UploadDocumentContentsRequest, requestOptions?: DocumentCatalogClient.RequestOptions): core.HttpResponsePromise<Credal.UploadDocumentResponse>;
|
|
27
27
|
private __uploadDocumentContents;
|
|
28
28
|
/**
|
|
29
29
|
* Upload a file (PDF, Word, Excel, CSV, PowerPoint) to Credal. Unlike uploadDocumentContents which requires pre-parsed text, this endpoint accepts actual file uploads and automatically parses them using Credal's parsing service.
|
|
30
30
|
*
|
|
31
31
|
* @param {Credal.UploadFileRequest} request
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
33
|
*/
|
|
34
|
-
uploadFile(request: Credal.UploadFileRequest, requestOptions?:
|
|
34
|
+
uploadFile(request: Credal.UploadFileRequest, requestOptions?: DocumentCatalogClient.RequestOptions): core.HttpResponsePromise<Credal.UploadDocumentResponse>;
|
|
35
35
|
private __uploadFile;
|
|
36
36
|
/**
|
|
37
37
|
* Sync a document from a source URL. Does not support recursive web search. Reach out to a Credal representative for access.
|
|
38
38
|
*
|
|
39
39
|
* @param {Credal.SyncSourceByUrlRequest} request
|
|
40
|
-
* @param {
|
|
40
|
+
* @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* await client.documentCatalog.syncSourceByUrl({
|
|
@@ -45,13 +45,13 @@ export declare class DocumentCatalog {
|
|
|
45
45
|
* uploadAsUserEmail: "ria@credal.ai"
|
|
46
46
|
* })
|
|
47
47
|
*/
|
|
48
|
-
syncSourceByUrl(request: Credal.SyncSourceByUrlRequest, requestOptions?:
|
|
48
|
+
syncSourceByUrl(request: Credal.SyncSourceByUrlRequest, requestOptions?: DocumentCatalogClient.RequestOptions): core.HttpResponsePromise<Credal.SyncSourceByUrlResponse>;
|
|
49
49
|
private __syncSourceByUrl;
|
|
50
50
|
/**
|
|
51
51
|
* Bulk patch metadata for documents, synced natively by Credal or manual API uploads
|
|
52
52
|
*
|
|
53
53
|
* @param {Credal.DocumentMetadataPatchRequest} request
|
|
54
|
-
* @param {
|
|
54
|
+
* @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
57
|
* await client.documentCatalog.metadata({
|
|
@@ -79,7 +79,7 @@ export declare class DocumentCatalog {
|
|
|
79
79
|
* uploadAsUserEmail: "ben@credal.ai"
|
|
80
80
|
* })
|
|
81
81
|
*/
|
|
82
|
-
metadata(request: Credal.DocumentMetadataPatchRequest, requestOptions?:
|
|
82
|
+
metadata(request: Credal.DocumentMetadataPatchRequest, requestOptions?: DocumentCatalogClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
83
83
|
private __metadata;
|
|
84
84
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
85
85
|
}
|
|
@@ -43,18 +43,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.DocumentCatalogClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
51
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
|
-
class
|
|
52
|
-
constructor(
|
|
53
|
-
this._options =
|
|
52
|
+
class DocumentCatalogClient {
|
|
53
|
+
constructor(options = {}) {
|
|
54
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
56
57
|
* @param {Credal.UploadDocumentContentsRequest} request
|
|
57
|
-
* @param {
|
|
58
|
+
* @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
59
|
*
|
|
59
60
|
* @example
|
|
60
61
|
* await client.documentCatalog.uploadDocumentContents({
|
|
@@ -117,7 +118,7 @@ class DocumentCatalog {
|
|
|
117
118
|
* Upload a file (PDF, Word, Excel, CSV, PowerPoint) to Credal. Unlike uploadDocumentContents which requires pre-parsed text, this endpoint accepts actual file uploads and automatically parses them using Credal's parsing service.
|
|
118
119
|
*
|
|
119
120
|
* @param {Credal.UploadFileRequest} request
|
|
120
|
-
* @param {
|
|
121
|
+
* @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
121
122
|
*/
|
|
122
123
|
uploadFile(request, requestOptions) {
|
|
123
124
|
return core.HttpResponsePromise.fromPromise(this.__uploadFile(request, requestOptions));
|
|
@@ -203,7 +204,7 @@ class DocumentCatalog {
|
|
|
203
204
|
* Sync a document from a source URL. Does not support recursive web search. Reach out to a Credal representative for access.
|
|
204
205
|
*
|
|
205
206
|
* @param {Credal.SyncSourceByUrlRequest} request
|
|
206
|
-
* @param {
|
|
207
|
+
* @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
207
208
|
*
|
|
208
209
|
* @example
|
|
209
210
|
* await client.documentCatalog.syncSourceByUrl({
|
|
@@ -263,7 +264,7 @@ class DocumentCatalog {
|
|
|
263
264
|
* Bulk patch metadata for documents, synced natively by Credal or manual API uploads
|
|
264
265
|
*
|
|
265
266
|
* @param {Credal.DocumentMetadataPatchRequest} request
|
|
266
|
-
* @param {
|
|
267
|
+
* @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
267
268
|
*
|
|
268
269
|
* @example
|
|
269
270
|
* await client.documentCatalog.metadata({
|
|
@@ -352,4 +353,4 @@ class DocumentCatalog {
|
|
|
352
353
|
});
|
|
353
354
|
}
|
|
354
355
|
}
|
|
355
|
-
exports.
|
|
356
|
+
exports.DocumentCatalogClient = DocumentCatalogClient;
|