syllable-sdk 0.1.0-alpha.48 → 0.1.0-alpha.49
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 +18 -4
- package/docs/sdks/fullsummary/README.md +85 -0
- package/docs/sdks/languagegroups/README.md +465 -0
- package/docs/sdks/v1/README.md +0 -158
- package/funcs/languageGroupsCreate.d.ts +16 -0
- package/funcs/languageGroupsCreate.d.ts.map +1 -0
- package/funcs/languageGroupsCreate.js +102 -0
- package/funcs/languageGroupsCreate.js.map +1 -0
- package/funcs/{v1Delete.d.ts → languageGroupsDelete.d.ts} +4 -4
- package/funcs/languageGroupsDelete.d.ts.map +1 -0
- package/funcs/{v1Delete.js → languageGroupsDelete.js} +9 -12
- package/funcs/languageGroupsDelete.js.map +1 -0
- package/funcs/languageGroupsGetById.d.ts +17 -0
- package/funcs/languageGroupsGetById.d.ts.map +1 -0
- package/funcs/languageGroupsGetById.js +105 -0
- package/funcs/languageGroupsGetById.js.map +1 -0
- package/funcs/{v1GetById.d.ts → languageGroupsList.d.ts} +4 -4
- package/funcs/languageGroupsList.d.ts.map +1 -0
- package/funcs/languageGroupsList.js +114 -0
- package/funcs/languageGroupsList.js.map +1 -0
- package/funcs/languageGroupsUpdate.d.ts +16 -0
- package/funcs/languageGroupsUpdate.d.ts.map +1 -0
- package/funcs/languageGroupsUpdate.js +102 -0
- package/funcs/languageGroupsUpdate.js.map +1 -0
- package/funcs/sessionsFullSummaryGetById.d.ts +14 -0
- package/funcs/sessionsFullSummaryGetById.d.ts.map +1 -0
- package/funcs/{v1GetById.js → sessionsFullSummaryGetById.js} +9 -12
- package/funcs/sessionsFullSummaryGetById.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/agentcreate.d.ts +7 -0
- package/models/components/agentcreate.d.ts.map +1 -1
- package/models/components/agentcreate.js +4 -0
- package/models/components/agentcreate.js.map +1 -1
- package/models/components/agentlanguage.d.ts +41 -0
- package/models/components/agentlanguage.d.ts.map +1 -0
- package/models/components/agentlanguage.js +62 -0
- package/models/components/agentlanguage.js.map +1 -0
- package/models/components/agentresponse.d.ts +13 -0
- package/models/components/agentresponse.d.ts.map +1 -1
- package/models/components/agentresponse.js +9 -0
- package/models/components/agentresponse.js.map +1 -1
- package/models/components/agentupdate.d.ts +7 -0
- package/models/components/agentupdate.d.ts.map +1 -1
- package/models/components/agentupdate.js +4 -0
- package/models/components/agentupdate.js.map +1 -1
- package/models/components/agentvoice.d.ts +29 -5
- package/models/components/agentvoice.d.ts.map +1 -1
- package/models/components/agentvoice.js +19 -5
- package/models/components/agentvoice.js.map +1 -1
- package/models/components/agentvoicedisplayname.d.ts +142 -0
- package/models/components/agentvoicedisplayname.d.ts.map +1 -0
- package/models/components/agentvoicedisplayname.js +89 -0
- package/models/components/agentvoicedisplayname.js.map +1 -0
- package/models/components/agentvoicegender.d.ts +34 -0
- package/models/components/agentvoicegender.d.ts.map +1 -0
- package/models/components/agentvoicegender.js +53 -0
- package/models/components/agentvoicegender.js.map +1 -0
- package/models/components/agentvoicemodel.d.ts +46 -0
- package/models/components/agentvoicemodel.d.ts.map +1 -0
- package/models/components/agentvoicemodel.js +57 -0
- package/models/components/agentvoicemodel.js.map +1 -0
- package/models/components/agentvoicevarname.d.ts +30 -0
- package/models/components/agentvoicevarname.d.ts.map +1 -1
- package/models/components/agentvoicevarname.js +10 -0
- package/models/components/agentvoicevarname.js.map +1 -1
- package/models/components/index.d.ts +13 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +13 -1
- package/models/components/index.js.map +1 -1
- package/models/components/languagecode.d.ts +49 -0
- package/models/components/languagecode.d.ts.map +1 -0
- package/models/components/languagecode.js +58 -0
- package/models/components/languagecode.js.map +1 -0
- package/models/components/languageconfig.d.ts +56 -0
- package/models/components/languageconfig.d.ts.map +1 -0
- package/models/components/languageconfig.js +83 -0
- package/models/components/languageconfig.js.map +1 -0
- package/models/components/languagegroupcreaterequest.d.ts +48 -0
- package/models/components/languagegroupcreaterequest.d.ts.map +1 -0
- package/models/components/languagegroupcreaterequest.js +77 -0
- package/models/components/languagegroupcreaterequest.js.map +1 -0
- package/models/components/languagegroupproperties.d.ts +37 -0
- package/models/components/languagegroupproperties.d.ts.map +1 -0
- package/models/components/languagegroupproperties.js +53 -0
- package/models/components/languagegroupproperties.js.map +1 -0
- package/models/components/languagegroupresponse.d.ts +68 -0
- package/models/components/languagegroupresponse.d.ts.map +1 -0
- package/models/components/languagegroupresponse.js +91 -0
- package/models/components/languagegroupresponse.js.map +1 -0
- package/models/components/languagegroupupdaterequest.d.ts +58 -0
- package/models/components/languagegroupupdaterequest.d.ts.map +1 -0
- package/models/components/languagegroupupdaterequest.js +83 -0
- package/models/components/languagegroupupdaterequest.js.map +1 -0
- package/models/components/listresponselanguagegroupresponse.d.ts +38 -0
- package/models/components/listresponselanguagegroupresponse.d.ts.map +1 -0
- package/models/components/listresponselanguagegroupresponse.js +81 -0
- package/models/components/listresponselanguagegroupresponse.js.map +1 -0
- package/models/components/promptcreaterequest.d.ts +1 -1
- package/models/components/promptupdaterequest.d.ts +1 -1
- package/models/components/sessionrecordingresponse.d.ts +0 -5
- package/models/components/sessionrecordingresponse.d.ts.map +1 -1
- package/models/components/sessionrecordingresponse.js +0 -2
- package/models/components/sessionrecordingresponse.js.map +1 -1
- package/models/components/sessionsummaryresponse.d.ts +40 -0
- package/models/components/sessionsummaryresponse.d.ts.map +1 -0
- package/models/components/sessionsummaryresponse.js +61 -0
- package/models/components/sessionsummaryresponse.js.map +1 -0
- package/models/components/{sttprovider.d.ts → ttsprovider.d.ts} +10 -10
- package/models/components/{sttprovider.d.ts.map → ttsprovider.d.ts.map} +1 -1
- package/models/components/{sttprovider.js → ttsprovider.js} +14 -14
- package/models/components/{sttprovider.js.map → ttsprovider.js.map} +1 -1
- package/models/operations/index.d.ts +4 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/languagegroupsdelete.d.ts +31 -0
- package/models/operations/languagegroupsdelete.d.ts.map +1 -0
- package/models/operations/languagegroupsdelete.js +70 -0
- package/models/operations/languagegroupsdelete.js.map +1 -0
- package/models/operations/languagegroupsgetbyid.d.ts +29 -0
- package/models/operations/languagegroupsgetbyid.d.ts.map +1 -0
- package/models/operations/languagegroupsgetbyid.js +68 -0
- package/models/operations/languagegroupsgetbyid.js.map +1 -0
- package/models/operations/languagegroupslist.d.ts +46 -0
- package/models/operations/languagegroupslist.d.ts.map +1 -0
- package/models/operations/languagegroupslist.js +103 -0
- package/models/operations/languagegroupslist.js.map +1 -0
- package/models/operations/sessionfullsummarygetbyid.d.ts +29 -0
- package/models/operations/sessionfullsummarygetbyid.d.ts.map +1 -0
- package/models/operations/sessionfullsummarygetbyid.js +68 -0
- package/models/operations/sessionfullsummarygetbyid.js.map +1 -0
- package/openapi.json +1160 -207
- package/package.json +1 -1
- package/sdk/fullsummary.d.ts +10 -0
- package/sdk/fullsummary.d.ts.map +1 -0
- package/sdk/fullsummary.js +19 -0
- package/sdk/fullsummary.js.map +1 -0
- package/sdk/languagegroups.d.ts +41 -0
- package/sdk/languagegroups.d.ts.map +1 -0
- package/sdk/languagegroups.js +62 -0
- package/sdk/languagegroups.js.map +1 -0
- package/sdk/sdk.d.ts +5 -2
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +7 -3
- package/sdk/sdk.js.map +1 -1
- package/sdk/sessions.d.ts +3 -0
- package/sdk/sessions.d.ts.map +1 -1
- package/sdk/sessions.js +4 -0
- package/sdk/sessions.js.map +1 -1
- package/sdk/v1.d.ts +0 -14
- package/sdk/v1.d.ts.map +1 -1
- package/sdk/v1.js +0 -20
- package/sdk/v1.js.map +1 -1
- package/src/funcs/languageGroupsCreate.ts +136 -0
- package/src/funcs/{v1Delete.ts → languageGroupsDelete.ts} +15 -11
- package/src/funcs/languageGroupsGetById.ts +146 -0
- package/src/funcs/languageGroupsList.ts +148 -0
- package/src/funcs/languageGroupsUpdate.ts +136 -0
- package/src/funcs/{v1GetById.ts → sessionsFullSummaryGetById.ts} +13 -13
- package/src/lib/config.ts +2 -2
- package/src/models/components/agentcreate.ts +11 -0
- package/src/models/components/agentlanguage.ts +80 -0
- package/src/models/components/agentresponse.ts +26 -0
- package/src/models/components/agentupdate.ts +11 -0
- package/src/models/components/agentvoice.ts +63 -12
- package/src/models/components/agentvoicedisplayname.ts +75 -0
- package/src/models/components/agentvoicegender.ts +39 -0
- package/src/models/components/agentvoicemodel.ts +43 -0
- package/src/models/components/agentvoicevarname.ts +10 -0
- package/src/models/components/index.ts +13 -1
- package/src/models/components/languagecode.ts +42 -0
- package/src/models/components/languageconfig.ts +122 -0
- package/src/models/components/languagegroupcreaterequest.ts +107 -0
- package/src/models/components/languagegroupproperties.ts +38 -0
- package/src/models/components/languagegroupresponse.ts +141 -0
- package/src/models/components/languagegroupupdaterequest.ts +123 -0
- package/src/models/components/listresponselanguagegroupresponse.ts +104 -0
- package/src/models/components/promptcreaterequest.ts +1 -1
- package/src/models/components/promptupdaterequest.ts +1 -1
- package/src/models/components/sessionrecordingresponse.ts +0 -7
- package/src/models/components/sessionsummaryresponse.ts +79 -0
- package/src/models/components/ttsprovider.ts +38 -0
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/languagegroupsdelete.ts +81 -0
- package/src/models/operations/languagegroupsgetbyid.ts +77 -0
- package/src/models/operations/languagegroupslist.ts +126 -0
- package/src/models/operations/sessionfullsummarygetbyid.ts +77 -0
- package/src/sdk/fullsummary.ts +25 -0
- package/src/sdk/languagegroups.ts +100 -0
- package/src/sdk/sdk.ts +11 -5
- package/src/sdk/sessions.ts +6 -0
- package/src/sdk/v1.ts +0 -36
- package/funcs/v1Delete.d.ts.map +0 -1
- package/funcs/v1Delete.js.map +0 -1
- package/funcs/v1GetById.d.ts.map +0 -1
- package/funcs/v1GetById.js.map +0 -1
- package/src/models/components/sttprovider.ts +0 -38
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SyllableSDKCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get Language Group
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Fetch a given language group.
|
|
32
|
+
*/
|
|
33
|
+
export async function languageGroupsGetById(
|
|
34
|
+
client: SyllableSDKCore,
|
|
35
|
+
request: operations.LanguageGroupsGetByIdRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<
|
|
38
|
+
Result<
|
|
39
|
+
components.LanguageGroupResponse,
|
|
40
|
+
| errors.HTTPValidationError
|
|
41
|
+
| SDKError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
const parsed = safeParse(
|
|
51
|
+
request,
|
|
52
|
+
(value) =>
|
|
53
|
+
operations.LanguageGroupsGetByIdRequest$outboundSchema.parse(value),
|
|
54
|
+
"Input validation failed",
|
|
55
|
+
);
|
|
56
|
+
if (!parsed.ok) {
|
|
57
|
+
return parsed;
|
|
58
|
+
}
|
|
59
|
+
const payload = parsed.value;
|
|
60
|
+
const body = null;
|
|
61
|
+
|
|
62
|
+
const pathParams = {
|
|
63
|
+
language_group_id: encodeSimple(
|
|
64
|
+
"language_group_id",
|
|
65
|
+
payload.language_group_id,
|
|
66
|
+
{ explode: false, charEncoding: "percent" },
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const path = pathToFunc("/api/v1/language_groups/{language_group_id}")(
|
|
71
|
+
pathParams,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const headers = new Headers(compactMap({
|
|
75
|
+
Accept: "application/json",
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
79
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
80
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
81
|
+
|
|
82
|
+
const context = {
|
|
83
|
+
baseURL: options?.serverURL ?? "",
|
|
84
|
+
operationID: "language_groups_get_by_id",
|
|
85
|
+
oAuth2Scopes: [],
|
|
86
|
+
|
|
87
|
+
resolvedSecurity: requestSecurity,
|
|
88
|
+
|
|
89
|
+
securitySource: client._options.apiKeyHeader,
|
|
90
|
+
retryConfig: options?.retries
|
|
91
|
+
|| client._options.retryConfig
|
|
92
|
+
|| { strategy: "none" },
|
|
93
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const requestRes = client._createRequest(context, {
|
|
97
|
+
security: requestSecurity,
|
|
98
|
+
method: "GET",
|
|
99
|
+
baseURL: options?.serverURL,
|
|
100
|
+
path: path,
|
|
101
|
+
headers: headers,
|
|
102
|
+
body: body,
|
|
103
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
104
|
+
}, options);
|
|
105
|
+
if (!requestRes.ok) {
|
|
106
|
+
return requestRes;
|
|
107
|
+
}
|
|
108
|
+
const req = requestRes.value;
|
|
109
|
+
|
|
110
|
+
const doResult = await client._do(req, {
|
|
111
|
+
context,
|
|
112
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
113
|
+
retryConfig: context.retryConfig,
|
|
114
|
+
retryCodes: context.retryCodes,
|
|
115
|
+
});
|
|
116
|
+
if (!doResult.ok) {
|
|
117
|
+
return doResult;
|
|
118
|
+
}
|
|
119
|
+
const response = doResult.value;
|
|
120
|
+
|
|
121
|
+
const responseFields = {
|
|
122
|
+
HttpMeta: { Response: response, Request: req },
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const [result] = await M.match<
|
|
126
|
+
components.LanguageGroupResponse,
|
|
127
|
+
| errors.HTTPValidationError
|
|
128
|
+
| SDKError
|
|
129
|
+
| SDKValidationError
|
|
130
|
+
| UnexpectedClientError
|
|
131
|
+
| InvalidRequestError
|
|
132
|
+
| RequestAbortedError
|
|
133
|
+
| RequestTimeoutError
|
|
134
|
+
| ConnectionError
|
|
135
|
+
>(
|
|
136
|
+
M.json(200, components.LanguageGroupResponse$inboundSchema),
|
|
137
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
138
|
+
M.fail("4XX"),
|
|
139
|
+
M.fail("5XX"),
|
|
140
|
+
)(response, { extraFields: responseFields });
|
|
141
|
+
if (!result.ok) {
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SyllableSDKCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* List Language Groups
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Fetch language groups.
|
|
32
|
+
*/
|
|
33
|
+
export async function languageGroupsList(
|
|
34
|
+
client: SyllableSDKCore,
|
|
35
|
+
request: operations.LanguageGroupsListRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<
|
|
38
|
+
Result<
|
|
39
|
+
components.ListResponseLanguageGroupResponse,
|
|
40
|
+
| errors.HTTPValidationError
|
|
41
|
+
| SDKError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
const parsed = safeParse(
|
|
51
|
+
request,
|
|
52
|
+
(value) => operations.LanguageGroupsListRequest$outboundSchema.parse(value),
|
|
53
|
+
"Input validation failed",
|
|
54
|
+
);
|
|
55
|
+
if (!parsed.ok) {
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
const payload = parsed.value;
|
|
59
|
+
const body = null;
|
|
60
|
+
|
|
61
|
+
const path = pathToFunc("/api/v1/language_groups/")();
|
|
62
|
+
|
|
63
|
+
const query = encodeFormQuery({
|
|
64
|
+
"end_datetime": payload.end_datetime,
|
|
65
|
+
"fields": payload.fields,
|
|
66
|
+
"limit": payload.limit,
|
|
67
|
+
"order_by": payload.order_by,
|
|
68
|
+
"order_by_direction": payload.order_by_direction,
|
|
69
|
+
"page": payload.page,
|
|
70
|
+
"search_field_values": payload.search_field_values,
|
|
71
|
+
"search_fields": payload.search_fields,
|
|
72
|
+
"start_datetime": payload.start_datetime,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const headers = new Headers(compactMap({
|
|
76
|
+
Accept: "application/json",
|
|
77
|
+
}));
|
|
78
|
+
|
|
79
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
80
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
81
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
82
|
+
|
|
83
|
+
const context = {
|
|
84
|
+
baseURL: options?.serverURL ?? "",
|
|
85
|
+
operationID: "language_groups_list",
|
|
86
|
+
oAuth2Scopes: [],
|
|
87
|
+
|
|
88
|
+
resolvedSecurity: requestSecurity,
|
|
89
|
+
|
|
90
|
+
securitySource: client._options.apiKeyHeader,
|
|
91
|
+
retryConfig: options?.retries
|
|
92
|
+
|| client._options.retryConfig
|
|
93
|
+
|| { strategy: "none" },
|
|
94
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const requestRes = client._createRequest(context, {
|
|
98
|
+
security: requestSecurity,
|
|
99
|
+
method: "GET",
|
|
100
|
+
baseURL: options?.serverURL,
|
|
101
|
+
path: path,
|
|
102
|
+
headers: headers,
|
|
103
|
+
query: query,
|
|
104
|
+
body: body,
|
|
105
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
106
|
+
}, options);
|
|
107
|
+
if (!requestRes.ok) {
|
|
108
|
+
return requestRes;
|
|
109
|
+
}
|
|
110
|
+
const req = requestRes.value;
|
|
111
|
+
|
|
112
|
+
const doResult = await client._do(req, {
|
|
113
|
+
context,
|
|
114
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
115
|
+
retryConfig: context.retryConfig,
|
|
116
|
+
retryCodes: context.retryCodes,
|
|
117
|
+
});
|
|
118
|
+
if (!doResult.ok) {
|
|
119
|
+
return doResult;
|
|
120
|
+
}
|
|
121
|
+
const response = doResult.value;
|
|
122
|
+
|
|
123
|
+
const responseFields = {
|
|
124
|
+
HttpMeta: { Response: response, Request: req },
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const [result] = await M.match<
|
|
128
|
+
components.ListResponseLanguageGroupResponse,
|
|
129
|
+
| errors.HTTPValidationError
|
|
130
|
+
| SDKError
|
|
131
|
+
| SDKValidationError
|
|
132
|
+
| UnexpectedClientError
|
|
133
|
+
| InvalidRequestError
|
|
134
|
+
| RequestAbortedError
|
|
135
|
+
| RequestTimeoutError
|
|
136
|
+
| ConnectionError
|
|
137
|
+
>(
|
|
138
|
+
M.json(200, components.ListResponseLanguageGroupResponse$inboundSchema),
|
|
139
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
140
|
+
M.fail("4XX"),
|
|
141
|
+
M.fail("5XX"),
|
|
142
|
+
)(response, { extraFields: responseFields });
|
|
143
|
+
if (!result.ok) {
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SyllableSDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Update Language Group
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Update an existing language group
|
|
31
|
+
*/
|
|
32
|
+
export async function languageGroupsUpdate(
|
|
33
|
+
client: SyllableSDKCore,
|
|
34
|
+
request: components.LanguageGroupUpdateRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): Promise<
|
|
37
|
+
Result<
|
|
38
|
+
components.LanguageGroupResponse,
|
|
39
|
+
| errors.HTTPValidationError
|
|
40
|
+
| SDKError
|
|
41
|
+
| SDKValidationError
|
|
42
|
+
| UnexpectedClientError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
>
|
|
48
|
+
> {
|
|
49
|
+
const parsed = safeParse(
|
|
50
|
+
request,
|
|
51
|
+
(value) =>
|
|
52
|
+
components.LanguageGroupUpdateRequest$outboundSchema.parse(value),
|
|
53
|
+
"Input validation failed",
|
|
54
|
+
);
|
|
55
|
+
if (!parsed.ok) {
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
const payload = parsed.value;
|
|
59
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
60
|
+
|
|
61
|
+
const path = pathToFunc("/api/v1/language_groups/")();
|
|
62
|
+
|
|
63
|
+
const headers = new Headers(compactMap({
|
|
64
|
+
"Content-Type": "application/json",
|
|
65
|
+
Accept: "application/json",
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
69
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
70
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
71
|
+
|
|
72
|
+
const context = {
|
|
73
|
+
baseURL: options?.serverURL ?? "",
|
|
74
|
+
operationID: "language_groups_update",
|
|
75
|
+
oAuth2Scopes: [],
|
|
76
|
+
|
|
77
|
+
resolvedSecurity: requestSecurity,
|
|
78
|
+
|
|
79
|
+
securitySource: client._options.apiKeyHeader,
|
|
80
|
+
retryConfig: options?.retries
|
|
81
|
+
|| client._options.retryConfig
|
|
82
|
+
|| { strategy: "none" },
|
|
83
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const requestRes = client._createRequest(context, {
|
|
87
|
+
security: requestSecurity,
|
|
88
|
+
method: "PUT",
|
|
89
|
+
baseURL: options?.serverURL,
|
|
90
|
+
path: path,
|
|
91
|
+
headers: headers,
|
|
92
|
+
body: body,
|
|
93
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
94
|
+
}, options);
|
|
95
|
+
if (!requestRes.ok) {
|
|
96
|
+
return requestRes;
|
|
97
|
+
}
|
|
98
|
+
const req = requestRes.value;
|
|
99
|
+
|
|
100
|
+
const doResult = await client._do(req, {
|
|
101
|
+
context,
|
|
102
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
103
|
+
retryConfig: context.retryConfig,
|
|
104
|
+
retryCodes: context.retryCodes,
|
|
105
|
+
});
|
|
106
|
+
if (!doResult.ok) {
|
|
107
|
+
return doResult;
|
|
108
|
+
}
|
|
109
|
+
const response = doResult.value;
|
|
110
|
+
|
|
111
|
+
const responseFields = {
|
|
112
|
+
HttpMeta: { Response: response, Request: req },
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const [result] = await M.match<
|
|
116
|
+
components.LanguageGroupResponse,
|
|
117
|
+
| errors.HTTPValidationError
|
|
118
|
+
| SDKError
|
|
119
|
+
| SDKValidationError
|
|
120
|
+
| UnexpectedClientError
|
|
121
|
+
| InvalidRequestError
|
|
122
|
+
| RequestAbortedError
|
|
123
|
+
| RequestTimeoutError
|
|
124
|
+
| ConnectionError
|
|
125
|
+
>(
|
|
126
|
+
M.json(200, components.LanguageGroupResponse$inboundSchema),
|
|
127
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
128
|
+
M.fail("4XX"),
|
|
129
|
+
M.fail("5XX"),
|
|
130
|
+
)(response, { extraFields: responseFields });
|
|
131
|
+
if (!result.ok) {
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
@@ -25,18 +25,15 @@ import * as operations from "../models/operations/index.js";
|
|
|
25
25
|
import { Result } from "../types/fp.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Get
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Fetch a given data source, including its text.
|
|
28
|
+
* Get Full Session Summary By Id
|
|
32
29
|
*/
|
|
33
|
-
export async function
|
|
30
|
+
export async function sessionsFullSummaryGetById(
|
|
34
31
|
client: SyllableSDKCore,
|
|
35
|
-
request: operations.
|
|
32
|
+
request: operations.SessionFullSummaryGetByIdRequest,
|
|
36
33
|
options?: RequestOptions,
|
|
37
34
|
): Promise<
|
|
38
35
|
Result<
|
|
39
|
-
components.
|
|
36
|
+
components.SessionSummaryResponse,
|
|
40
37
|
| errors.HTTPValidationError
|
|
41
38
|
| SDKError
|
|
42
39
|
| SDKValidationError
|
|
@@ -49,7 +46,8 @@ export async function v1GetById(
|
|
|
49
46
|
> {
|
|
50
47
|
const parsed = safeParse(
|
|
51
48
|
request,
|
|
52
|
-
(value) =>
|
|
49
|
+
(value) =>
|
|
50
|
+
operations.SessionFullSummaryGetByIdRequest$outboundSchema.parse(value),
|
|
53
51
|
"Input validation failed",
|
|
54
52
|
);
|
|
55
53
|
if (!parsed.ok) {
|
|
@@ -59,13 +57,15 @@ export async function v1GetById(
|
|
|
59
57
|
const body = null;
|
|
60
58
|
|
|
61
59
|
const pathParams = {
|
|
62
|
-
|
|
60
|
+
session_id: encodeSimple("session_id", payload.session_id, {
|
|
63
61
|
explode: false,
|
|
64
62
|
charEncoding: "percent",
|
|
65
63
|
}),
|
|
66
64
|
};
|
|
67
65
|
|
|
68
|
-
const path = pathToFunc("/api/v1/
|
|
66
|
+
const path = pathToFunc("/api/v1/sessions/full-summary/{session_id}")(
|
|
67
|
+
pathParams,
|
|
68
|
+
);
|
|
69
69
|
|
|
70
70
|
const headers = new Headers(compactMap({
|
|
71
71
|
Accept: "application/json",
|
|
@@ -77,7 +77,7 @@ export async function v1GetById(
|
|
|
77
77
|
|
|
78
78
|
const context = {
|
|
79
79
|
baseURL: options?.serverURL ?? "",
|
|
80
|
-
operationID: "
|
|
80
|
+
operationID: "session_full_summary_get_by_id",
|
|
81
81
|
oAuth2Scopes: [],
|
|
82
82
|
|
|
83
83
|
resolvedSecurity: requestSecurity,
|
|
@@ -119,7 +119,7 @@ export async function v1GetById(
|
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
const [result] = await M.match<
|
|
122
|
-
components.
|
|
122
|
+
components.SessionSummaryResponse,
|
|
123
123
|
| errors.HTTPValidationError
|
|
124
124
|
| SDKError
|
|
125
125
|
| SDKValidationError
|
|
@@ -129,7 +129,7 @@ export async function v1GetById(
|
|
|
129
129
|
| RequestTimeoutError
|
|
130
130
|
| ConnectionError
|
|
131
131
|
>(
|
|
132
|
-
M.json(200, components.
|
|
132
|
+
M.json(200, components.SessionSummaryResponse$inboundSchema),
|
|
133
133
|
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
134
134
|
M.fail("4XX"),
|
|
135
135
|
M.fail("5XX"),
|
package/src/lib/config.ts
CHANGED
|
@@ -57,8 +57,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
57
57
|
export const SDK_METADATA = {
|
|
58
58
|
language: "typescript",
|
|
59
59
|
openapiDocVersion: "0.0.2",
|
|
60
|
-
sdkVersion: "0.1.0-alpha.
|
|
60
|
+
sdkVersion: "0.1.0-alpha.49",
|
|
61
61
|
genVersion: "2.512.4",
|
|
62
62
|
userAgent:
|
|
63
|
-
"speakeasy-sdk/typescript 0.1.0-alpha.
|
|
63
|
+
"speakeasy-sdk/typescript 0.1.0-alpha.49 2.512.4 0.0.2 syllable-sdk",
|
|
64
64
|
} as const;
|
|
@@ -39,6 +39,10 @@ export type AgentCreate = {
|
|
|
39
39
|
* ID of the custom message that should be delivered at the beginning of a conversation with the agent
|
|
40
40
|
*/
|
|
41
41
|
customMessageId: number;
|
|
42
|
+
/**
|
|
43
|
+
* ID of the language group associated with the agent
|
|
44
|
+
*/
|
|
45
|
+
languageGroupId?: number | null | undefined;
|
|
42
46
|
/**
|
|
43
47
|
* The time zone in which the agent operates
|
|
44
48
|
*/
|
|
@@ -49,6 +53,8 @@ export type AgentCreate = {
|
|
|
49
53
|
promptToolDefaults?: Array<AgentToolDefaults> | undefined;
|
|
50
54
|
/**
|
|
51
55
|
* BCP 47 codes of languages the agent supports
|
|
56
|
+
*
|
|
57
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
52
58
|
*/
|
|
53
59
|
languages?: Array<string> | undefined;
|
|
54
60
|
/**
|
|
@@ -77,6 +83,7 @@ export const AgentCreate$inboundSchema: z.ZodType<
|
|
|
77
83
|
type: z.string(),
|
|
78
84
|
prompt_id: z.number().int(),
|
|
79
85
|
custom_message_id: z.number().int(),
|
|
86
|
+
language_group_id: z.nullable(z.number().int()).optional(),
|
|
80
87
|
timezone: z.string(),
|
|
81
88
|
prompt_tool_defaults: z.array(AgentToolDefaults$inboundSchema).optional(),
|
|
82
89
|
languages: z.array(z.string()).optional(),
|
|
@@ -87,6 +94,7 @@ export const AgentCreate$inboundSchema: z.ZodType<
|
|
|
87
94
|
return remap$(v, {
|
|
88
95
|
"prompt_id": "promptId",
|
|
89
96
|
"custom_message_id": "customMessageId",
|
|
97
|
+
"language_group_id": "languageGroupId",
|
|
90
98
|
"prompt_tool_defaults": "promptToolDefaults",
|
|
91
99
|
"tool_headers": "toolHeaders",
|
|
92
100
|
"agent_initiated": "agentInitiated",
|
|
@@ -101,6 +109,7 @@ export type AgentCreate$Outbound = {
|
|
|
101
109
|
type: string;
|
|
102
110
|
prompt_id: number;
|
|
103
111
|
custom_message_id: number;
|
|
112
|
+
language_group_id?: number | null | undefined;
|
|
104
113
|
timezone: string;
|
|
105
114
|
prompt_tool_defaults?: Array<AgentToolDefaults$Outbound> | undefined;
|
|
106
115
|
languages?: Array<string> | undefined;
|
|
@@ -121,6 +130,7 @@ export const AgentCreate$outboundSchema: z.ZodType<
|
|
|
121
130
|
type: z.string(),
|
|
122
131
|
promptId: z.number().int(),
|
|
123
132
|
customMessageId: z.number().int(),
|
|
133
|
+
languageGroupId: z.nullable(z.number().int()).optional(),
|
|
124
134
|
timezone: z.string(),
|
|
125
135
|
promptToolDefaults: z.array(AgentToolDefaults$outboundSchema).optional(),
|
|
126
136
|
languages: z.array(z.string()).optional(),
|
|
@@ -131,6 +141,7 @@ export const AgentCreate$outboundSchema: z.ZodType<
|
|
|
131
141
|
return remap$(v, {
|
|
132
142
|
promptId: "prompt_id",
|
|
133
143
|
customMessageId: "custom_message_id",
|
|
144
|
+
languageGroupId: "language_group_id",
|
|
134
145
|
promptToolDefaults: "prompt_tool_defaults",
|
|
135
146
|
toolHeaders: "tool_headers",
|
|
136
147
|
agentInitiated: "agent_initiated",
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
LanguageCode,
|
|
11
|
+
LanguageCode$inboundSchema,
|
|
12
|
+
LanguageCode$outboundSchema,
|
|
13
|
+
} from "./languagecode.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Language option for an agent.
|
|
17
|
+
*/
|
|
18
|
+
export type AgentLanguage = {
|
|
19
|
+
/**
|
|
20
|
+
* Name of the language
|
|
21
|
+
*/
|
|
22
|
+
name: string;
|
|
23
|
+
/**
|
|
24
|
+
* BCP 47 codes of languages that Syllable supports.
|
|
25
|
+
*/
|
|
26
|
+
code: LanguageCode;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const AgentLanguage$inboundSchema: z.ZodType<
|
|
31
|
+
AgentLanguage,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
unknown
|
|
34
|
+
> = z.object({
|
|
35
|
+
name: z.string(),
|
|
36
|
+
code: LanguageCode$inboundSchema,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export type AgentLanguage$Outbound = {
|
|
41
|
+
name: string;
|
|
42
|
+
code: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const AgentLanguage$outboundSchema: z.ZodType<
|
|
47
|
+
AgentLanguage$Outbound,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
AgentLanguage
|
|
50
|
+
> = z.object({
|
|
51
|
+
name: z.string(),
|
|
52
|
+
code: LanguageCode$outboundSchema,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
58
|
+
*/
|
|
59
|
+
export namespace AgentLanguage$ {
|
|
60
|
+
/** @deprecated use `AgentLanguage$inboundSchema` instead. */
|
|
61
|
+
export const inboundSchema = AgentLanguage$inboundSchema;
|
|
62
|
+
/** @deprecated use `AgentLanguage$outboundSchema` instead. */
|
|
63
|
+
export const outboundSchema = AgentLanguage$outboundSchema;
|
|
64
|
+
/** @deprecated use `AgentLanguage$Outbound` instead. */
|
|
65
|
+
export type Outbound = AgentLanguage$Outbound;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function agentLanguageToJSON(agentLanguage: AgentLanguage): string {
|
|
69
|
+
return JSON.stringify(AgentLanguage$outboundSchema.parse(agentLanguage));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function agentLanguageFromJSON(
|
|
73
|
+
jsonString: string,
|
|
74
|
+
): SafeParseResult<AgentLanguage, SDKValidationError> {
|
|
75
|
+
return safeParse(
|
|
76
|
+
jsonString,
|
|
77
|
+
(x) => AgentLanguage$inboundSchema.parse(JSON.parse(x)),
|
|
78
|
+
`Failed to parse 'AgentLanguage' from JSON`,
|
|
79
|
+
);
|
|
80
|
+
}
|