@chrt-inc/typescript-sdk 1.1026.0 → 1.1035.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.d.ts +3 -3
- package/dist/cjs/Client.js +19 -19
- package/dist/cjs/api/resources/chrtGpt/client/Client.d.ts +4 -1
- package/dist/cjs/api/resources/chrtGpt/client/Client.js +6 -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 +34 -2
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.js +139 -3
- 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/ConversationsListV1Request.d.ts +4 -1
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/index.js +3 -1
- package/dist/cjs/api/resources/chrtGpt/resources/voice/client/Client.d.ts +49 -0
- package/dist/cjs/api/resources/chrtGpt/resources/voice/client/Client.js +132 -0
- package/dist/cjs/api/resources/chrtGpt/resources/voice/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/voice/client/index.js +17 -0
- package/dist/cjs/api/resources/chrtGpt/resources/voice/client/requests/ChrtGptVoiceStartReq.d.ts +13 -0
- package/dist/cjs/api/resources/chrtGpt/resources/voice/client/requests/ChrtGptVoiceStartReq.js +5 -0
- package/dist/cjs/api/resources/chrtGpt/resources/voice/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +1 -1
- package/dist/cjs/api/resources/index.js +2 -2
- package/dist/cjs/api/resources/{agent/resources/livekit → livekit}/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/{agent/resources/livekit → livekit}/resources/helloWorld/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/{agent/resources/livekit → livekit}/resources/helloWorld/client/Client.js +7 -7
- package/dist/cjs/api/resources/livekit/resources/helloWorld/index.d.ts +1 -0
- package/dist/cjs/api/resources/{agent/resources/livekit → livekit/resources/helloWorld}/index.js +0 -1
- package/dist/cjs/api/types/Caller.d.ts +1 -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/ChrtGptVoiceDelegationEnum.d.ts +11 -0
- package/dist/cjs/api/types/ChrtGptVoiceDelegationEnum.js +10 -0
- package/dist/cjs/api/types/ChrtGptVoiceReq.d.ts +11 -0
- package/dist/cjs/api/types/ChrtGptVoiceReq.js +5 -0
- package/dist/cjs/api/types/ChrtGptVoiceStartRes.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptVoiceStartRes.js +5 -0
- package/dist/cjs/api/types/InternalDelegationOriginEnum.d.ts +8 -0
- package/dist/cjs/api/types/InternalDelegationOriginEnum.js +10 -0
- package/dist/cjs/api/types/index.d.ts +6 -1
- package/dist/cjs/api/types/index.js +6 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -3
- package/dist/esm/Client.mjs +7 -7
- package/dist/esm/api/resources/chrtGpt/client/Client.d.mts +4 -1
- package/dist/esm/api/resources/chrtGpt/client/Client.mjs +6 -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 +34 -2
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.mjs +139 -3
- 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/ConversationsListV1Request.d.mts +4 -1
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.d.mts +2 -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/chrtGpt/resources/voice/client/Client.d.mts +49 -0
- package/dist/esm/api/resources/chrtGpt/resources/voice/client/Client.mjs +95 -0
- package/dist/esm/api/resources/chrtGpt/resources/voice/client/index.d.mts +2 -0
- package/dist/esm/api/resources/chrtGpt/resources/voice/client/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/voice/client/requests/ChrtGptVoiceStartReq.d.mts +13 -0
- package/dist/esm/api/resources/chrtGpt/resources/voice/client/requests/ChrtGptVoiceStartReq.mjs +4 -0
- package/dist/esm/api/resources/chrtGpt/resources/voice/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/index.d.mts +1 -1
- package/dist/esm/api/resources/index.mjs +1 -1
- package/dist/esm/api/resources/{agent/resources/livekit → livekit}/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/{agent/resources/livekit → livekit}/resources/helloWorld/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/{agent/resources/livekit → livekit}/resources/helloWorld/client/Client.mjs +7 -7
- package/dist/esm/api/resources/livekit/resources/helloWorld/index.d.mts +1 -0
- package/dist/esm/api/resources/livekit/resources/helloWorld/index.mjs +1 -0
- package/dist/esm/api/types/Caller.d.mts +1 -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/ChrtGptVoiceDelegationEnum.d.mts +11 -0
- package/dist/esm/api/types/ChrtGptVoiceDelegationEnum.mjs +7 -0
- package/dist/esm/api/types/ChrtGptVoiceReq.d.mts +11 -0
- package/dist/esm/api/types/ChrtGptVoiceReq.mjs +4 -0
- package/dist/esm/api/types/ChrtGptVoiceStartRes.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptVoiceStartRes.mjs +4 -0
- package/dist/esm/api/types/InternalDelegationOriginEnum.d.mts +8 -0
- package/dist/esm/api/types/InternalDelegationOriginEnum.mjs +7 -0
- package/dist/esm/api/types/index.d.mts +6 -1
- package/dist/esm/api/types/index.mjs +6 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +265 -59
- package/dist/cjs/api/resources/agent/client/Client.d.ts +0 -23
- package/dist/cjs/api/resources/agent/client/Client.js +0 -17
- package/dist/cjs/api/resources/agent/resources/index.d.ts +0 -1
- package/dist/cjs/api/resources/agent/resources/index.js +0 -37
- package/dist/cjs/api/resources/agent/resources/livekit/index.d.ts +0 -2
- package/dist/cjs/api/resources/agent/resources/livekit/resources/helloWorld/client/index.d.ts +0 -1
- package/dist/cjs/api/types/ChrtGptTitleEvent.d.ts +0 -11
- package/dist/esm/api/resources/agent/client/Client.d.mts +0 -23
- package/dist/esm/api/resources/agent/client/Client.mjs +0 -13
- package/dist/esm/api/resources/agent/resources/index.d.mts +0 -1
- package/dist/esm/api/resources/agent/resources/index.mjs +0 -1
- package/dist/esm/api/resources/agent/resources/livekit/index.d.mts +0 -2
- package/dist/esm/api/resources/agent/resources/livekit/index.mjs +0 -2
- package/dist/esm/api/resources/agent/resources/livekit/resources/helloWorld/client/index.d.mts +0 -1
- 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/cjs/api/resources/{agent/client → chrtGpt/resources/voice/client/requests}/index.js +0 -0
- /package/dist/cjs/api/resources/{agent/resources/livekit/resources/helloWorld → chrtGpt/resources/voice}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agent/resources/livekit/resources/helloWorld → chrtGpt/resources/voice}/index.js +0 -0
- /package/dist/cjs/api/resources/{agent/resources/livekit → livekit}/client/Client.js +0 -0
- /package/dist/cjs/api/resources/{agent → livekit}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agent/resources/livekit → livekit}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{agent → livekit}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agent → livekit}/index.js +0 -0
- /package/dist/cjs/api/resources/{agent/resources/livekit → livekit/resources/helloWorld}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agent/resources/livekit → livekit}/resources/helloWorld/client/index.js +0 -0
- /package/dist/cjs/api/resources/{agent/resources/livekit → livekit}/resources/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agent/resources/livekit → livekit}/resources/index.js +0 -0
- /package/dist/esm/api/{types/ChrtGptTitleEvent.mjs → resources/chrtGpt/resources/conversations/client/requests/ChrtGptConversationsDeleteManyReq.mjs} +0 -0
- /package/dist/esm/api/resources/{agent/client → chrtGpt/resources/voice/client/requests}/index.mjs +0 -0
- /package/dist/esm/api/resources/{agent/resources/livekit/resources/helloWorld → chrtGpt/resources/voice}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agent/resources/livekit/resources/helloWorld → chrtGpt/resources/voice}/index.mjs +0 -0
- /package/dist/esm/api/resources/{agent/resources/livekit → livekit}/client/Client.mjs +0 -0
- /package/dist/esm/api/resources/{agent → livekit}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agent/resources/livekit → livekit}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{agent → livekit}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agent → livekit}/index.mjs +0 -0
- /package/dist/esm/api/resources/{agent/resources/livekit → livekit/resources/helloWorld}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agent/resources/livekit → livekit}/resources/helloWorld/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{agent/resources/livekit → livekit}/resources/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agent/resources/livekit → livekit}/resources/index.mjs +0 -0
package/dist/esm/Client.mjs
CHANGED
|
@@ -7,13 +7,13 @@ import { ChrtGpt } from "./api/resources/chrtGpt/client/Client.mjs";
|
|
|
7
7
|
import { Flights } from "./api/resources/flights/client/Client.mjs";
|
|
8
8
|
import { Orgs } from "./api/resources/orgs/client/Client.mjs";
|
|
9
9
|
import { Utils } from "./api/resources/utils/client/Client.mjs";
|
|
10
|
-
import { Agent } from "./api/resources/agent/client/Client.mjs";
|
|
11
10
|
import { Analytics } from "./api/resources/analytics/client/Client.mjs";
|
|
12
11
|
import { Billing } from "./api/resources/billing/client/Client.mjs";
|
|
13
12
|
import { BillingNew } from "./api/resources/billingNew/client/Client.mjs";
|
|
14
13
|
import { CargoOnFlightIntegrations } from "./api/resources/cargoOnFlightIntegrations/client/Client.mjs";
|
|
15
14
|
import { Integrations } from "./api/resources/integrations/client/Client.mjs";
|
|
16
15
|
import { Listing } from "./api/resources/listing/client/Client.mjs";
|
|
16
|
+
import { Livekit } from "./api/resources/livekit/client/Client.mjs";
|
|
17
17
|
import { Notifications } from "./api/resources/notifications/client/Client.mjs";
|
|
18
18
|
import { Operations } from "./api/resources/operations/client/Client.mjs";
|
|
19
19
|
import { Shipping } from "./api/resources/shipping/client/Client.mjs";
|
|
@@ -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.1035.0",
|
|
30
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.1035.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) });
|
|
@@ -48,10 +48,6 @@ export class ChrtClient {
|
|
|
48
48
|
var _a;
|
|
49
49
|
return ((_a = this._utils) !== null && _a !== void 0 ? _a : (this._utils = new Utils(this._options)));
|
|
50
50
|
}
|
|
51
|
-
get agent() {
|
|
52
|
-
var _a;
|
|
53
|
-
return ((_a = this._agent) !== null && _a !== void 0 ? _a : (this._agent = new Agent(this._options)));
|
|
54
|
-
}
|
|
55
51
|
get analytics() {
|
|
56
52
|
var _a;
|
|
57
53
|
return ((_a = this._analytics) !== null && _a !== void 0 ? _a : (this._analytics = new Analytics(this._options)));
|
|
@@ -76,6 +72,10 @@ export class ChrtClient {
|
|
|
76
72
|
var _a;
|
|
77
73
|
return ((_a = this._listing) !== null && _a !== void 0 ? _a : (this._listing = new Listing(this._options)));
|
|
78
74
|
}
|
|
75
|
+
get livekit() {
|
|
76
|
+
var _a;
|
|
77
|
+
return ((_a = this._livekit) !== null && _a !== void 0 ? _a : (this._livekit = new Livekit(this._options)));
|
|
78
|
+
}
|
|
79
79
|
get notifications() {
|
|
80
80
|
var _a;
|
|
81
81
|
return ((_a = this._notifications) !== null && _a !== void 0 ? _a : (this._notifications = new Notifications(this._options)));
|
|
@@ -5,6 +5,7 @@ import * as environments from "../../../../environments.mjs";
|
|
|
5
5
|
import * as core from "../../../../core/index.mjs";
|
|
6
6
|
import * as Chrt from "../../../index.mjs";
|
|
7
7
|
import { Conversations } from "../resources/conversations/client/Client.mjs";
|
|
8
|
+
import { Voice } from "../resources/voice/client/Client.mjs";
|
|
8
9
|
export declare namespace ChrtGpt {
|
|
9
10
|
interface Options {
|
|
10
11
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -31,10 +32,12 @@ export declare namespace ChrtGpt {
|
|
|
31
32
|
export declare class ChrtGpt {
|
|
32
33
|
protected readonly _options: ChrtGpt.Options;
|
|
33
34
|
protected _conversations: Conversations | undefined;
|
|
35
|
+
protected _voice: Voice | undefined;
|
|
34
36
|
constructor(_options?: ChrtGpt.Options);
|
|
35
37
|
get conversations(): Conversations;
|
|
38
|
+
get voice(): Voice;
|
|
36
39
|
/**
|
|
37
|
-
* Sends a message to ChrtGPT and streams its reply, starting
|
|
40
|
+
* 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
41
|
*/
|
|
39
42
|
postV1(request: Chrt.ChrtGptReq, requestOptions?: ChrtGpt.RequestOptions): core.HttpResponsePromise<core.Stream<Chrt.ChrtGptEvent>>;
|
|
40
43
|
private __postV1;
|
|
@@ -16,6 +16,7 @@ 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
18
|
import { Conversations } from "../resources/conversations/client/Client.mjs";
|
|
19
|
+
import { Voice } from "../resources/voice/client/Client.mjs";
|
|
19
20
|
export class ChrtGpt {
|
|
20
21
|
constructor(_options = {}) {
|
|
21
22
|
this._options = _options;
|
|
@@ -24,8 +25,12 @@ export class ChrtGpt {
|
|
|
24
25
|
var _a;
|
|
25
26
|
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new Conversations(this._options)));
|
|
26
27
|
}
|
|
28
|
+
get voice() {
|
|
29
|
+
var _a;
|
|
30
|
+
return ((_a = this._voice) !== null && _a !== void 0 ? _a : (this._voice = new Voice(this._options)));
|
|
31
|
+
}
|
|
27
32
|
/**
|
|
28
|
-
* Sends a message to ChrtGPT and streams its reply, starting
|
|
33
|
+
* 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
34
|
*/
|
|
30
35
|
postV1(request, requestOptions) {
|
|
31
36
|
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 = {}));
|
|
@@ -31,7 +31,22 @@ export declare class Conversations {
|
|
|
31
31
|
protected readonly _options: Conversations.Options;
|
|
32
32
|
constructor(_options?: Conversations.Options);
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
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, with optional search over summaries, titles, and order identifiers. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationListRes)
|
|
35
50
|
*
|
|
36
51
|
* @param {Chrt.chrtGpt.ConversationsListV1Request} request
|
|
37
52
|
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -43,11 +58,28 @@ export declare class Conversations {
|
|
|
43
58
|
* sort_by: "updated_at",
|
|
44
59
|
* sort_order: "asc",
|
|
45
60
|
* page: 1,
|
|
46
|
-
* page_size: 1
|
|
61
|
+
* page_size: 1,
|
|
62
|
+
* search: "search"
|
|
47
63
|
* })
|
|
48
64
|
*/
|
|
49
65
|
listV1(request?: Chrt.chrtGpt.ConversationsListV1Request, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversationListRes>;
|
|
50
66
|
private __listV1;
|
|
67
|
+
/**
|
|
68
|
+
* 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)
|
|
69
|
+
*
|
|
70
|
+
* @param {string} conversationId
|
|
71
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq} request
|
|
72
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
+
*
|
|
74
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await client.chrtGpt.conversations.updateTitleV1("conversation_id", {
|
|
78
|
+
* title: "title"
|
|
79
|
+
* })
|
|
80
|
+
*/
|
|
81
|
+
updateTitleV1(conversationId: string, request: Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptConversation1>;
|
|
82
|
+
private __updateTitleV1;
|
|
51
83
|
/**
|
|
52
84
|
* 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
85
|
*
|
|
@@ -20,7 +20,74 @@ export class Conversations {
|
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
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, with optional search over summaries, titles, and order identifiers. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | () -> (ChrtGPTConversationListRes)
|
|
24
91
|
*
|
|
25
92
|
* @param {Chrt.chrtGpt.ConversationsListV1Request} request
|
|
26
93
|
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -32,7 +99,8 @@ export class Conversations {
|
|
|
32
99
|
* sort_by: "updated_at",
|
|
33
100
|
* sort_order: "asc",
|
|
34
101
|
* page: 1,
|
|
35
|
-
* page_size: 1
|
|
102
|
+
* page_size: 1,
|
|
103
|
+
* search: "search"
|
|
36
104
|
* })
|
|
37
105
|
*/
|
|
38
106
|
listV1(request = {}, requestOptions) {
|
|
@@ -41,7 +109,7 @@ export class Conversations {
|
|
|
41
109
|
__listV1() {
|
|
42
110
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
43
111
|
var _a, _b, _c, _d, _e, _f;
|
|
44
|
-
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize } = request;
|
|
112
|
+
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, search } = request;
|
|
45
113
|
const _queryParams = {};
|
|
46
114
|
if (sortBy !== undefined) {
|
|
47
115
|
_queryParams["sort_by"] = sortBy;
|
|
@@ -55,6 +123,9 @@ export class Conversations {
|
|
|
55
123
|
if (pageSize !== undefined) {
|
|
56
124
|
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
57
125
|
}
|
|
126
|
+
if (search !== undefined) {
|
|
127
|
+
_queryParams["search"] = search;
|
|
128
|
+
}
|
|
58
129
|
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);
|
|
59
130
|
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
60
131
|
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"),
|
|
@@ -97,6 +168,71 @@ export class Conversations {
|
|
|
97
168
|
}
|
|
98
169
|
});
|
|
99
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* 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)
|
|
173
|
+
*
|
|
174
|
+
* @param {string} conversationId
|
|
175
|
+
* @param {Chrt.chrtGpt.ChrtGptConversationsUpdateTitleReq} request
|
|
176
|
+
* @param {Conversations.RequestOptions} requestOptions - Request-specific configuration.
|
|
177
|
+
*
|
|
178
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* await client.chrtGpt.conversations.updateTitleV1("conversation_id", {
|
|
182
|
+
* title: "title"
|
|
183
|
+
* })
|
|
184
|
+
*/
|
|
185
|
+
updateTitleV1(conversationId, request, requestOptions) {
|
|
186
|
+
return core.HttpResponsePromise.fromPromise(this.__updateTitleV1(conversationId, request, requestOptions));
|
|
187
|
+
}
|
|
188
|
+
__updateTitleV1(conversationId, request, requestOptions) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
var _a, _b, _c, _d;
|
|
191
|
+
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);
|
|
192
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
193
|
+
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)}`),
|
|
194
|
+
method: "PATCH",
|
|
195
|
+
headers: _headers,
|
|
196
|
+
contentType: "application/json",
|
|
197
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
198
|
+
requestType: "json",
|
|
199
|
+
body: request,
|
|
200
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
201
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
202
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
203
|
+
});
|
|
204
|
+
if (_response.ok) {
|
|
205
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
206
|
+
}
|
|
207
|
+
if (_response.error.reason === "status-code") {
|
|
208
|
+
switch (_response.error.statusCode) {
|
|
209
|
+
case 422:
|
|
210
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
211
|
+
default:
|
|
212
|
+
throw new errors.ChrtError({
|
|
213
|
+
statusCode: _response.error.statusCode,
|
|
214
|
+
body: _response.error.body,
|
|
215
|
+
rawResponse: _response.rawResponse,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
switch (_response.error.reason) {
|
|
220
|
+
case "non-json":
|
|
221
|
+
throw new errors.ChrtError({
|
|
222
|
+
statusCode: _response.error.statusCode,
|
|
223
|
+
body: _response.error.rawBody,
|
|
224
|
+
rawResponse: _response.rawResponse,
|
|
225
|
+
});
|
|
226
|
+
case "timeout":
|
|
227
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /chrt_gpt/conversations/update_title/v1/{conversation_id}.");
|
|
228
|
+
case "unknown":
|
|
229
|
+
throw new errors.ChrtError({
|
|
230
|
+
message: _response.error.errorMessage,
|
|
231
|
+
rawResponse: _response.rawResponse,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
100
236
|
/**
|
|
101
237
|
* 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
238
|
*
|
|
@@ -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
|
+
}
|
|
@@ -8,7 +8,8 @@ import * as Chrt from "../../../../../../index.mjs";
|
|
|
8
8
|
* sort_by: "updated_at",
|
|
9
9
|
* sort_order: "asc",
|
|
10
10
|
* page: 1,
|
|
11
|
-
* page_size: 1
|
|
11
|
+
* page_size: 1,
|
|
12
|
+
* search: "search"
|
|
12
13
|
* }
|
|
13
14
|
*/
|
|
14
15
|
export interface ConversationsListV1Request {
|
|
@@ -18,4 +19,6 @@ export interface ConversationsListV1Request {
|
|
|
18
19
|
sort_order?: Chrt.SortOrderEnum | null;
|
|
19
20
|
page?: number | null;
|
|
20
21
|
page_size?: number | null;
|
|
22
|
+
/** Full-text search query for conversation summary, title, order short IDs, AWB numbers, or off-CHRT reference IDs. */
|
|
23
|
+
search?: string | null;
|
|
21
24
|
}
|
|
@@ -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";
|
|
@@ -0,0 +1,49 @@
|
|
|
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 Voice {
|
|
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 Voice {
|
|
31
|
+
protected readonly _options: Voice.Options;
|
|
32
|
+
constructor(_options?: Voice.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Creates a LiveKit room with a ChrtGPT voice agent acting as the caller, using the chosen delegation, and returns a token to join it. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTVoiceStartReq) -> (ChrtGPTVoiceStartRes)
|
|
35
|
+
*
|
|
36
|
+
* @param {Chrt.chrtGpt.ChrtGptVoiceStartReq} request
|
|
37
|
+
* @param {Voice.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.chrtGpt.voice.startV1({
|
|
43
|
+
* delegation: "responses"
|
|
44
|
+
* })
|
|
45
|
+
*/
|
|
46
|
+
startV1(request: Chrt.chrtGpt.ChrtGptVoiceStartReq, requestOptions?: Voice.RequestOptions): core.HttpResponsePromise<Chrt.ChrtGptVoiceStartRes>;
|
|
47
|
+
private __startV1;
|
|
48
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
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 Voice {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a LiveKit room with a ChrtGPT voice agent acting as the caller, using the chosen delegation, and returns a token to join it. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (ChrtGPTVoiceStartReq) -> (ChrtGPTVoiceStartRes)
|
|
24
|
+
*
|
|
25
|
+
* @param {Chrt.chrtGpt.ChrtGptVoiceStartReq} request
|
|
26
|
+
* @param {Voice.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.chrtGpt.voice.startV1({
|
|
32
|
+
* delegation: "responses"
|
|
33
|
+
* })
|
|
34
|
+
*/
|
|
35
|
+
startV1(request, requestOptions) {
|
|
36
|
+
return core.HttpResponsePromise.fromPromise(this.__startV1(request, requestOptions));
|
|
37
|
+
}
|
|
38
|
+
__startV1(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/voice/start/v1"),
|
|
44
|
+
method: "POST",
|
|
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 { data: _response.body, rawResponse: _response.rawResponse };
|
|
56
|
+
}
|
|
57
|
+
if (_response.error.reason === "status-code") {
|
|
58
|
+
switch (_response.error.statusCode) {
|
|
59
|
+
case 422:
|
|
60
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
61
|
+
default:
|
|
62
|
+
throw new errors.ChrtError({
|
|
63
|
+
statusCode: _response.error.statusCode,
|
|
64
|
+
body: _response.error.body,
|
|
65
|
+
rawResponse: _response.rawResponse,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
switch (_response.error.reason) {
|
|
70
|
+
case "non-json":
|
|
71
|
+
throw new errors.ChrtError({
|
|
72
|
+
statusCode: _response.error.statusCode,
|
|
73
|
+
body: _response.error.rawBody,
|
|
74
|
+
rawResponse: _response.rawResponse,
|
|
75
|
+
});
|
|
76
|
+
case "timeout":
|
|
77
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /chrt_gpt/voice/start/v1.");
|
|
78
|
+
case "unknown":
|
|
79
|
+
throw new errors.ChrtError({
|
|
80
|
+
message: _response.error.errorMessage,
|
|
81
|
+
rawResponse: _response.rawResponse,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
_getAuthorizationHeader() {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
89
|
+
if (bearer != null) {
|
|
90
|
+
return `Bearer ${bearer}`;
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
package/dist/esm/api/resources/chrtGpt/resources/voice/client/requests/ChrtGptVoiceStartReq.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
* delegation: "responses"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface ChrtGptVoiceStartReq {
|
|
12
|
+
delegation: Chrt.ChrtGptVoiceDelegationEnum;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ChrtGptVoiceStartReq } from "./ChrtGptVoiceStartReq.mjs";
|
|
@@ -3,13 +3,13 @@ export * as shipping from "./shipping/index.mjs";
|
|
|
3
3
|
export * as chrtGpt from "./chrtGpt/index.mjs";
|
|
4
4
|
export * as flights from "./flights/index.mjs";
|
|
5
5
|
export * as utils from "./utils/index.mjs";
|
|
6
|
-
export * as agent from "./agent/index.mjs";
|
|
7
6
|
export * as analytics from "./analytics/index.mjs";
|
|
8
7
|
export * as billing from "./billing/index.mjs";
|
|
9
8
|
export * as billingNew from "./billingNew/index.mjs";
|
|
10
9
|
export * as cargoOnFlightIntegrations from "./cargoOnFlightIntegrations/index.mjs";
|
|
11
10
|
export * as integrations from "./integrations/index.mjs";
|
|
12
11
|
export * as listing from "./listing/index.mjs";
|
|
12
|
+
export * as livekit from "./livekit/index.mjs";
|
|
13
13
|
export * as notifications from "./notifications/index.mjs";
|
|
14
14
|
export * as operations from "./operations/index.mjs";
|
|
15
15
|
export * as shippingIntegrations from "./shippingIntegrations/index.mjs";
|