@openrouter/sdk 0.3.14 → 0.3.16
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/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +1 -1
- package/esm/funcs/apiKeysCreate.d.ts +3 -0
- package/esm/funcs/apiKeysCreate.js +3 -0
- package/esm/funcs/apiKeysDelete.d.ts +3 -0
- package/esm/funcs/apiKeysDelete.js +3 -0
- package/esm/funcs/apiKeysGet.d.ts +3 -0
- package/esm/funcs/apiKeysGet.js +3 -0
- package/esm/funcs/apiKeysList.d.ts +3 -0
- package/esm/funcs/apiKeysList.js +3 -0
- package/esm/funcs/apiKeysUpdate.d.ts +3 -0
- package/esm/funcs/apiKeysUpdate.js +3 -0
- package/esm/funcs/call-model.js +9 -6
- package/esm/funcs/creditsGetCredits.d.ts +1 -1
- package/esm/funcs/creditsGetCredits.js +1 -1
- package/esm/funcs/guardrailsBulkAssignKeys.d.ts +18 -0
- package/esm/funcs/guardrailsBulkAssignKeys.js +89 -0
- package/esm/funcs/guardrailsBulkAssignMembers.d.ts +18 -0
- package/esm/funcs/guardrailsBulkAssignMembers.js +89 -0
- package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +18 -0
- package/esm/funcs/guardrailsBulkUnassignKeys.js +89 -0
- package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +18 -0
- package/esm/funcs/guardrailsBulkUnassignMembers.js +89 -0
- package/esm/funcs/guardrailsCreate.d.ts +18 -0
- package/esm/funcs/guardrailsCreate.js +83 -0
- package/esm/funcs/guardrailsDelete.d.ts +18 -0
- package/esm/funcs/guardrailsDelete.js +88 -0
- package/esm/funcs/{parametersGetParameters.d.ts → guardrailsGet.d.ts} +6 -3
- package/esm/funcs/guardrailsGet.js +88 -0
- package/esm/funcs/guardrailsList.d.ts +18 -0
- package/esm/funcs/guardrailsList.js +87 -0
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +93 -0
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +93 -0
- package/esm/funcs/guardrailsListKeyAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListKeyAssignments.js +87 -0
- package/esm/funcs/guardrailsListMemberAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListMemberAssignments.js +87 -0
- package/esm/funcs/guardrailsUpdate.d.ts +18 -0
- package/esm/funcs/{parametersGetParameters.js → guardrailsUpdate.js} +24 -32
- package/esm/index.d.ts +4 -3
- package/esm/index.js +3 -1
- package/esm/lib/async-params.d.ts +46 -6
- package/esm/lib/async-params.js +10 -2
- package/esm/lib/config.d.ts +2 -4
- package/esm/lib/config.js +2 -2
- package/esm/lib/conversation-state.d.ts +61 -0
- package/esm/lib/conversation-state.js +207 -0
- package/esm/lib/model-result.d.ts +179 -4
- package/esm/lib/model-result.js +719 -191
- package/esm/lib/tool-executor.js +37 -13
- package/esm/lib/tool-types.d.ts +135 -2
- package/esm/lib/tool-types.js +19 -0
- package/esm/lib/tool.d.ts +21 -1
- package/esm/lib/tool.js +7 -0
- package/esm/models/assistantmessage.d.ts +31 -0
- package/esm/models/assistantmessage.js +43 -0
- package/esm/models/chatmessagecontentitemimage.d.ts +8 -8
- package/esm/models/chatmessagecontentitemimage.js +8 -9
- package/esm/models/chatresponsechoice.d.ts +0 -2
- package/esm/models/chatresponsechoice.js +0 -3
- package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
- package/esm/models/chatstreamingmessagechunk.js +2 -2
- package/esm/models/index.d.ts +1 -1
- package/esm/models/index.js +1 -1
- package/esm/models/model.d.ts +4 -0
- package/esm/models/model.js +2 -0
- package/esm/models/operations/bulkassignkeystoguardrail.d.ts +44 -0
- package/esm/models/operations/bulkassignkeystoguardrail.js +42 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +44 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.js +42 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +44 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.js +42 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +44 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.js +42 -0
- package/esm/models/operations/createguardrail.d.ts +136 -0
- package/esm/models/operations/createguardrail.js +85 -0
- package/esm/models/operations/deleteguardrail.d.ts +29 -0
- package/esm/models/operations/deleteguardrail.js +21 -0
- package/esm/models/operations/getguardrail.d.ts +92 -0
- package/esm/models/operations/getguardrail.js +60 -0
- package/esm/models/operations/getmodels.d.ts +28 -1
- package/esm/models/operations/getmodels.js +22 -1
- package/esm/models/operations/index.d.ts +13 -1
- package/esm/models/operations/index.js +13 -1
- package/esm/models/operations/listguardrailkeyassignments.d.ts +76 -0
- package/esm/models/operations/listguardrailkeyassignments.js +51 -0
- package/esm/models/operations/listguardrailmemberassignments.d.ts +72 -0
- package/esm/models/operations/listguardrailmemberassignments.js +49 -0
- package/esm/models/operations/listguardrails.d.ts +98 -0
- package/esm/models/operations/listguardrails.js +66 -0
- package/esm/models/operations/listkeyassignments.d.ts +71 -0
- package/esm/models/operations/listkeyassignments.js +50 -0
- package/esm/models/operations/listmemberassignments.d.ts +67 -0
- package/esm/models/operations/listmemberassignments.js +48 -0
- package/esm/models/operations/updateguardrail.d.ts +151 -0
- package/esm/models/operations/updateguardrail.js +97 -0
- package/esm/models/outputmodality.d.ts +1 -0
- package/esm/models/outputmodality.js +1 -0
- package/esm/models/percentilelatencycutoffs.js +1 -1
- package/esm/models/percentilestats.js +1 -1
- package/esm/models/percentilethroughputcutoffs.js +1 -1
- package/esm/models/preferredmaxlatency.js +1 -1
- package/esm/models/preferredminthroughput.js +1 -1
- package/esm/models/publicendpoint.d.ts +8 -0
- package/esm/models/publicendpoint.js +4 -0
- package/esm/models/publicpricing.d.ts +4 -0
- package/esm/models/publicpricing.js +2 -0
- package/esm/models/responseinputvideo.js +1 -1
- package/esm/models/responsesoutputmodality.js +1 -1
- package/esm/models/schema2.d.ts +92 -0
- package/esm/models/schema2.js +109 -0
- package/esm/sdk/analytics.d.ts +1 -1
- package/esm/sdk/analytics.js +1 -1
- package/esm/sdk/apikeys.d.ts +15 -0
- package/esm/sdk/apikeys.js +15 -0
- package/esm/sdk/credits.d.ts +1 -1
- package/esm/sdk/credits.js +1 -1
- package/esm/sdk/guardrails.d.ts +96 -0
- package/esm/sdk/guardrails.js +139 -0
- package/esm/sdk/sdk.d.ts +3 -3
- package/esm/sdk/sdk.js +4 -4
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.js +1 -0
- package/esm/types/models.d.ts +25 -0
- package/esm/types/models.js +10 -0
- package/jsr.json +1 -1
- package/package.json +12 -10
- package/scripts/check-types.js +127 -0
- package/esm/models/operations/getparameters.d.ts +0 -87
- package/esm/models/operations/getparameters.js +0 -73
- package/esm/models/schema3.d.ts +0 -51
- package/esm/models/schema3.js +0 -62
- package/esm/sdk/parameters.d.ts +0 -9
- package/esm/sdk/parameters.js +0 -16
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 09465ee2cc6d
|
|
4
|
+
*/
|
|
5
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
|
+
import * as M from "../lib/matchers.js";
|
|
7
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
10
|
+
import { pathToFunc } from "../lib/url.js";
|
|
11
|
+
import * as errors from "../models/errors/index.js";
|
|
12
|
+
import * as operations from "../models/operations/index.js";
|
|
13
|
+
import { APIPromise } from "../types/async.js";
|
|
14
|
+
/**
|
|
15
|
+
* List all key assignments
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
|
19
|
+
*/
|
|
20
|
+
export function guardrailsListKeyAssignments(client, request, options) {
|
|
21
|
+
return new APIPromise($do(client, request, options));
|
|
22
|
+
}
|
|
23
|
+
async function $do(client, request, options) {
|
|
24
|
+
const parsed = safeParse(request, (value) => operations.ListKeyAssignmentsRequest$outboundSchema.optional().parse(value), "Input validation failed");
|
|
25
|
+
if (!parsed.ok) {
|
|
26
|
+
return [parsed, { status: "invalid" }];
|
|
27
|
+
}
|
|
28
|
+
const payload = parsed.value;
|
|
29
|
+
const body = null;
|
|
30
|
+
const path = pathToFunc("/guardrails/assignments/keys")();
|
|
31
|
+
const query = encodeFormQuery({
|
|
32
|
+
"limit": payload?.limit,
|
|
33
|
+
"offset": payload?.offset,
|
|
34
|
+
});
|
|
35
|
+
const headers = new Headers(compactMap({
|
|
36
|
+
Accept: "application/json",
|
|
37
|
+
}));
|
|
38
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
39
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
40
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
41
|
+
const context = {
|
|
42
|
+
options: client._options,
|
|
43
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
44
|
+
operationID: "listKeyAssignments",
|
|
45
|
+
oAuth2Scopes: null,
|
|
46
|
+
resolvedSecurity: requestSecurity,
|
|
47
|
+
securitySource: client._options.apiKey,
|
|
48
|
+
retryConfig: options?.retries
|
|
49
|
+
|| client._options.retryConfig
|
|
50
|
+
|| { strategy: "none" },
|
|
51
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
52
|
+
};
|
|
53
|
+
const requestRes = client._createRequest(context, {
|
|
54
|
+
security: requestSecurity,
|
|
55
|
+
method: "GET",
|
|
56
|
+
baseURL: options?.serverURL,
|
|
57
|
+
path: path,
|
|
58
|
+
headers: headers,
|
|
59
|
+
query: query,
|
|
60
|
+
body: body,
|
|
61
|
+
userAgent: client._options.userAgent,
|
|
62
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
63
|
+
}, options);
|
|
64
|
+
if (!requestRes.ok) {
|
|
65
|
+
return [requestRes, { status: "invalid" }];
|
|
66
|
+
}
|
|
67
|
+
const req = requestRes.value;
|
|
68
|
+
const doResult = await client._do(req, {
|
|
69
|
+
context,
|
|
70
|
+
errorCodes: ["401", "4XX", "500", "5XX"],
|
|
71
|
+
retryConfig: context.retryConfig,
|
|
72
|
+
retryCodes: context.retryCodes,
|
|
73
|
+
});
|
|
74
|
+
if (!doResult.ok) {
|
|
75
|
+
return [doResult, { status: "request-error", request: req }];
|
|
76
|
+
}
|
|
77
|
+
const response = doResult.value;
|
|
78
|
+
const responseFields = {
|
|
79
|
+
HttpMeta: { Response: response, Request: req },
|
|
80
|
+
};
|
|
81
|
+
const [result] = await M.match(M.json(200, operations.ListKeyAssignmentsResponse$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
82
|
+
if (!result.ok) {
|
|
83
|
+
return [result, { status: "complete", request: req, response }];
|
|
84
|
+
}
|
|
85
|
+
return [result, { status: "complete", request: req, response }];
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=guardrailsListKeyAssignments.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OpenRouterCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* List all member assignments
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
|
16
|
+
*/
|
|
17
|
+
export declare function guardrailsListMemberAssignments(client: OpenRouterCore, request?: operations.ListMemberAssignmentsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListMemberAssignmentsResponse, errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
//# sourceMappingURL=guardrailsListMemberAssignments.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f4359f4c7ba4
|
|
4
|
+
*/
|
|
5
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
|
+
import * as M from "../lib/matchers.js";
|
|
7
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
10
|
+
import { pathToFunc } from "../lib/url.js";
|
|
11
|
+
import * as errors from "../models/errors/index.js";
|
|
12
|
+
import * as operations from "../models/operations/index.js";
|
|
13
|
+
import { APIPromise } from "../types/async.js";
|
|
14
|
+
/**
|
|
15
|
+
* List all member assignments
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
|
19
|
+
*/
|
|
20
|
+
export function guardrailsListMemberAssignments(client, request, options) {
|
|
21
|
+
return new APIPromise($do(client, request, options));
|
|
22
|
+
}
|
|
23
|
+
async function $do(client, request, options) {
|
|
24
|
+
const parsed = safeParse(request, (value) => operations.ListMemberAssignmentsRequest$outboundSchema.optional().parse(value), "Input validation failed");
|
|
25
|
+
if (!parsed.ok) {
|
|
26
|
+
return [parsed, { status: "invalid" }];
|
|
27
|
+
}
|
|
28
|
+
const payload = parsed.value;
|
|
29
|
+
const body = null;
|
|
30
|
+
const path = pathToFunc("/guardrails/assignments/members")();
|
|
31
|
+
const query = encodeFormQuery({
|
|
32
|
+
"limit": payload?.limit,
|
|
33
|
+
"offset": payload?.offset,
|
|
34
|
+
});
|
|
35
|
+
const headers = new Headers(compactMap({
|
|
36
|
+
Accept: "application/json",
|
|
37
|
+
}));
|
|
38
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
39
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
40
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
41
|
+
const context = {
|
|
42
|
+
options: client._options,
|
|
43
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
44
|
+
operationID: "listMemberAssignments",
|
|
45
|
+
oAuth2Scopes: null,
|
|
46
|
+
resolvedSecurity: requestSecurity,
|
|
47
|
+
securitySource: client._options.apiKey,
|
|
48
|
+
retryConfig: options?.retries
|
|
49
|
+
|| client._options.retryConfig
|
|
50
|
+
|| { strategy: "none" },
|
|
51
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
52
|
+
};
|
|
53
|
+
const requestRes = client._createRequest(context, {
|
|
54
|
+
security: requestSecurity,
|
|
55
|
+
method: "GET",
|
|
56
|
+
baseURL: options?.serverURL,
|
|
57
|
+
path: path,
|
|
58
|
+
headers: headers,
|
|
59
|
+
query: query,
|
|
60
|
+
body: body,
|
|
61
|
+
userAgent: client._options.userAgent,
|
|
62
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
63
|
+
}, options);
|
|
64
|
+
if (!requestRes.ok) {
|
|
65
|
+
return [requestRes, { status: "invalid" }];
|
|
66
|
+
}
|
|
67
|
+
const req = requestRes.value;
|
|
68
|
+
const doResult = await client._do(req, {
|
|
69
|
+
context,
|
|
70
|
+
errorCodes: ["401", "4XX", "500", "5XX"],
|
|
71
|
+
retryConfig: context.retryConfig,
|
|
72
|
+
retryCodes: context.retryCodes,
|
|
73
|
+
});
|
|
74
|
+
if (!doResult.ok) {
|
|
75
|
+
return [doResult, { status: "request-error", request: req }];
|
|
76
|
+
}
|
|
77
|
+
const response = doResult.value;
|
|
78
|
+
const responseFields = {
|
|
79
|
+
HttpMeta: { Response: response, Request: req },
|
|
80
|
+
};
|
|
81
|
+
const [result] = await M.match(M.json(200, operations.ListMemberAssignmentsResponse$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
82
|
+
if (!result.ok) {
|
|
83
|
+
return [result, { status: "complete", request: req, response }];
|
|
84
|
+
}
|
|
85
|
+
return [result, { status: "complete", request: req, response }];
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=guardrailsListMemberAssignments.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OpenRouterCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* Update a guardrail
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
|
16
|
+
*/
|
|
17
|
+
export declare function guardrailsUpdate(client: OpenRouterCore, request: operations.UpdateGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
//# sourceMappingURL=guardrailsUpdate.d.ts.map
|
|
@@ -1,60 +1,53 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id:
|
|
3
|
+
* @generated-id: 383ee7d83fc3
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { safeParse } from "../lib/schemas.js";
|
|
9
|
-
import {
|
|
9
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
10
10
|
import { pathToFunc } from "../lib/url.js";
|
|
11
11
|
import * as errors from "../models/errors/index.js";
|
|
12
12
|
import * as operations from "../models/operations/index.js";
|
|
13
13
|
import { APIPromise } from "../types/async.js";
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Update a guardrail
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
|
16
19
|
*/
|
|
17
|
-
export function
|
|
18
|
-
return new APIPromise($do(client,
|
|
20
|
+
export function guardrailsUpdate(client, request, options) {
|
|
21
|
+
return new APIPromise($do(client, request, options));
|
|
19
22
|
}
|
|
20
|
-
async function $do(client,
|
|
21
|
-
const parsed = safeParse(request, (value) => operations.
|
|
23
|
+
async function $do(client, request, options) {
|
|
24
|
+
const parsed = safeParse(request, (value) => operations.UpdateGuardrailRequest$outboundSchema.parse(value), "Input validation failed");
|
|
22
25
|
if (!parsed.ok) {
|
|
23
26
|
return [parsed, { status: "invalid" }];
|
|
24
27
|
}
|
|
25
28
|
const payload = parsed.value;
|
|
26
|
-
const body =
|
|
29
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
27
30
|
const pathParams = {
|
|
28
|
-
|
|
29
|
-
explode: false,
|
|
30
|
-
charEncoding: "percent",
|
|
31
|
-
}),
|
|
32
|
-
slug: encodeSimple("slug", payload.slug, {
|
|
31
|
+
id: encodeSimple("id", payload.id, {
|
|
33
32
|
explode: false,
|
|
34
33
|
charEncoding: "percent",
|
|
35
34
|
}),
|
|
36
35
|
};
|
|
37
|
-
const path = pathToFunc("/
|
|
38
|
-
const query = encodeFormQuery({
|
|
39
|
-
"provider": payload.provider,
|
|
40
|
-
});
|
|
36
|
+
const path = pathToFunc("/guardrails/{id}")(pathParams);
|
|
41
37
|
const headers = new Headers(compactMap({
|
|
38
|
+
"Content-Type": "application/json",
|
|
42
39
|
Accept: "application/json",
|
|
43
40
|
}));
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
type: "http:bearer",
|
|
48
|
-
value: security?.bearer,
|
|
49
|
-
},
|
|
50
|
-
]);
|
|
41
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
42
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
43
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
51
44
|
const context = {
|
|
52
45
|
options: client._options,
|
|
53
46
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
54
|
-
operationID: "
|
|
47
|
+
operationID: "updateGuardrail",
|
|
55
48
|
oAuth2Scopes: null,
|
|
56
49
|
resolvedSecurity: requestSecurity,
|
|
57
|
-
securitySource:
|
|
50
|
+
securitySource: client._options.apiKey,
|
|
58
51
|
retryConfig: options?.retries
|
|
59
52
|
|| client._options.retryConfig
|
|
60
53
|
|| { strategy: "none" },
|
|
@@ -62,11 +55,10 @@ async function $do(client, security, request, options) {
|
|
|
62
55
|
};
|
|
63
56
|
const requestRes = client._createRequest(context, {
|
|
64
57
|
security: requestSecurity,
|
|
65
|
-
method: "
|
|
58
|
+
method: "PATCH",
|
|
66
59
|
baseURL: options?.serverURL,
|
|
67
60
|
path: path,
|
|
68
61
|
headers: headers,
|
|
69
|
-
query: query,
|
|
70
62
|
body: body,
|
|
71
63
|
userAgent: client._options.userAgent,
|
|
72
64
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
@@ -77,7 +69,7 @@ async function $do(client, security, request, options) {
|
|
|
77
69
|
const req = requestRes.value;
|
|
78
70
|
const doResult = await client._do(req, {
|
|
79
71
|
context,
|
|
80
|
-
errorCodes: ["401", "404", "4XX", "500", "5XX"],
|
|
72
|
+
errorCodes: ["400", "401", "404", "4XX", "500", "5XX"],
|
|
81
73
|
retryConfig: context.retryConfig,
|
|
82
74
|
retryCodes: context.retryCodes,
|
|
83
75
|
});
|
|
@@ -88,10 +80,10 @@ async function $do(client, security, request, options) {
|
|
|
88
80
|
const responseFields = {
|
|
89
81
|
HttpMeta: { Response: response, Request: req },
|
|
90
82
|
};
|
|
91
|
-
const [result] = await M.match(M.json(200, operations.
|
|
83
|
+
const [result] = await M.match(M.json(200, operations.UpdateGuardrailResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
92
84
|
if (!result.ok) {
|
|
93
85
|
return [result, { status: "complete", request: req, response }];
|
|
94
86
|
}
|
|
95
87
|
return [result, { status: "complete", request: req, response }];
|
|
96
88
|
}
|
|
97
|
-
//# sourceMappingURL=
|
|
89
|
+
//# sourceMappingURL=guardrailsUpdate.js.map
|
package/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { CallModelInput, FieldOrAsyncFunction, ResolvedCallModelInput, } from './lib/async-params.js';
|
|
1
|
+
export type { CallModelInput, CallModelInputWithState, FieldOrAsyncFunction, ResolvedCallModelInput, } from './lib/async-params.js';
|
|
2
2
|
export type { Fetcher, HTTPClientOptions } from './lib/http.js';
|
|
3
|
-
export type { ChatStreamEvent, ResponseStreamEvent as EnhancedResponseStreamEvent, InferToolEvent, InferToolEventsUnion, InferToolInput, InferToolOutput, ManualTool, NextTurnParamsContext, NextTurnParamsFunctions, ParsedToolCall, StepResult, StopCondition, StopWhen, Tool, ToolExecutionResult, ToolExecutionResultUnion, ToolPreliminaryResultEvent, ToolStreamEvent, ToolWithExecute, ToolWithGenerator, TurnContext, TypedToolCall, TypedToolCallUnion, Warning, } from './lib/tool-types.js';
|
|
3
|
+
export type { ChatStreamEvent, ConversationState, ConversationStatus, ResponseStreamEvent as EnhancedResponseStreamEvent, HasApprovalTools, InferToolEvent, InferToolEventsUnion, InferToolInput, InferToolOutput, InferToolOutputsUnion, ManualTool, NextTurnParamsContext, NextTurnParamsFunctions, ParsedToolCall, PartialResponse, StateAccessor, StepResult, StopCondition, StopWhen, Tool, ToolApprovalCheck, ToolExecutionResult, ToolExecutionResultUnion, ToolHasApproval, ToolPreliminaryResultEvent, ToolResultEvent, ToolStreamEvent, ToolWithExecute, ToolWithGenerator, TurnContext, TypedToolCall, TypedToolCallUnion, UnsentToolResult, Warning, } from './lib/tool-types.js';
|
|
4
4
|
export type { BuildTurnContextOptions } from './lib/turn-context.js';
|
|
5
5
|
export type { ClaudeBase64ImageSource, ClaudeCacheControl, ClaudeCitationCharLocation, ClaudeCitationContentBlockLocation, ClaudeCitationPageLocation, ClaudeCitationSearchResultLocation, ClaudeCitationWebSearchResultLocation, ClaudeContentBlock, ClaudeContentBlockParam, ClaudeImageBlockParam, ClaudeMessage, ClaudeMessageParam, ClaudeRedactedThinkingBlock, ClaudeServerToolUseBlock, ClaudeStopReason, ClaudeTextBlock, ClaudeTextBlockParam, ClaudeTextCitation, ClaudeThinkingBlock, ClaudeToolResultBlockParam, ClaudeToolUseBlock, ClaudeToolUseBlockParam, ClaudeURLImageSource, ClaudeUsage, } from './models/claude-message.js';
|
|
6
6
|
export { fromClaudeMessages, toClaudeMessage } from './lib/anthropic-compat.js';
|
|
@@ -15,8 +15,9 @@ export { applyNextTurnParamsToRequest, buildNextTurnParamsContext, executeNextTu
|
|
|
15
15
|
export { finishReasonIs, hasToolCall, isStopConditionMet, maxCost, maxTokensUsed, stepCountIs, } from './lib/stop-conditions.js';
|
|
16
16
|
export { extractUnsupportedContent, getUnsupportedContentSummary, hasUnsupportedContent, } from './lib/stream-transformers.js';
|
|
17
17
|
export { tool } from './lib/tool.js';
|
|
18
|
-
export { hasExecuteFunction, isGeneratorTool, isRegularExecuteTool, isToolPreliminaryResultEvent, ToolType, } from './lib/tool-types.js';
|
|
18
|
+
export { hasApprovalRequiredTools, hasExecuteFunction, isGeneratorTool, isRegularExecuteTool, isToolPreliminaryResultEvent, isToolResultEvent, toolHasApprovalConfigured, ToolType, } from './lib/tool-types.js';
|
|
19
19
|
export { buildTurnContext, normalizeInputToArray } from './lib/turn-context.js';
|
|
20
|
+
export { appendToMessages, createInitialState, createRejectedResult, createUnsentResult, generateConversationId, partitionToolCalls, toolRequiresApproval, updateState, } from './lib/conversation-state.js';
|
|
20
21
|
export { ToolEventBroadcaster } from './lib/tool-event-broadcaster.js';
|
|
21
22
|
export * from './sdk/sdk.js';
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.js
CHANGED
|
@@ -18,9 +18,11 @@ export { finishReasonIs, hasToolCall, isStopConditionMet, maxCost, maxTokensUsed
|
|
|
18
18
|
export { extractUnsupportedContent, getUnsupportedContentSummary, hasUnsupportedContent, } from './lib/stream-transformers.js';
|
|
19
19
|
// Tool creation helpers
|
|
20
20
|
export { tool } from './lib/tool.js';
|
|
21
|
-
export { hasExecuteFunction, isGeneratorTool, isRegularExecuteTool, isToolPreliminaryResultEvent, ToolType, } from './lib/tool-types.js';
|
|
21
|
+
export { hasApprovalRequiredTools, hasExecuteFunction, isGeneratorTool, isRegularExecuteTool, isToolPreliminaryResultEvent, isToolResultEvent, toolHasApprovalConfigured, ToolType, } from './lib/tool-types.js';
|
|
22
22
|
// Turn context helpers
|
|
23
23
|
export { buildTurnContext, normalizeInputToArray } from './lib/turn-context.js';
|
|
24
|
+
// Conversation state helpers
|
|
25
|
+
export { appendToMessages, createInitialState, createRejectedResult, createUnsentResult, generateConversationId, partitionToolCalls, toolRequiresApproval, updateState, } from './lib/conversation-state.js';
|
|
24
26
|
// Real-time tool event broadcasting
|
|
25
27
|
export { ToolEventBroadcaster } from './lib/tool-event-broadcaster.js';
|
|
26
28
|
export * from './sdk/sdk.js';
|
|
@@ -1,20 +1,60 @@
|
|
|
1
1
|
import type * as models from '../models/index.js';
|
|
2
|
-
import type { StopWhen, Tool, TurnContext } from './tool-types.js';
|
|
2
|
+
import type { ParsedToolCall, StateAccessor, StopWhen, Tool, TurnContext } from './tool-types.js';
|
|
3
|
+
export type { Tool } from './tool-types.js';
|
|
3
4
|
/**
|
|
4
5
|
* A field can be either a value of type T or a function that computes T
|
|
5
6
|
*/
|
|
6
7
|
export type FieldOrAsyncFunction<T> = T | ((context: TurnContext) => T | Promise<T>);
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
* Each field can independently be a static value or a function that computes the value
|
|
10
|
-
* Generic over TTools to enable proper type inference for stopWhen conditions
|
|
9
|
+
* Base input type for callModel without approval-related fields
|
|
11
10
|
*/
|
|
12
|
-
|
|
11
|
+
type BaseCallModelInput<TTools extends readonly Tool[] = readonly Tool[]> = {
|
|
13
12
|
[K in keyof Omit<models.OpenResponsesRequest, 'stream' | 'tools'>]?: FieldOrAsyncFunction<models.OpenResponsesRequest[K]>;
|
|
14
13
|
} & {
|
|
15
14
|
tools?: TTools;
|
|
16
15
|
stopWhen?: StopWhen<TTools>;
|
|
16
|
+
/**
|
|
17
|
+
* Call-level approval check - overrides tool-level requireApproval setting
|
|
18
|
+
* Receives the tool call and turn context, can be sync or async
|
|
19
|
+
*/
|
|
20
|
+
requireApproval?: (toolCall: ParsedToolCall<TTools[number]>, context: TurnContext) => boolean | Promise<boolean>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Approval params when state is provided (allows approve/reject)
|
|
24
|
+
*/
|
|
25
|
+
type ApprovalParamsWithState<TTools extends readonly Tool[] = readonly Tool[]> = {
|
|
26
|
+
/** State accessor for multi-turn persistence and approval gates */
|
|
27
|
+
state: StateAccessor<TTools>;
|
|
28
|
+
/** Tool call IDs to approve (for resuming from awaiting_approval status) */
|
|
29
|
+
approveToolCalls?: string[];
|
|
30
|
+
/** Tool call IDs to reject (for resuming from awaiting_approval status) */
|
|
31
|
+
rejectToolCalls?: string[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Approval params when state is NOT provided (forbids approve/reject)
|
|
35
|
+
*/
|
|
36
|
+
type ApprovalParamsWithoutState = {
|
|
37
|
+
/** State accessor for multi-turn persistence and approval gates */
|
|
38
|
+
state?: undefined;
|
|
39
|
+
/** Not allowed without state - will cause type error */
|
|
40
|
+
approveToolCalls?: never;
|
|
41
|
+
/** Not allowed without state - will cause type error */
|
|
42
|
+
rejectToolCalls?: never;
|
|
17
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Input type for callModel function
|
|
46
|
+
* Each field can independently be a static value or a function that computes the value
|
|
47
|
+
* Generic over TTools to enable proper type inference for stopWhen conditions
|
|
48
|
+
*
|
|
49
|
+
* Type enforcement:
|
|
50
|
+
* - `approveToolCalls` and `rejectToolCalls` are only valid when `state` is provided
|
|
51
|
+
* - Using these without `state` will cause a TypeScript error
|
|
52
|
+
*/
|
|
53
|
+
export type CallModelInput<TTools extends readonly Tool[] = readonly Tool[]> = BaseCallModelInput<TTools> & (ApprovalParamsWithState<TTools> | ApprovalParamsWithoutState);
|
|
54
|
+
/**
|
|
55
|
+
* CallModelInput variant that requires state - use when approval workflows are needed
|
|
56
|
+
*/
|
|
57
|
+
export type CallModelInputWithState<TTools extends readonly Tool[] = readonly Tool[]> = BaseCallModelInput<TTools> & ApprovalParamsWithState<TTools>;
|
|
18
58
|
/**
|
|
19
59
|
* Resolved CallModelInput (all functions evaluated to values)
|
|
20
60
|
* This is the type after all async functions have been resolved to their values
|
|
@@ -42,7 +82,7 @@ export type ResolvedCallModelInput = Omit<models.OpenResponsesRequest, 'stream'
|
|
|
42
82
|
* // resolved.temperature === 0.2
|
|
43
83
|
* ```
|
|
44
84
|
*/
|
|
45
|
-
export declare function resolveAsyncFunctions(input: CallModelInput
|
|
85
|
+
export declare function resolveAsyncFunctions<TTools extends readonly Tool[] = readonly Tool[]>(input: CallModelInput<TTools>, context: TurnContext): Promise<ResolvedCallModelInput>;
|
|
46
86
|
/**
|
|
47
87
|
* Check if input has any async functions that need resolution
|
|
48
88
|
*
|
package/esm/lib/async-params.js
CHANGED
|
@@ -36,11 +36,19 @@ function buildResolvedRequest(entries) {
|
|
|
36
36
|
export async function resolveAsyncFunctions(input, context) {
|
|
37
37
|
// Build array of resolved entries
|
|
38
38
|
const resolvedEntries = [];
|
|
39
|
+
// Fields that should not be sent to the API (client-side only)
|
|
40
|
+
const clientOnlyFields = new Set([
|
|
41
|
+
'stopWhen', // Handled separately in ModelResult
|
|
42
|
+
'state', // Client-side state management
|
|
43
|
+
'requireApproval', // Client-side approval check function
|
|
44
|
+
'approveToolCalls', // Client-side approval decisions
|
|
45
|
+
'rejectToolCalls', // Client-side rejection decisions
|
|
46
|
+
]);
|
|
39
47
|
// Iterate over all keys in the input
|
|
40
48
|
for (const [key, value] of Object.entries(input)) {
|
|
41
|
-
// Skip
|
|
49
|
+
// Skip client-only fields - they're handled separately and shouldn't be sent to the API
|
|
42
50
|
// Note: tools are already in API format at this point (converted in callModel()), so we include them
|
|
43
|
-
if (key
|
|
51
|
+
if (clientOnlyFields.has(key)) {
|
|
44
52
|
continue;
|
|
45
53
|
}
|
|
46
54
|
if (isParameterFunction(value)) {
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SDKHooks } from "../hooks/hooks.js";
|
|
2
1
|
import { HTTPClient } from "./http.js";
|
|
3
2
|
import { Logger } from "./logger.js";
|
|
4
3
|
import { RetryConfig } from "./retries.js";
|
|
@@ -41,14 +40,13 @@ export type SDKOptions = {
|
|
|
41
40
|
retryConfig?: RetryConfig;
|
|
42
41
|
timeoutMs?: number;
|
|
43
42
|
debugLogger?: Logger;
|
|
44
|
-
hooks?: SDKHooks;
|
|
45
43
|
};
|
|
46
44
|
export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
47
45
|
export declare const SDK_METADATA: {
|
|
48
46
|
readonly language: "typescript";
|
|
49
47
|
readonly openapiDocVersion: "1.0.0";
|
|
50
|
-
readonly sdkVersion: "0.3.
|
|
48
|
+
readonly sdkVersion: "0.3.16";
|
|
51
49
|
readonly genVersion: "2.788.4";
|
|
52
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.3.
|
|
50
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.3.16 2.788.4 1.0.0 @openrouter/sdk";
|
|
53
51
|
};
|
|
54
52
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "0.3.
|
|
29
|
+
sdkVersion: "0.3.16",
|
|
30
30
|
genVersion: "2.788.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.3.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.3.16 2.788.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type * as models from '../models/index.js';
|
|
2
|
+
import type { ConversationState, ParsedToolCall, Tool, TurnContext, UnsentToolResult } from './tool-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Generate a unique ID for a conversation
|
|
5
|
+
* Uses crypto.randomUUID if available, falls back to timestamp + random
|
|
6
|
+
*/
|
|
7
|
+
export declare function generateConversationId(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Create an initial conversation state
|
|
10
|
+
* @param id - Optional custom ID, generates one if not provided
|
|
11
|
+
*/
|
|
12
|
+
export declare function createInitialState<TTools extends readonly Tool[] = readonly Tool[]>(id?: string): ConversationState<TTools>;
|
|
13
|
+
/**
|
|
14
|
+
* Update a conversation state with new values
|
|
15
|
+
* Automatically updates the updatedAt timestamp
|
|
16
|
+
*/
|
|
17
|
+
export declare function updateState<TTools extends readonly Tool[] = readonly Tool[]>(state: ConversationState<TTools>, updates: Partial<Omit<ConversationState<TTools>, 'id' | 'createdAt' | 'updatedAt'>>): ConversationState<TTools>;
|
|
18
|
+
/**
|
|
19
|
+
* Append new items to the message history
|
|
20
|
+
*/
|
|
21
|
+
export declare function appendToMessages(current: models.OpenResponsesInput, newItems: models.OpenResponsesInput1[]): models.OpenResponsesInput;
|
|
22
|
+
/**
|
|
23
|
+
* Check if a tool call requires approval
|
|
24
|
+
* @param toolCall - The tool call to check
|
|
25
|
+
* @param tools - Available tools
|
|
26
|
+
* @param context - Turn context for the approval check
|
|
27
|
+
* @param callLevelCheck - Optional call-level approval function (overrides tool-level), can be async
|
|
28
|
+
*/
|
|
29
|
+
export declare function toolRequiresApproval<TTools extends readonly Tool[]>(toolCall: ParsedToolCall<TTools[number]>, tools: TTools, context: TurnContext, callLevelCheck?: (toolCall: ParsedToolCall<TTools[number]>, context: TurnContext) => boolean | Promise<boolean>): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Partition tool calls into those requiring approval and those that can auto-execute
|
|
32
|
+
* @param toolCalls - Tool calls to partition
|
|
33
|
+
* @param tools - Available tools
|
|
34
|
+
* @param context - Turn context for the approval check
|
|
35
|
+
* @param callLevelCheck - Optional call-level approval function (overrides tool-level), can be async
|
|
36
|
+
*/
|
|
37
|
+
export declare function partitionToolCalls<TTools extends readonly Tool[]>(toolCalls: ParsedToolCall<TTools[number]>[], tools: TTools, context: TurnContext, callLevelCheck?: (toolCall: ParsedToolCall<TTools[number]>, context: TurnContext) => boolean | Promise<boolean>): Promise<{
|
|
38
|
+
requiresApproval: ParsedToolCall<TTools[number]>[];
|
|
39
|
+
autoExecute: ParsedToolCall<TTools[number]>[];
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Create an unsent tool result from a successful execution
|
|
43
|
+
*/
|
|
44
|
+
export declare function createUnsentResult<TTools extends readonly Tool[] = readonly Tool[]>(callId: string, name: string, output: unknown): UnsentToolResult<TTools>;
|
|
45
|
+
/**
|
|
46
|
+
* Create an unsent tool result from a rejection
|
|
47
|
+
*/
|
|
48
|
+
export declare function createRejectedResult<TTools extends readonly Tool[] = readonly Tool[]>(callId: string, name: string, reason?: string): UnsentToolResult<TTools>;
|
|
49
|
+
/**
|
|
50
|
+
* Convert unsent tool results to API format for sending to the model
|
|
51
|
+
*/
|
|
52
|
+
export declare function unsentResultsToAPIFormat(results: UnsentToolResult[]): models.OpenResponsesFunctionCallOutput[];
|
|
53
|
+
/**
|
|
54
|
+
* Extract text content from a response
|
|
55
|
+
*/
|
|
56
|
+
export declare function extractTextFromResponse(response: models.OpenResponsesNonStreamingResponse): string;
|
|
57
|
+
/**
|
|
58
|
+
* Extract tool calls from a response
|
|
59
|
+
*/
|
|
60
|
+
export declare function extractToolCallsFromResponse<TTools extends readonly Tool[]>(response: models.OpenResponsesNonStreamingResponse): ParsedToolCall<TTools[number]>[];
|
|
61
|
+
//# sourceMappingURL=conversation-state.d.ts.map
|