@chrt-inc/typescript-sdk 1.1026.0 → 1.1027.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/chrtGpt/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/chrtGpt/client/Client.js +1 -1
- package/dist/cjs/api/resources/chrtGpt/client/requests/ChrtGptReq.d.ts +24 -0
- package/dist/cjs/api/resources/chrtGpt/client/requests/ChrtGptReq.js +14 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.d.ts +31 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.js +132 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsDeleteManyReq.d.ts +13 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsUpdateTitleReq.d.ts +12 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsUpdateTitleReq.js +5 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/types/ChrtGptCompletedEvent.d.ts +4 -0
- package/dist/cjs/api/types/ChrtGptConversation1.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptConversationRes.d.ts +3 -1
- package/dist/cjs/api/types/ChrtGptConversationTitleSourceEnum1.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptConversationTitleSourceEnum1.js +11 -0
- package/dist/cjs/api/types/ChrtGptConversationsDeleteManyRes.d.ts +7 -0
- package/dist/cjs/api/types/ChrtGptConversationsDeleteManyRes.js +5 -0
- package/dist/cjs/api/types/ChrtGptEvent.d.ts +1 -4
- package/dist/cjs/api/types/index.d.ts +2 -1
- package/dist/cjs/api/types/index.js +2 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/chrtGpt/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/chrtGpt/client/Client.mjs +1 -1
- package/dist/esm/api/resources/chrtGpt/client/requests/ChrtGptReq.d.mts +24 -0
- package/dist/esm/api/resources/chrtGpt/client/requests/ChrtGptReq.mjs +13 -1
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.d.mts +31 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.mjs +132 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsDeleteManyReq.d.mts +13 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsUpdateTitleReq.d.mts +12 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsUpdateTitleReq.mjs +4 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.d.mts +2 -0
- package/dist/esm/api/types/ChrtGptCompletedEvent.d.mts +4 -0
- package/dist/esm/api/types/ChrtGptConversation1.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptConversationRes.d.mts +3 -1
- package/dist/esm/api/types/ChrtGptConversationTitleSourceEnum1.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptConversationTitleSourceEnum1.mjs +8 -0
- package/dist/esm/api/types/ChrtGptConversationsDeleteManyRes.d.mts +7 -0
- package/dist/esm/api/types/ChrtGptConversationsDeleteManyRes.mjs +4 -0
- package/dist/esm/api/types/ChrtGptEvent.d.mts +1 -4
- package/dist/esm/api/types/index.d.mts +2 -1
- package/dist/esm/api/types/index.mjs +2 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +139 -1
- package/dist/cjs/api/types/ChrtGptTitleEvent.d.ts +0 -11
- package/dist/esm/api/types/ChrtGptTitleEvent.d.mts +0 -11
- /package/dist/cjs/api/{types/ChrtGptTitleEvent.js → resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsDeleteManyReq.js} +0 -0
- /package/dist/esm/api/{types/ChrtGptTitleEvent.mjs → resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsDeleteManyReq.mjs} +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -62,8 +62,8 @@ class ChrtClient {
|
|
|
62
62
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
65
|
-
"X-Fern-SDK-Version": "1.
|
|
66
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
65
|
+
"X-Fern-SDK-Version": "1.1027.0",
|
|
66
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.1027.0",
|
|
67
67
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
68
68
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
69
69
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -34,7 +34,7 @@ export declare class ChrtGpt {
|
|
|
34
34
|
constructor(_options?: ChrtGpt.Options);
|
|
35
35
|
get conversations(): Conversations;
|
|
36
36
|
/**
|
|
37
|
-
* Sends a message to ChrtGPT and streams its reply, starting
|
|
37
|
+
* Sends a message to ChrtGPT and streams its reply, starting a new conversation when no conversation_id is given. In the background, retitles the conversation after each of its first 3 turns and updates its summary and order identifiers after every turn. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTReq) -> (stream[ChrtGPTEvent])
|
|
38
38
|
*/
|
|
39
39
|
postV1(request: Chrt.ChrtGptReq, requestOptions?: ChrtGpt.RequestOptions): core.HttpResponsePromise<core.Stream<Chrt.ChrtGptEvent>>;
|
|
40
40
|
private __postV1;
|
|
@@ -61,7 +61,7 @@ class ChrtGpt {
|
|
|
61
61
|
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new Client_js_1.Conversations(this._options)));
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* Sends a message to ChrtGPT and streams its reply, starting
|
|
64
|
+
* Sends a message to ChrtGPT and streams its reply, starting a new conversation when no conversation_id is given. In the background, retitles the conversation after each of its first 3 turns and updates its summary and order identifiers after every turn. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTReq) -> (stream[ChrtGPTEvent])
|
|
65
65
|
*/
|
|
66
66
|
postV1(request, requestOptions) {
|
|
67
67
|
return core.HttpResponsePromise.fromPromise(this.__postV1(request, requestOptions));
|
|
@@ -11,4 +11,28 @@ export interface ChrtGptReq {
|
|
|
11
11
|
/** Omit to start a new conversation. */
|
|
12
12
|
conversation_id?: string | null;
|
|
13
13
|
message: string;
|
|
14
|
+
/** How much ChrtGPT reasons before answering this message. Higher is slower and more thorough. */
|
|
15
|
+
reasoning_effort?: ChrtGptReq.ReasoningEffort;
|
|
16
|
+
/** How long and detailed ChrtGPT's reply is. */
|
|
17
|
+
verbosity?: ChrtGptReq.Verbosity;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace ChrtGptReq {
|
|
20
|
+
/**
|
|
21
|
+
* How much ChrtGPT reasons before answering this message. Higher is slower and more thorough.
|
|
22
|
+
*/
|
|
23
|
+
type ReasoningEffort = "low" | "medium" | "high";
|
|
24
|
+
const ReasoningEffort: {
|
|
25
|
+
readonly Low: "low";
|
|
26
|
+
readonly Medium: "medium";
|
|
27
|
+
readonly High: "high";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* How long and detailed ChrtGPT's reply is.
|
|
31
|
+
*/
|
|
32
|
+
type Verbosity = "low" | "medium" | "high";
|
|
33
|
+
const Verbosity: {
|
|
34
|
+
readonly Low: "low";
|
|
35
|
+
readonly Medium: "medium";
|
|
36
|
+
readonly High: "high";
|
|
37
|
+
};
|
|
14
38
|
}
|
|
@@ -3,3 +3,17 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChrtGptReq = void 0;
|
|
7
|
+
var ChrtGptReq;
|
|
8
|
+
(function (ChrtGptReq) {
|
|
9
|
+
ChrtGptReq.ReasoningEffort = {
|
|
10
|
+
Low: "low",
|
|
11
|
+
Medium: "medium",
|
|
12
|
+
High: "high",
|
|
13
|
+
};
|
|
14
|
+
ChrtGptReq.Verbosity = {
|
|
15
|
+
Low: "low",
|
|
16
|
+
Medium: "medium",
|
|
17
|
+
High: "high",
|
|
18
|
+
};
|
|
19
|
+
})(ChrtGptReq || (exports.ChrtGptReq = ChrtGptReq = {}));
|
|
@@ -30,6 +30,21 @@ export declare namespace Conversations {
|
|
|
30
30
|
export declare class Conversations {
|
|
31
31
|
protected readonly _options: Conversations.Options;
|
|
32
32
|
constructor(_options?: Conversations.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Permanently deletes the caller's ChrtGPT conversations and their history, skipping IDs that don't exist or aren't the caller's. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsDeleteManyReq) -> (ChrtGPTConversationsDeleteManyRes)
|
|
35
|
+
*
|
|
36
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsDeleteManyReq} request
|
|
37
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.chrtGpt.conversations.deleteManyV1({
|
|
43
|
+
* conversation_ids: ["conversation_ids"]
|
|
44
|
+
* })
|
|
45
|
+
*/
|
|
46
|
+
deleteManyV1(request: Chrt.chrtGpt.ChrtGptConversationsDeleteManyReq, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversationsDeleteManyRes>;
|
|
47
|
+
private __deleteManyV1;
|
|
33
48
|
/**
|
|
34
49
|
* Lists the caller's ChrtGPT conversations, most recently active first by default. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationListRes)
|
|
35
50
|
*
|
|
@@ -48,6 +63,22 @@ export declare class Conversations {
|
|
|
48
63
|
*/
|
|
49
64
|
listV1(request?: Chrt.chrtGpt.ConversationsListV1Request, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversationListRes>;
|
|
50
65
|
private __listV1;
|
|
66
|
+
/**
|
|
67
|
+
* Renames one of the caller's ChrtGPT conversations; ChrtGPT never retitles it after that. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsUpdateTitleReq) -> (ChrtGPTConversation1)
|
|
68
|
+
*
|
|
69
|
+
* @param {string} conversationId
|
|
70
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq} request
|
|
71
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* await client.chrtGpt.conversations.updateTitleV1("conversation_id", {
|
|
77
|
+
* title: "title"
|
|
78
|
+
* })
|
|
79
|
+
*/
|
|
80
|
+
updateTitleV1(conversationId: string, request: Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversation1>;
|
|
81
|
+
private __updateTitleV1;
|
|
51
82
|
/**
|
|
52
83
|
* Gets one of the caller's ChrtGPT conversations with its history of messages, tool calls, and web searches. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationRes)
|
|
53
84
|
*
|
|
@@ -55,6 +55,73 @@ class Conversations {
|
|
|
55
55
|
constructor(_options = {}) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Permanently deletes the caller's ChrtGPT conversations and their history, skipping IDs that don't exist or aren't the caller's. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsDeleteManyReq) -> (ChrtGPTConversationsDeleteManyRes)
|
|
60
|
+
*
|
|
61
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsDeleteManyReq} request
|
|
62
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.chrtGpt.conversations.deleteManyV1({
|
|
68
|
+
* conversation_ids: ["conversation_ids"]
|
|
69
|
+
* })
|
|
70
|
+
*/
|
|
71
|
+
deleteManyV1(request, requestOptions) {
|
|
72
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteManyV1(request, requestOptions));
|
|
73
|
+
}
|
|
74
|
+
__deleteManyV1(request, requestOptions) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b, _c, _d;
|
|
77
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
78
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
79
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "chrt_gpt/conversations/delete_many/v1"),
|
|
80
|
+
method: "DELETE",
|
|
81
|
+
headers: _headers,
|
|
82
|
+
contentType: "application/json",
|
|
83
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
84
|
+
requestType: "json",
|
|
85
|
+
body: request,
|
|
86
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
87
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
88
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
89
|
+
});
|
|
90
|
+
if (_response.ok) {
|
|
91
|
+
return {
|
|
92
|
+
data: _response.body,
|
|
93
|
+
rawResponse: _response.rawResponse,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (_response.error.reason === "status-code") {
|
|
97
|
+
switch (_response.error.statusCode) {
|
|
98
|
+
case 422:
|
|
99
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
100
|
+
default:
|
|
101
|
+
throw new errors.ChrtError({
|
|
102
|
+
statusCode: _response.error.statusCode,
|
|
103
|
+
body: _response.error.body,
|
|
104
|
+
rawResponse: _response.rawResponse,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
switch (_response.error.reason) {
|
|
109
|
+
case "non-json":
|
|
110
|
+
throw new errors.ChrtError({
|
|
111
|
+
statusCode: _response.error.statusCode,
|
|
112
|
+
body: _response.error.rawBody,
|
|
113
|
+
rawResponse: _response.rawResponse,
|
|
114
|
+
});
|
|
115
|
+
case "timeout":
|
|
116
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /chrt_gpt/conversations/delete_many/v1.");
|
|
117
|
+
case "unknown":
|
|
118
|
+
throw new errors.ChrtError({
|
|
119
|
+
message: _response.error.errorMessage,
|
|
120
|
+
rawResponse: _response.rawResponse,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
58
125
|
/**
|
|
59
126
|
* Lists the caller's ChrtGPT conversations, most recently active first by default. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationListRes)
|
|
60
127
|
*
|
|
@@ -133,6 +200,71 @@ class Conversations {
|
|
|
133
200
|
}
|
|
134
201
|
});
|
|
135
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Renames one of the caller's ChrtGPT conversations; ChrtGPT never retitles it after that. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsUpdateTitleReq) -> (ChrtGPTConversation1)
|
|
205
|
+
*
|
|
206
|
+
* @param {string} conversationId
|
|
207
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq} request
|
|
208
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
209
|
+
*
|
|
210
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* await client.chrtGpt.conversations.updateTitleV1("conversation_id", {
|
|
214
|
+
* title: "title"
|
|
215
|
+
* })
|
|
216
|
+
*/
|
|
217
|
+
updateTitleV1(conversationId, request, requestOptions) {
|
|
218
|
+
return core.HttpResponsePromise.fromPromise(this.__updateTitleV1(conversationId, request, requestOptions));
|
|
219
|
+
}
|
|
220
|
+
__updateTitleV1(conversationId, request, requestOptions) {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
var _a, _b, _c, _d;
|
|
223
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
224
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
225
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `chrt_gpt/conversations/update_title/v1/${encodeURIComponent(conversationId)}`),
|
|
226
|
+
method: "PATCH",
|
|
227
|
+
headers: _headers,
|
|
228
|
+
contentType: "application/json",
|
|
229
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
230
|
+
requestType: "json",
|
|
231
|
+
body: request,
|
|
232
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
233
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
234
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
235
|
+
});
|
|
236
|
+
if (_response.ok) {
|
|
237
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
238
|
+
}
|
|
239
|
+
if (_response.error.reason === "status-code") {
|
|
240
|
+
switch (_response.error.statusCode) {
|
|
241
|
+
case 422:
|
|
242
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
243
|
+
default:
|
|
244
|
+
throw new errors.ChrtError({
|
|
245
|
+
statusCode: _response.error.statusCode,
|
|
246
|
+
body: _response.error.body,
|
|
247
|
+
rawResponse: _response.rawResponse,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
switch (_response.error.reason) {
|
|
252
|
+
case "non-json":
|
|
253
|
+
throw new errors.ChrtError({
|
|
254
|
+
statusCode: _response.error.statusCode,
|
|
255
|
+
body: _response.error.rawBody,
|
|
256
|
+
rawResponse: _response.rawResponse,
|
|
257
|
+
});
|
|
258
|
+
case "timeout":
|
|
259
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /chrt_gpt/conversations/update_title/v1/{conversation_id}.");
|
|
260
|
+
case "unknown":
|
|
261
|
+
throw new errors.ChrtError({
|
|
262
|
+
message: _response.error.errorMessage,
|
|
263
|
+
rawResponse: _response.rawResponse,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}
|
|
136
268
|
/**
|
|
137
269
|
* Gets one of the caller's ChrtGPT conversations with its history of messages, tool calls, and web searches. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationRes)
|
|
138
270
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* conversation_ids: ["conversation_ids"]
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface ChrtGptConversationsDeleteManyReq {
|
|
11
|
+
/** IDs that don't exist or aren't the caller's are skipped. */
|
|
12
|
+
conversation_ids: string[];
|
|
13
|
+
}
|
|
@@ -1 +1,3 @@
|
|
|
1
|
+
export { type ChrtGptConversationsDeleteManyReq } from "./ChrtGptConversationsDeleteManyReq.js";
|
|
1
2
|
export { type ConversationsListV1Request } from "./ConversationsListV1Request.js";
|
|
3
|
+
export { type ChrtGptConversationsUpdateTitleReq } from "./ChrtGptConversationsUpdateTitleReq.js";
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* Last event of a successful stream.
|
|
6
6
|
*/
|
|
7
7
|
export interface ChrtGptCompletedEvent {
|
|
8
|
+
/** When context_tokens passes this, ChrtGPT compacts older turns and context_tokens drops. */
|
|
9
|
+
context_limit_tokens: number;
|
|
10
|
+
/** Tokens of context ChrtGPT carries into the next turn. On a turn that compacted, this is the size before compaction, so it can exceed context_limit_tokens once. */
|
|
11
|
+
context_tokens: number;
|
|
8
12
|
conversation_id: string;
|
|
9
13
|
/** The turn's final message. Earlier messages in the turn only arrive as text deltas. */
|
|
10
14
|
response_text: string;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../index.js";
|
|
4
5
|
export interface ChrtGptConversation1 {
|
|
5
6
|
_id: string;
|
|
7
|
+
awb_numbers?: string[];
|
|
8
|
+
context_tokens?: number | null;
|
|
6
9
|
created_at: string;
|
|
10
|
+
off_chrt_reference_ids?: string[];
|
|
11
|
+
order_short_ids?: string[];
|
|
7
12
|
/** Must be a string starting with `org_` */
|
|
8
13
|
org_id: string;
|
|
9
14
|
schema_version: number;
|
|
15
|
+
summarized_turn_count?: number;
|
|
16
|
+
summary?: string | null;
|
|
10
17
|
title: string;
|
|
18
|
+
title_source: Chrt.ChrtGptConversationTitleSourceEnum1;
|
|
11
19
|
updated_at: string;
|
|
12
20
|
/** Must be a string starting with `user_` */
|
|
13
21
|
user_id: string;
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Chrt from "../index.js";
|
|
5
5
|
export interface ChrtGptConversationRes {
|
|
6
|
+
/** The limit for conversation.context_tokens, as on the completed event. */
|
|
7
|
+
context_limit_tokens: number;
|
|
6
8
|
conversation: Chrt.ChrtGptConversation1;
|
|
7
|
-
/** The conversation's history, oldest first. Reasoning
|
|
9
|
+
/** The conversation's history, oldest first. Reasoning and compaction items are omitted. */
|
|
8
10
|
items: Chrt.ChrtGptHistoryItem[];
|
|
9
11
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export type ChrtGptConversationTitleSourceEnum1 = "fallback" | "ai" | "user";
|
|
5
|
+
export declare const ChrtGptConversationTitleSourceEnum1: {
|
|
6
|
+
readonly Fallback: "fallback";
|
|
7
|
+
readonly Ai: "ai";
|
|
8
|
+
readonly User: "user";
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChrtGptConversationTitleSourceEnum1 = void 0;
|
|
7
|
+
exports.ChrtGptConversationTitleSourceEnum1 = {
|
|
8
|
+
Fallback: "fallback",
|
|
9
|
+
Ai: "ai",
|
|
10
|
+
User: "user",
|
|
11
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Chrt from "../index.js";
|
|
5
|
-
export type ChrtGptEvent = Chrt.ChrtGptEvent.Completed | Chrt.ChrtGptEvent.Error_ | Chrt.ChrtGptEvent.Started | Chrt.ChrtGptEvent.TextDelta | Chrt.ChrtGptEvent.
|
|
5
|
+
export type ChrtGptEvent = Chrt.ChrtGptEvent.Completed | Chrt.ChrtGptEvent.Error_ | Chrt.ChrtGptEvent.Started | Chrt.ChrtGptEvent.TextDelta | Chrt.ChrtGptEvent.ToolCalled | Chrt.ChrtGptEvent.ToolOutput | Chrt.ChrtGptEvent.WebSearch;
|
|
6
6
|
export declare namespace ChrtGptEvent {
|
|
7
7
|
interface Completed extends Chrt.ChrtGptCompletedEvent {
|
|
8
8
|
type: "completed";
|
|
@@ -16,9 +16,6 @@ export declare namespace ChrtGptEvent {
|
|
|
16
16
|
interface TextDelta extends Chrt.ChrtGptTextDeltaEvent {
|
|
17
17
|
type: "text_delta";
|
|
18
18
|
}
|
|
19
|
-
interface Title extends Chrt.ChrtGptTitleEvent {
|
|
20
|
-
type: "title";
|
|
21
|
-
}
|
|
22
19
|
interface ToolCalled extends Chrt.ChrtGptToolCalledEvent {
|
|
23
20
|
type: "tool_called";
|
|
24
21
|
}
|
|
@@ -210,12 +210,13 @@ export * from "./ChrtGptConversation1.js";
|
|
|
210
210
|
export * from "./ChrtGptConversationListRes.js";
|
|
211
211
|
export * from "./ChrtGptConversationRes.js";
|
|
212
212
|
export * from "./ChrtGptConversationSortByEnum.js";
|
|
213
|
+
export * from "./ChrtGptConversationTitleSourceEnum1.js";
|
|
214
|
+
export * from "./ChrtGptConversationsDeleteManyRes.js";
|
|
213
215
|
export * from "./ChrtGptErrorEvent.js";
|
|
214
216
|
export * from "./ChrtGptEvent.js";
|
|
215
217
|
export * from "./ChrtGptHistoryItem.js";
|
|
216
218
|
export * from "./ChrtGptStartedEvent.js";
|
|
217
219
|
export * from "./ChrtGptTextDeltaEvent.js";
|
|
218
|
-
export * from "./ChrtGptTitleEvent.js";
|
|
219
220
|
export * from "./ChrtGptToolCalledEvent.js";
|
|
220
221
|
export * from "./ChrtGptToolOutputEvent.js";
|
|
221
222
|
export * from "./ChrtGptUserMessageItem.js";
|
|
@@ -226,12 +226,13 @@ __exportStar(require("./ChrtGptConversation1.js"), exports);
|
|
|
226
226
|
__exportStar(require("./ChrtGptConversationListRes.js"), exports);
|
|
227
227
|
__exportStar(require("./ChrtGptConversationRes.js"), exports);
|
|
228
228
|
__exportStar(require("./ChrtGptConversationSortByEnum.js"), exports);
|
|
229
|
+
__exportStar(require("./ChrtGptConversationTitleSourceEnum1.js"), exports);
|
|
230
|
+
__exportStar(require("./ChrtGptConversationsDeleteManyRes.js"), exports);
|
|
229
231
|
__exportStar(require("./ChrtGptErrorEvent.js"), exports);
|
|
230
232
|
__exportStar(require("./ChrtGptEvent.js"), exports);
|
|
231
233
|
__exportStar(require("./ChrtGptHistoryItem.js"), exports);
|
|
232
234
|
__exportStar(require("./ChrtGptStartedEvent.js"), exports);
|
|
233
235
|
__exportStar(require("./ChrtGptTextDeltaEvent.js"), exports);
|
|
234
|
-
__exportStar(require("./ChrtGptTitleEvent.js"), exports);
|
|
235
236
|
__exportStar(require("./ChrtGptToolCalledEvent.js"), exports);
|
|
236
237
|
__exportStar(require("./ChrtGptToolOutputEvent.js"), exports);
|
|
237
238
|
__exportStar(require("./ChrtGptUserMessageItem.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.1027.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -26,8 +26,8 @@ export class ChrtClient {
|
|
|
26
26
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
27
27
|
"X-Fern-Language": "JavaScript",
|
|
28
28
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
29
|
-
"X-Fern-SDK-Version": "1.
|
|
30
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
29
|
+
"X-Fern-SDK-Version": "1.1027.0",
|
|
30
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.1027.0",
|
|
31
31
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
32
32
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
33
33
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -34,7 +34,7 @@ export declare class ChrtGpt {
|
|
|
34
34
|
constructor(_options?: ChrtGpt.Options);
|
|
35
35
|
get conversations(): Conversations;
|
|
36
36
|
/**
|
|
37
|
-
* Sends a message to ChrtGPT and streams its reply, starting
|
|
37
|
+
* Sends a message to ChrtGPT and streams its reply, starting a new conversation when no conversation_id is given. In the background, retitles the conversation after each of its first 3 turns and updates its summary and order identifiers after every turn. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTReq) -> (stream[ChrtGPTEvent])
|
|
38
38
|
*/
|
|
39
39
|
postV1(request: Chrt.ChrtGptReq, requestOptions?: ChrtGpt.RequestOptions): core.HttpResponsePromise<core.Stream<Chrt.ChrtGptEvent>>;
|
|
40
40
|
private __postV1;
|
|
@@ -25,7 +25,7 @@ export class ChrtGpt {
|
|
|
25
25
|
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new Conversations(this._options)));
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Sends a message to ChrtGPT and streams its reply, starting
|
|
28
|
+
* Sends a message to ChrtGPT and streams its reply, starting a new conversation when no conversation_id is given. In the background, retitles the conversation after each of its first 3 turns and updates its summary and order identifiers after every turn. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTReq) -> (stream[ChrtGPTEvent])
|
|
29
29
|
*/
|
|
30
30
|
postV1(request, requestOptions) {
|
|
31
31
|
return core.HttpResponsePromise.fromPromise(this.__postV1(request, requestOptions));
|
|
@@ -11,4 +11,28 @@ export interface ChrtGptReq {
|
|
|
11
11
|
/** Omit to start a new conversation. */
|
|
12
12
|
conversation_id?: string | null;
|
|
13
13
|
message: string;
|
|
14
|
+
/** How much ChrtGPT reasons before answering this message. Higher is slower and more thorough. */
|
|
15
|
+
reasoning_effort?: ChrtGptReq.ReasoningEffort;
|
|
16
|
+
/** How long and detailed ChrtGPT's reply is. */
|
|
17
|
+
verbosity?: ChrtGptReq.Verbosity;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace ChrtGptReq {
|
|
20
|
+
/**
|
|
21
|
+
* How much ChrtGPT reasons before answering this message. Higher is slower and more thorough.
|
|
22
|
+
*/
|
|
23
|
+
type ReasoningEffort = "low" | "medium" | "high";
|
|
24
|
+
const ReasoningEffort: {
|
|
25
|
+
readonly Low: "low";
|
|
26
|
+
readonly Medium: "medium";
|
|
27
|
+
readonly High: "high";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* How long and detailed ChrtGPT's reply is.
|
|
31
|
+
*/
|
|
32
|
+
type Verbosity = "low" | "medium" | "high";
|
|
33
|
+
const Verbosity: {
|
|
34
|
+
readonly Low: "low";
|
|
35
|
+
readonly Medium: "medium";
|
|
36
|
+
readonly High: "high";
|
|
37
|
+
};
|
|
14
38
|
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export var ChrtGptReq;
|
|
5
|
+
(function (ChrtGptReq) {
|
|
6
|
+
ChrtGptReq.ReasoningEffort = {
|
|
7
|
+
Low: "low",
|
|
8
|
+
Medium: "medium",
|
|
9
|
+
High: "high",
|
|
10
|
+
};
|
|
11
|
+
ChrtGptReq.Verbosity = {
|
|
12
|
+
Low: "low",
|
|
13
|
+
Medium: "medium",
|
|
14
|
+
High: "high",
|
|
15
|
+
};
|
|
16
|
+
})(ChrtGptReq || (ChrtGptReq = {}));
|
|
@@ -30,6 +30,21 @@ export declare namespace Conversations {
|
|
|
30
30
|
export declare class Conversations {
|
|
31
31
|
protected readonly _options: Conversations.Options;
|
|
32
32
|
constructor(_options?: Conversations.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Permanently deletes the caller's ChrtGPT conversations and their history, skipping IDs that don't exist or aren't the caller's. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsDeleteManyReq) -> (ChrtGPTConversationsDeleteManyRes)
|
|
35
|
+
*
|
|
36
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsDeleteManyReq} request
|
|
37
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.chrtGpt.conversations.deleteManyV1({
|
|
43
|
+
* conversation_ids: ["conversation_ids"]
|
|
44
|
+
* })
|
|
45
|
+
*/
|
|
46
|
+
deleteManyV1(request: Chrt.chrtGpt.ChrtGptConversationsDeleteManyReq, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversationsDeleteManyRes>;
|
|
47
|
+
private __deleteManyV1;
|
|
33
48
|
/**
|
|
34
49
|
* Lists the caller's ChrtGPT conversations, most recently active first by default. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationListRes)
|
|
35
50
|
*
|
|
@@ -48,6 +63,22 @@ export declare class Conversations {
|
|
|
48
63
|
*/
|
|
49
64
|
listV1(request?: Chrt.chrtGpt.ConversationsListV1Request, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversationListRes>;
|
|
50
65
|
private __listV1;
|
|
66
|
+
/**
|
|
67
|
+
* Renames one of the caller's ChrtGPT conversations; ChrtGPT never retitles it after that. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsUpdateTitleReq) -> (ChrtGPTConversation1)
|
|
68
|
+
*
|
|
69
|
+
* @param {string} conversationId
|
|
70
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq} request
|
|
71
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* await client.chrtGpt.conversations.updateTitleV1("conversation_id", {
|
|
77
|
+
* title: "title"
|
|
78
|
+
* })
|
|
79
|
+
*/
|
|
80
|
+
updateTitleV1(conversationId: string, request: Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversation1>;
|
|
81
|
+
private __updateTitleV1;
|
|
51
82
|
/**
|
|
52
83
|
* Gets one of the caller's ChrtGPT conversations with its history of messages, tool calls, and web searches. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationRes)
|
|
53
84
|
*
|
|
@@ -19,6 +19,73 @@ export class Conversations {
|
|
|
19
19
|
constructor(_options = {}) {
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Permanently deletes the caller's ChrtGPT conversations and their history, skipping IDs that don't exist or aren't the caller's. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsDeleteManyReq) -> (ChrtGPTConversationsDeleteManyRes)
|
|
24
|
+
*
|
|
25
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsDeleteManyReq} request
|
|
26
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.chrtGpt.conversations.deleteManyV1({
|
|
32
|
+
* conversation_ids: ["conversation_ids"]
|
|
33
|
+
* })
|
|
34
|
+
*/
|
|
35
|
+
deleteManyV1(request, requestOptions) {
|
|
36
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteManyV1(request, requestOptions));
|
|
37
|
+
}
|
|
38
|
+
__deleteManyV1(request, requestOptions) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
42
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
43
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "chrt_gpt/conversations/delete_many/v1"),
|
|
44
|
+
method: "DELETE",
|
|
45
|
+
headers: _headers,
|
|
46
|
+
contentType: "application/json",
|
|
47
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
48
|
+
requestType: "json",
|
|
49
|
+
body: request,
|
|
50
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
51
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
52
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
53
|
+
});
|
|
54
|
+
if (_response.ok) {
|
|
55
|
+
return {
|
|
56
|
+
data: _response.body,
|
|
57
|
+
rawResponse: _response.rawResponse,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (_response.error.reason === "status-code") {
|
|
61
|
+
switch (_response.error.statusCode) {
|
|
62
|
+
case 422:
|
|
63
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
64
|
+
default:
|
|
65
|
+
throw new errors.ChrtError({
|
|
66
|
+
statusCode: _response.error.statusCode,
|
|
67
|
+
body: _response.error.body,
|
|
68
|
+
rawResponse: _response.rawResponse,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
switch (_response.error.reason) {
|
|
73
|
+
case "non-json":
|
|
74
|
+
throw new errors.ChrtError({
|
|
75
|
+
statusCode: _response.error.statusCode,
|
|
76
|
+
body: _response.error.rawBody,
|
|
77
|
+
rawResponse: _response.rawResponse,
|
|
78
|
+
});
|
|
79
|
+
case "timeout":
|
|
80
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /chrt_gpt/conversations/delete_many/v1.");
|
|
81
|
+
case "unknown":
|
|
82
|
+
throw new errors.ChrtError({
|
|
83
|
+
message: _response.error.errorMessage,
|
|
84
|
+
rawResponse: _response.rawResponse,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
22
89
|
/**
|
|
23
90
|
* Lists the caller's ChrtGPT conversations, most recently active first by default. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationListRes)
|
|
24
91
|
*
|
|
@@ -97,6 +164,71 @@ export class Conversations {
|
|
|
97
164
|
}
|
|
98
165
|
});
|
|
99
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Renames one of the caller's ChrtGPT conversations; ChrtGPT never retitles it after that. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsUpdateTitleReq) -> (ChrtGPTConversation1)
|
|
169
|
+
*
|
|
170
|
+
* @param {string} conversationId
|
|
171
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq} request
|
|
172
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
|
+
*
|
|
174
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* await client.chrtGpt.conversations.updateTitleV1("conversation_id", {
|
|
178
|
+
* title: "title"
|
|
179
|
+
* })
|
|
180
|
+
*/
|
|
181
|
+
updateTitleV1(conversationId, request, requestOptions) {
|
|
182
|
+
return core.HttpResponsePromise.fromPromise(this.__updateTitleV1(conversationId, request, requestOptions));
|
|
183
|
+
}
|
|
184
|
+
__updateTitleV1(conversationId, request, requestOptions) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
var _a, _b, _c, _d;
|
|
187
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
188
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
189
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `chrt_gpt/conversations/update_title/v1/${encodeURIComponent(conversationId)}`),
|
|
190
|
+
method: "PATCH",
|
|
191
|
+
headers: _headers,
|
|
192
|
+
contentType: "application/json",
|
|
193
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
194
|
+
requestType: "json",
|
|
195
|
+
body: request,
|
|
196
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
197
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
198
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
199
|
+
});
|
|
200
|
+
if (_response.ok) {
|
|
201
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
202
|
+
}
|
|
203
|
+
if (_response.error.reason === "status-code") {
|
|
204
|
+
switch (_response.error.statusCode) {
|
|
205
|
+
case 422:
|
|
206
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
207
|
+
default:
|
|
208
|
+
throw new errors.ChrtError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.body,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
switch (_response.error.reason) {
|
|
216
|
+
case "non-json":
|
|
217
|
+
throw new errors.ChrtError({
|
|
218
|
+
statusCode: _response.error.statusCode,
|
|
219
|
+
body: _response.error.rawBody,
|
|
220
|
+
rawResponse: _response.rawResponse,
|
|
221
|
+
});
|
|
222
|
+
case "timeout":
|
|
223
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /chrt_gpt/conversations/update_title/v1/{conversation_id}.");
|
|
224
|
+
case "unknown":
|
|
225
|
+
throw new errors.ChrtError({
|
|
226
|
+
message: _response.error.errorMessage,
|
|
227
|
+
rawResponse: _response.rawResponse,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
100
232
|
/**
|
|
101
233
|
* Gets one of the caller's ChrtGPT conversations with its history of messages, tool calls, and web searches. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationRes)
|
|
102
234
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* conversation_ids: ["conversation_ids"]
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface ChrtGptConversationsDeleteManyReq {
|
|
11
|
+
/** IDs that don't exist or aren't the caller's are skipped. */
|
|
12
|
+
conversation_ids: string[];
|
|
13
|
+
}
|
|
@@ -1 +1,3 @@
|
|
|
1
|
+
export { type ChrtGptConversationsDeleteManyReq } from "./ChrtGptConversationsDeleteManyReq.mjs";
|
|
1
2
|
export { type ConversationsListV1Request } from "./ConversationsListV1Request.mjs";
|
|
3
|
+
export { type ChrtGptConversationsUpdateTitleReq } from "./ChrtGptConversationsUpdateTitleReq.mjs";
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* Last event of a successful stream.
|
|
6
6
|
*/
|
|
7
7
|
export interface ChrtGptCompletedEvent {
|
|
8
|
+
/** When context_tokens passes this, ChrtGPT compacts older turns and context_tokens drops. */
|
|
9
|
+
context_limit_tokens: number;
|
|
10
|
+
/** Tokens of context ChrtGPT carries into the next turn. On a turn that compacted, this is the size before compaction, so it can exceed context_limit_tokens once. */
|
|
11
|
+
context_tokens: number;
|
|
8
12
|
conversation_id: string;
|
|
9
13
|
/** The turn's final message. Earlier messages in the turn only arrive as text deltas. */
|
|
10
14
|
response_text: string;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
4
5
|
export interface ChrtGptConversation1 {
|
|
5
6
|
_id: string;
|
|
7
|
+
awb_numbers?: string[];
|
|
8
|
+
context_tokens?: number | null;
|
|
6
9
|
created_at: string;
|
|
10
|
+
off_chrt_reference_ids?: string[];
|
|
11
|
+
order_short_ids?: string[];
|
|
7
12
|
/** Must be a string starting with `org_` */
|
|
8
13
|
org_id: string;
|
|
9
14
|
schema_version: number;
|
|
15
|
+
summarized_turn_count?: number;
|
|
16
|
+
summary?: string | null;
|
|
10
17
|
title: string;
|
|
18
|
+
title_source: Chrt.ChrtGptConversationTitleSourceEnum1;
|
|
11
19
|
updated_at: string;
|
|
12
20
|
/** Must be a string starting with `user_` */
|
|
13
21
|
user_id: string;
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Chrt from "../index.mjs";
|
|
5
5
|
export interface ChrtGptConversationRes {
|
|
6
|
+
/** The limit for conversation.context_tokens, as on the completed event. */
|
|
7
|
+
context_limit_tokens: number;
|
|
6
8
|
conversation: Chrt.ChrtGptConversation1;
|
|
7
|
-
/** The conversation's history, oldest first. Reasoning
|
|
9
|
+
/** The conversation's history, oldest first. Reasoning and compaction items are omitted. */
|
|
8
10
|
items: Chrt.ChrtGptHistoryItem[];
|
|
9
11
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export type ChrtGptConversationTitleSourceEnum1 = "fallback" | "ai" | "user";
|
|
5
|
+
export declare const ChrtGptConversationTitleSourceEnum1: {
|
|
6
|
+
readonly Fallback: "fallback";
|
|
7
|
+
readonly Ai: "ai";
|
|
8
|
+
readonly User: "user";
|
|
9
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Chrt from "../index.mjs";
|
|
5
|
-
export type ChrtGptEvent = Chrt.ChrtGptEvent.Completed | Chrt.ChrtGptEvent.Error_ | Chrt.ChrtGptEvent.Started | Chrt.ChrtGptEvent.TextDelta | Chrt.ChrtGptEvent.
|
|
5
|
+
export type ChrtGptEvent = Chrt.ChrtGptEvent.Completed | Chrt.ChrtGptEvent.Error_ | Chrt.ChrtGptEvent.Started | Chrt.ChrtGptEvent.TextDelta | Chrt.ChrtGptEvent.ToolCalled | Chrt.ChrtGptEvent.ToolOutput | Chrt.ChrtGptEvent.WebSearch;
|
|
6
6
|
export declare namespace ChrtGptEvent {
|
|
7
7
|
interface Completed extends Chrt.ChrtGptCompletedEvent {
|
|
8
8
|
type: "completed";
|
|
@@ -16,9 +16,6 @@ export declare namespace ChrtGptEvent {
|
|
|
16
16
|
interface TextDelta extends Chrt.ChrtGptTextDeltaEvent {
|
|
17
17
|
type: "text_delta";
|
|
18
18
|
}
|
|
19
|
-
interface Title extends Chrt.ChrtGptTitleEvent {
|
|
20
|
-
type: "title";
|
|
21
|
-
}
|
|
22
19
|
interface ToolCalled extends Chrt.ChrtGptToolCalledEvent {
|
|
23
20
|
type: "tool_called";
|
|
24
21
|
}
|
|
@@ -210,12 +210,13 @@ export * from "./ChrtGptConversation1.mjs";
|
|
|
210
210
|
export * from "./ChrtGptConversationListRes.mjs";
|
|
211
211
|
export * from "./ChrtGptConversationRes.mjs";
|
|
212
212
|
export * from "./ChrtGptConversationSortByEnum.mjs";
|
|
213
|
+
export * from "./ChrtGptConversationTitleSourceEnum1.mjs";
|
|
214
|
+
export * from "./ChrtGptConversationsDeleteManyRes.mjs";
|
|
213
215
|
export * from "./ChrtGptErrorEvent.mjs";
|
|
214
216
|
export * from "./ChrtGptEvent.mjs";
|
|
215
217
|
export * from "./ChrtGptHistoryItem.mjs";
|
|
216
218
|
export * from "./ChrtGptStartedEvent.mjs";
|
|
217
219
|
export * from "./ChrtGptTextDeltaEvent.mjs";
|
|
218
|
-
export * from "./ChrtGptTitleEvent.mjs";
|
|
219
220
|
export * from "./ChrtGptToolCalledEvent.mjs";
|
|
220
221
|
export * from "./ChrtGptToolOutputEvent.mjs";
|
|
221
222
|
export * from "./ChrtGptUserMessageItem.mjs";
|
|
@@ -210,12 +210,13 @@ export * from "./ChrtGptConversation1.mjs";
|
|
|
210
210
|
export * from "./ChrtGptConversationListRes.mjs";
|
|
211
211
|
export * from "./ChrtGptConversationRes.mjs";
|
|
212
212
|
export * from "./ChrtGptConversationSortByEnum.mjs";
|
|
213
|
+
export * from "./ChrtGptConversationTitleSourceEnum1.mjs";
|
|
214
|
+
export * from "./ChrtGptConversationsDeleteManyRes.mjs";
|
|
213
215
|
export * from "./ChrtGptErrorEvent.mjs";
|
|
214
216
|
export * from "./ChrtGptEvent.mjs";
|
|
215
217
|
export * from "./ChrtGptHistoryItem.mjs";
|
|
216
218
|
export * from "./ChrtGptStartedEvent.mjs";
|
|
217
219
|
export * from "./ChrtGptTextDeltaEvent.mjs";
|
|
218
|
-
export * from "./ChrtGptTitleEvent.mjs";
|
|
219
220
|
export * from "./ChrtGptToolCalledEvent.mjs";
|
|
220
221
|
export * from "./ChrtGptToolOutputEvent.mjs";
|
|
221
222
|
export * from "./ChrtGptUserMessageItem.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.1027.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.1027.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<dl>
|
|
15
15
|
<dd>
|
|
16
16
|
|
|
17
|
-
Sends a message to ChrtGPT and streams its reply, starting
|
|
17
|
+
Sends a message to ChrtGPT and streams its reply, starting a new conversation when no conversation_id is given. In the background, retitles the conversation after each of its first 3 turns and updates its summary and order identifiers after every turn. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTReq) -> (stream[ChrtGPTEvent])
|
|
18
18
|
|
|
19
19
|
</dd>
|
|
20
20
|
</dl>
|
|
@@ -5203,6 +5203,71 @@ await client.cargoOnFlightIntegrations.cargoai.searchV1("cargo_on_flight_booking
|
|
|
5203
5203
|
|
|
5204
5204
|
## ChrtGpt Conversations
|
|
5205
5205
|
|
|
5206
|
+
<details><summary><code>client.chrtGpt.conversations.<a href="/src/api/resources/chrtGpt/resources/conversations/client/Client.ts">deleteManyV1</a>({ ...params }) -> Chrt.ChrtGptConversationsDeleteManyRes</code></summary>
|
|
5207
|
+
<dl>
|
|
5208
|
+
<dd>
|
|
5209
|
+
|
|
5210
|
+
#### 📝 Description
|
|
5211
|
+
|
|
5212
|
+
<dl>
|
|
5213
|
+
<dd>
|
|
5214
|
+
|
|
5215
|
+
<dl>
|
|
5216
|
+
<dd>
|
|
5217
|
+
|
|
5218
|
+
Permanently deletes the caller's ChrtGPT conversations and their history, skipping IDs that don't exist or aren't the caller's. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsDeleteManyReq) -> (ChrtGPTConversationsDeleteManyRes)
|
|
5219
|
+
|
|
5220
|
+
</dd>
|
|
5221
|
+
</dl>
|
|
5222
|
+
</dd>
|
|
5223
|
+
</dl>
|
|
5224
|
+
|
|
5225
|
+
#### 🔌 Usage
|
|
5226
|
+
|
|
5227
|
+
<dl>
|
|
5228
|
+
<dd>
|
|
5229
|
+
|
|
5230
|
+
<dl>
|
|
5231
|
+
<dd>
|
|
5232
|
+
|
|
5233
|
+
```typescript
|
|
5234
|
+
await client.chrtGpt.conversations.deleteManyV1({
|
|
5235
|
+
conversation_ids: ["conversation_ids"],
|
|
5236
|
+
});
|
|
5237
|
+
```
|
|
5238
|
+
|
|
5239
|
+
</dd>
|
|
5240
|
+
</dl>
|
|
5241
|
+
</dd>
|
|
5242
|
+
</dl>
|
|
5243
|
+
|
|
5244
|
+
#### ⚙️ Parameters
|
|
5245
|
+
|
|
5246
|
+
<dl>
|
|
5247
|
+
<dd>
|
|
5248
|
+
|
|
5249
|
+
<dl>
|
|
5250
|
+
<dd>
|
|
5251
|
+
|
|
5252
|
+
**request:** `Chrt.chrtGpt.ChrtGptConversationsDeleteManyReq`
|
|
5253
|
+
|
|
5254
|
+
</dd>
|
|
5255
|
+
</dl>
|
|
5256
|
+
|
|
5257
|
+
<dl>
|
|
5258
|
+
<dd>
|
|
5259
|
+
|
|
5260
|
+
**requestOptions:** `Conversations.RequestOptions`
|
|
5261
|
+
|
|
5262
|
+
</dd>
|
|
5263
|
+
</dl>
|
|
5264
|
+
</dd>
|
|
5265
|
+
</dl>
|
|
5266
|
+
|
|
5267
|
+
</dd>
|
|
5268
|
+
</dl>
|
|
5269
|
+
</details>
|
|
5270
|
+
|
|
5206
5271
|
<details><summary><code>client.chrtGpt.conversations.<a href="/src/api/resources/chrtGpt/resources/conversations/client/Client.ts">listV1</a>({ ...params }) -> Chrt.ChrtGptConversationListRes</code></summary>
|
|
5207
5272
|
<dl>
|
|
5208
5273
|
<dd>
|
|
@@ -5271,6 +5336,79 @@ await client.chrtGpt.conversations.listV1({
|
|
|
5271
5336
|
</dl>
|
|
5272
5337
|
</details>
|
|
5273
5338
|
|
|
5339
|
+
<details><summary><code>client.chrtGpt.conversations.<a href="/src/api/resources/chrtGpt/resources/conversations/client/Client.ts">updateTitleV1</a>(conversationId, { ...params }) -> Chrt.ChrtGptConversation1</code></summary>
|
|
5340
|
+
<dl>
|
|
5341
|
+
<dd>
|
|
5342
|
+
|
|
5343
|
+
#### 📝 Description
|
|
5344
|
+
|
|
5345
|
+
<dl>
|
|
5346
|
+
<dd>
|
|
5347
|
+
|
|
5348
|
+
<dl>
|
|
5349
|
+
<dd>
|
|
5350
|
+
|
|
5351
|
+
Renames one of the caller's ChrtGPT conversations; ChrtGPT never retitles it after that. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTConversationsUpdateTitleReq) -> (ChrtGPTConversation1)
|
|
5352
|
+
|
|
5353
|
+
</dd>
|
|
5354
|
+
</dl>
|
|
5355
|
+
</dd>
|
|
5356
|
+
</dl>
|
|
5357
|
+
|
|
5358
|
+
#### 🔌 Usage
|
|
5359
|
+
|
|
5360
|
+
<dl>
|
|
5361
|
+
<dd>
|
|
5362
|
+
|
|
5363
|
+
<dl>
|
|
5364
|
+
<dd>
|
|
5365
|
+
|
|
5366
|
+
```typescript
|
|
5367
|
+
await client.chrtGpt.conversations.updateTitleV1("conversation_id", {
|
|
5368
|
+
title: "title",
|
|
5369
|
+
});
|
|
5370
|
+
```
|
|
5371
|
+
|
|
5372
|
+
</dd>
|
|
5373
|
+
</dl>
|
|
5374
|
+
</dd>
|
|
5375
|
+
</dl>
|
|
5376
|
+
|
|
5377
|
+
#### ⚙️ Parameters
|
|
5378
|
+
|
|
5379
|
+
<dl>
|
|
5380
|
+
<dd>
|
|
5381
|
+
|
|
5382
|
+
<dl>
|
|
5383
|
+
<dd>
|
|
5384
|
+
|
|
5385
|
+
**conversationId:** `string`
|
|
5386
|
+
|
|
5387
|
+
</dd>
|
|
5388
|
+
</dl>
|
|
5389
|
+
|
|
5390
|
+
<dl>
|
|
5391
|
+
<dd>
|
|
5392
|
+
|
|
5393
|
+
**request:** `Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq`
|
|
5394
|
+
|
|
5395
|
+
</dd>
|
|
5396
|
+
</dl>
|
|
5397
|
+
|
|
5398
|
+
<dl>
|
|
5399
|
+
<dd>
|
|
5400
|
+
|
|
5401
|
+
**requestOptions:** `Conversations.RequestOptions`
|
|
5402
|
+
|
|
5403
|
+
</dd>
|
|
5404
|
+
</dl>
|
|
5405
|
+
</dd>
|
|
5406
|
+
</dl>
|
|
5407
|
+
|
|
5408
|
+
</dd>
|
|
5409
|
+
</dl>
|
|
5410
|
+
</details>
|
|
5411
|
+
|
|
5274
5412
|
<details><summary><code>client.chrtGpt.conversations.<a href="/src/api/resources/chrtGpt/resources/conversations/client/Client.ts">getV1</a>(conversationId) -> Chrt.ChrtGptConversationRes</code></summary>
|
|
5275
5413
|
<dl>
|
|
5276
5414
|
<dd>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Sent once, on a new conversation's first turn, right before completed or error.
|
|
6
|
-
*/
|
|
7
|
-
export interface ChrtGptTitleEvent {
|
|
8
|
-
conversation_id: string;
|
|
9
|
-
/** The conversation's saved title. */
|
|
10
|
-
title: string;
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Sent once, on a new conversation's first turn, right before completed or error.
|
|
6
|
-
*/
|
|
7
|
-
export interface ChrtGptTitleEvent {
|
|
8
|
-
conversation_id: string;
|
|
9
|
-
/** The conversation's saved title. */
|
|
10
|
-
title: string;
|
|
11
|
-
}
|
|
File without changes
|