@chrt-inc/typescript-sdk 1.1025.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/README.md +12 -9
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/chrtGpt/client/Client.d.ts +6 -13
- package/dist/cjs/api/resources/chrtGpt/client/Client.js +24 -17
- package/dist/cjs/api/resources/chrtGpt/client/requests/ChrtGptReq.d.ts +38 -0
- package/dist/cjs/api/resources/chrtGpt/client/requests/ChrtGptReq.js +19 -0
- package/dist/cjs/api/resources/chrtGpt/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/chrtGpt/index.d.ts +1 -0
- package/dist/cjs/api/resources/chrtGpt/index.js +1 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.d.ts +96 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.js +337 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.js +17 -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/ConversationsListV1Request.d.ts +21 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.js +5 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.d.ts +1 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.js +17 -0
- package/dist/cjs/api/resources/chrtGpt/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/index.js +41 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.js +1 -0
- package/dist/cjs/api/types/ChrtGptAssistantMessageItem.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptAssistantMessageItem.js +5 -0
- package/dist/cjs/api/types/ChrtGptCompletedEvent.d.ts +15 -0
- package/dist/cjs/api/types/ChrtGptCompletedEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversation1.d.ts +22 -0
- package/dist/cjs/api/types/ChrtGptConversation1.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationListRes.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptConversationListRes.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationRes.d.ts +11 -0
- package/dist/cjs/api/types/ChrtGptConversationRes.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationSortByEnum.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptConversationSortByEnum.js +10 -0
- 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/ChrtGptErrorEvent.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptErrorEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptEvent.d.ts +28 -0
- package/dist/cjs/api/types/ChrtGptEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptHistoryItem.d.ts +22 -0
- package/dist/cjs/api/types/ChrtGptHistoryItem.js +5 -0
- package/dist/{esm/api/types/ChrtGptMessageRes.d.mts → cjs/api/types/ChrtGptStartedEvent.d.ts} +4 -2
- package/dist/cjs/api/types/ChrtGptStartedEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptTextDeltaEvent.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptTextDeltaEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptToolCalledEvent.d.ts +12 -0
- package/dist/cjs/api/types/ChrtGptToolCalledEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptToolOutputEvent.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptToolOutputEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptUserMessageItem.d.ts +6 -0
- package/dist/cjs/api/types/ChrtGptUserMessageItem.js +5 -0
- package/dist/cjs/api/types/ChrtGptWebSearchEvent.d.ts +18 -0
- package/dist/cjs/api/types/ChrtGptWebSearchEvent.js +5 -0
- package/dist/cjs/api/types/index.d.ts +17 -1
- package/dist/cjs/api/types/index.js +17 -1
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +1 -0
- package/dist/cjs/core/stream/Stream.d.ts +46 -0
- package/dist/cjs/core/stream/Stream.js +169 -0
- package/dist/cjs/core/stream/index.d.ts +1 -0
- package/dist/cjs/core/stream/index.js +5 -0
- 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 +6 -13
- package/dist/esm/api/resources/chrtGpt/client/Client.mjs +24 -17
- package/dist/esm/api/resources/chrtGpt/client/requests/ChrtGptReq.d.mts +38 -0
- package/dist/esm/api/resources/chrtGpt/client/requests/ChrtGptReq.mjs +16 -0
- package/dist/esm/api/resources/chrtGpt/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/chrtGpt/index.d.mts +1 -0
- package/dist/esm/api/resources/chrtGpt/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.d.mts +96 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.mjs +300 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.d.mts +2 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.mjs +1 -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/ConversationsListV1Request.d.mts +21 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.mjs +4 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/index.d.mts +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/chrtGpt/resources/index.mjs +2 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.mjs +1 -0
- package/dist/esm/api/types/ChrtGptAssistantMessageItem.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptAssistantMessageItem.mjs +4 -0
- package/dist/esm/api/types/ChrtGptCompletedEvent.d.mts +15 -0
- package/dist/esm/api/types/ChrtGptCompletedEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversation1.d.mts +22 -0
- package/dist/esm/api/types/ChrtGptConversation1.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationListRes.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptConversationListRes.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationRes.d.mts +11 -0
- package/dist/esm/api/types/ChrtGptConversationRes.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationSortByEnum.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptConversationSortByEnum.mjs +7 -0
- 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/ChrtGptErrorEvent.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptErrorEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptEvent.d.mts +28 -0
- package/dist/esm/api/types/ChrtGptEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptHistoryItem.d.mts +22 -0
- package/dist/esm/api/types/ChrtGptHistoryItem.mjs +4 -0
- package/dist/{cjs/api/types/ChrtGptMessageRes.d.ts → esm/api/types/ChrtGptStartedEvent.d.mts} +4 -2
- package/dist/esm/api/types/ChrtGptStartedEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptTextDeltaEvent.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptTextDeltaEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptToolCalledEvent.d.mts +12 -0
- package/dist/esm/api/types/ChrtGptToolCalledEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptToolOutputEvent.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptToolOutputEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptUserMessageItem.d.mts +6 -0
- package/dist/esm/api/types/ChrtGptUserMessageItem.mjs +4 -0
- package/dist/esm/api/types/ChrtGptWebSearchEvent.d.mts +18 -0
- package/dist/esm/api/types/ChrtGptWebSearchEvent.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +17 -1
- package/dist/esm/api/types/index.mjs +17 -1
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/stream/Stream.d.mts +46 -0
- package/dist/esm/core/stream/Stream.mjs +164 -0
- package/dist/esm/core/stream/index.d.mts +1 -0
- package/dist/esm/core/stream/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +279 -4
- package/dist/cjs/api/resources/chrtGpt/client/requests/ChrtGptMessageReq.d.ts +0 -14
- package/dist/esm/api/resources/chrtGpt/client/requests/ChrtGptMessageReq.d.mts +0 -14
- /package/dist/cjs/api/resources/chrtGpt/{client/requests/ChrtGptMessageReq.js → resources/conversations/client/requests/ChrtGptConversationsDeleteManyReq.js} +0 -0
- /package/dist/cjs/api/{types/ChrtGptMessageRes.js → resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsUpdateTitleReq.js} +0 -0
- /package/dist/esm/api/resources/chrtGpt/{client/requests/ChrtGptMessageReq.mjs → resources/conversations/client/requests/ChrtGptConversationsDeleteManyReq.mjs} +0 -0
- /package/dist/esm/api/{types/ChrtGptMessageRes.mjs → resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsUpdateTitleReq.mjs} +0 -0
|
@@ -15,44 +15,51 @@ import * as core from "../../../../core/index.mjs";
|
|
|
15
15
|
import * as Chrt from "../../../index.mjs";
|
|
16
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
18
|
+
import { Conversations } from "../resources/conversations/client/Client.mjs";
|
|
18
19
|
export class ChrtGpt {
|
|
19
20
|
constructor(_options = {}) {
|
|
20
21
|
this._options = _options;
|
|
21
22
|
}
|
|
23
|
+
get conversations() {
|
|
24
|
+
var _a;
|
|
25
|
+
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new Conversations(this._options)));
|
|
26
|
+
}
|
|
22
27
|
/**
|
|
23
|
-
* Sends a message to ChrtGPT and
|
|
24
|
-
*
|
|
25
|
-
* @param {Chrt.ChrtGptMessageReq} request
|
|
26
|
-
* @param {ChrtGpt.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
-
*
|
|
28
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* await client.chrtGpt.messageV1({
|
|
32
|
-
* message: "message"
|
|
33
|
-
* })
|
|
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])
|
|
34
29
|
*/
|
|
35
|
-
|
|
36
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
30
|
+
postV1(request, requestOptions) {
|
|
31
|
+
return core.HttpResponsePromise.fromPromise(this.__postV1(request, requestOptions));
|
|
37
32
|
}
|
|
38
|
-
|
|
33
|
+
__postV1(request, requestOptions) {
|
|
39
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
35
|
var _a, _b, _c, _d;
|
|
41
36
|
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
37
|
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/
|
|
38
|
+
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/v1"),
|
|
44
39
|
method: "POST",
|
|
45
40
|
headers: _headers,
|
|
46
41
|
contentType: "application/json",
|
|
47
42
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
48
43
|
requestType: "json",
|
|
49
44
|
body: request,
|
|
45
|
+
responseType: "sse",
|
|
50
46
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
51
47
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
52
48
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
53
49
|
});
|
|
54
50
|
if (_response.ok) {
|
|
55
|
-
return {
|
|
51
|
+
return {
|
|
52
|
+
data: new core.Stream({
|
|
53
|
+
stream: _response.body,
|
|
54
|
+
parse: (data) => data,
|
|
55
|
+
signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
|
+
eventShape: {
|
|
57
|
+
type: "sse",
|
|
58
|
+
streamTerminator: "[DONE]",
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
rawResponse: _response.rawResponse,
|
|
62
|
+
};
|
|
56
63
|
}
|
|
57
64
|
if (_response.error.reason === "status-code") {
|
|
58
65
|
switch (_response.error.statusCode) {
|
|
@@ -74,7 +81,7 @@ export class ChrtGpt {
|
|
|
74
81
|
rawResponse: _response.rawResponse,
|
|
75
82
|
});
|
|
76
83
|
case "timeout":
|
|
77
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /chrt_gpt/
|
|
84
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /chrt_gpt/v1.");
|
|
78
85
|
case "unknown":
|
|
79
86
|
throw new errors.ChrtError({
|
|
80
87
|
message: _response.error.errorMessage,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* message: "message"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface ChrtGptReq {
|
|
11
|
+
/** Omit to start a new conversation. */
|
|
12
|
+
conversation_id?: string | null;
|
|
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
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
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 = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { type
|
|
1
|
+
export { type ChrtGptReq } from "./ChrtGptReq.mjs";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
6
|
+
import * as Chrt from "../../../../../index.mjs";
|
|
7
|
+
export declare namespace Conversations {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
+
fetcher?: core.FetchFunction;
|
|
16
|
+
}
|
|
17
|
+
interface RequestOptions {
|
|
18
|
+
/** The maximum time to wait for a response in seconds. */
|
|
19
|
+
timeoutInSeconds?: number;
|
|
20
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
/** A hook to abort the request. */
|
|
23
|
+
abortSignal?: AbortSignal;
|
|
24
|
+
/** Additional query string parameters to include in the request. */
|
|
25
|
+
queryParams?: Record<string, unknown>;
|
|
26
|
+
/** Additional headers to include in the request. */
|
|
27
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare class Conversations {
|
|
31
|
+
protected readonly _options: Conversations.Options;
|
|
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;
|
|
48
|
+
/**
|
|
49
|
+
* Lists the caller's ChrtGPT conversations, most recently active first by default. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationListRes)
|
|
50
|
+
*
|
|
51
|
+
* @param {Chrt.chrtGpt.ConversationsListV1Request} request
|
|
52
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* await client.chrtGpt.conversations.listV1({
|
|
58
|
+
* sort_by: "updated_at",
|
|
59
|
+
* sort_order: "asc",
|
|
60
|
+
* page: 1,
|
|
61
|
+
* page_size: 1
|
|
62
|
+
* })
|
|
63
|
+
*/
|
|
64
|
+
listV1(request?: Chrt.chrtGpt.ConversationsListV1Request, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversationListRes>;
|
|
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;
|
|
82
|
+
/**
|
|
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)
|
|
84
|
+
*
|
|
85
|
+
* @param {string} conversationId
|
|
86
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
87
|
+
*
|
|
88
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* await client.chrtGpt.conversations.getV1("conversation_id")
|
|
92
|
+
*/
|
|
93
|
+
getV1(conversationId: string, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversationRes>;
|
|
94
|
+
private __getV1;
|
|
95
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
96
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
18
|
+
export class Conversations {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
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
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Lists the caller's ChrtGPT conversations, most recently active first by default. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationListRes)
|
|
91
|
+
*
|
|
92
|
+
* @param {Chrt.chrtGpt.ConversationsListV1Request} request
|
|
93
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
94
|
+
*
|
|
95
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* await client.chrtGpt.conversations.listV1({
|
|
99
|
+
* sort_by: "updated_at",
|
|
100
|
+
* sort_order: "asc",
|
|
101
|
+
* page: 1,
|
|
102
|
+
* page_size: 1
|
|
103
|
+
* })
|
|
104
|
+
*/
|
|
105
|
+
listV1(request = {}, requestOptions) {
|
|
106
|
+
return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
|
|
107
|
+
}
|
|
108
|
+
__listV1() {
|
|
109
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
110
|
+
var _a, _b, _c, _d, _e, _f;
|
|
111
|
+
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize } = request;
|
|
112
|
+
const _queryParams = {};
|
|
113
|
+
if (sortBy !== undefined) {
|
|
114
|
+
_queryParams["sort_by"] = sortBy;
|
|
115
|
+
}
|
|
116
|
+
if (sortOrder !== undefined) {
|
|
117
|
+
_queryParams["sort_order"] = sortOrder;
|
|
118
|
+
}
|
|
119
|
+
if (page !== undefined) {
|
|
120
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
121
|
+
}
|
|
122
|
+
if (pageSize !== undefined) {
|
|
123
|
+
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
124
|
+
}
|
|
125
|
+
let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
126
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
127
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "chrt_gpt/conversations/list/v1"),
|
|
128
|
+
method: "GET",
|
|
129
|
+
headers: _headers,
|
|
130
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
131
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
132
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
133
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
134
|
+
});
|
|
135
|
+
if (_response.ok) {
|
|
136
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
137
|
+
}
|
|
138
|
+
if (_response.error.reason === "status-code") {
|
|
139
|
+
switch (_response.error.statusCode) {
|
|
140
|
+
case 422:
|
|
141
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
142
|
+
default:
|
|
143
|
+
throw new errors.ChrtError({
|
|
144
|
+
statusCode: _response.error.statusCode,
|
|
145
|
+
body: _response.error.body,
|
|
146
|
+
rawResponse: _response.rawResponse,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
switch (_response.error.reason) {
|
|
151
|
+
case "non-json":
|
|
152
|
+
throw new errors.ChrtError({
|
|
153
|
+
statusCode: _response.error.statusCode,
|
|
154
|
+
body: _response.error.rawBody,
|
|
155
|
+
rawResponse: _response.rawResponse,
|
|
156
|
+
});
|
|
157
|
+
case "timeout":
|
|
158
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /chrt_gpt/conversations/list/v1.");
|
|
159
|
+
case "unknown":
|
|
160
|
+
throw new errors.ChrtError({
|
|
161
|
+
message: _response.error.errorMessage,
|
|
162
|
+
rawResponse: _response.rawResponse,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
});
|
|
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
|
+
}
|
|
232
|
+
/**
|
|
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)
|
|
234
|
+
*
|
|
235
|
+
* @param {string} conversationId
|
|
236
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
237
|
+
*
|
|
238
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* await client.chrtGpt.conversations.getV1("conversation_id")
|
|
242
|
+
*/
|
|
243
|
+
getV1(conversationId, requestOptions) {
|
|
244
|
+
return core.HttpResponsePromise.fromPromise(this.__getV1(conversationId, requestOptions));
|
|
245
|
+
}
|
|
246
|
+
__getV1(conversationId, requestOptions) {
|
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
var _a, _b, _c, _d;
|
|
249
|
+
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);
|
|
250
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
251
|
+
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/v1/${encodeURIComponent(conversationId)}`),
|
|
252
|
+
method: "GET",
|
|
253
|
+
headers: _headers,
|
|
254
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
255
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
256
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
257
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
258
|
+
});
|
|
259
|
+
if (_response.ok) {
|
|
260
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
261
|
+
}
|
|
262
|
+
if (_response.error.reason === "status-code") {
|
|
263
|
+
switch (_response.error.statusCode) {
|
|
264
|
+
case 422:
|
|
265
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
266
|
+
default:
|
|
267
|
+
throw new errors.ChrtError({
|
|
268
|
+
statusCode: _response.error.statusCode,
|
|
269
|
+
body: _response.error.body,
|
|
270
|
+
rawResponse: _response.rawResponse,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
switch (_response.error.reason) {
|
|
275
|
+
case "non-json":
|
|
276
|
+
throw new errors.ChrtError({
|
|
277
|
+
statusCode: _response.error.statusCode,
|
|
278
|
+
body: _response.error.rawBody,
|
|
279
|
+
rawResponse: _response.rawResponse,
|
|
280
|
+
});
|
|
281
|
+
case "timeout":
|
|
282
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /chrt_gpt/conversations/v1/{conversation_id}.");
|
|
283
|
+
case "unknown":
|
|
284
|
+
throw new errors.ChrtError({
|
|
285
|
+
message: _response.error.errorMessage,
|
|
286
|
+
rawResponse: _response.rawResponse,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
_getAuthorizationHeader() {
|
|
292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
293
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
294
|
+
if (bearer != null) {
|
|
295
|
+
return `Bearer ${bearer}`;
|
|
296
|
+
}
|
|
297
|
+
return undefined;
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* sort_by: "updated_at",
|
|
9
|
+
* sort_order: "asc",
|
|
10
|
+
* page: 1,
|
|
11
|
+
* page_size: 1
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export interface ConversationsListV1Request {
|
|
15
|
+
/** Field to sort by */
|
|
16
|
+
sort_by?: Chrt.ChrtGptConversationSortByEnum | null;
|
|
17
|
+
/** Sort order (asc or desc) */
|
|
18
|
+
sort_order?: Chrt.SortOrderEnum | null;
|
|
19
|
+
page?: number | null;
|
|
20
|
+
page_size?: number | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type ChrtGptConversationsDeleteManyReq } from "./ChrtGptConversationsDeleteManyReq.mjs";
|
|
2
|
+
export { type ConversationsListV1Request } from "./ConversationsListV1Request.mjs";
|
|
3
|
+
export { type ChrtGptConversationsUpdateTitleReq } from "./ChrtGptConversationsUpdateTitleReq.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -65,6 +65,7 @@ export declare class S3Object {
|
|
|
65
65
|
* location_identifiers: ["location_identifiers"],
|
|
66
66
|
* model: "gpt-6-astra",
|
|
67
67
|
* package_appearance: "package_appearance",
|
|
68
|
+
* package_count: undefined,
|
|
68
69
|
* package_types: ["package_types"],
|
|
69
70
|
* proof_notes: ["proof_notes"],
|
|
70
71
|
* readable_package_text: ["readable_package_text"],
|
package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.mjs
CHANGED
|
@@ -106,6 +106,7 @@ export class S3Object {
|
|
|
106
106
|
* location_identifiers: ["location_identifiers"],
|
|
107
107
|
* model: "gpt-6-astra",
|
|
108
108
|
* package_appearance: "package_appearance",
|
|
109
|
+
* package_count: undefined,
|
|
109
110
|
* package_types: ["package_types"],
|
|
110
111
|
* proof_notes: ["proof_notes"],
|
|
111
112
|
* readable_package_text: ["readable_package_text"],
|