@orq-ai/node 4.11.0-rc.33 → 4.11.0-rc.34
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 +36 -40
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/index.d.ts +0 -4
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -4
- package/models/components/index.js.map +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createeval.js +16 -16
- package/models/operations/createprompt.d.ts +0 -1
- package/models/operations/createprompt.d.ts.map +1 -1
- package/models/operations/createprompt.js +0 -1
- package/models/operations/createprompt.js.map +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/deploymentinvoke.d.ts +0 -1
- package/models/operations/deploymentinvoke.d.ts.map +1 -1
- package/models/operations/deploymentinvoke.js +0 -1
- package/models/operations/deploymentinvoke.js.map +1 -1
- package/models/operations/deployments.d.ts +0 -1
- package/models/operations/deployments.d.ts.map +1 -1
- package/models/operations/deployments.js +0 -1
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/deploymentstream.d.ts +0 -1
- package/models/operations/deploymentstream.d.ts.map +1 -1
- package/models/operations/deploymentstream.js +0 -1
- package/models/operations/deploymentstream.js.map +1 -1
- package/models/operations/getallprompts.d.ts +0 -1
- package/models/operations/getallprompts.d.ts.map +1 -1
- package/models/operations/getallprompts.js +0 -1
- package/models/operations/getallprompts.js.map +1 -1
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.js +16 -16
- package/models/operations/getoneprompt.d.ts +0 -1
- package/models/operations/getoneprompt.d.ts.map +1 -1
- package/models/operations/getoneprompt.js +0 -1
- package/models/operations/getoneprompt.js.map +1 -1
- package/models/operations/getpromptversion.d.ts +0 -1
- package/models/operations/getpromptversion.d.ts.map +1 -1
- package/models/operations/getpromptversion.js +0 -1
- package/models/operations/getpromptversion.js.map +1 -1
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listpromptversions.d.ts +0 -1
- package/models/operations/listpromptversions.d.ts.map +1 -1
- package/models/operations/listpromptversions.js +0 -1
- package/models/operations/listpromptversions.js.map +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +3 -3
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.js +16 -16
- package/models/operations/updateprompt.d.ts +0 -1
- package/models/operations/updateprompt.d.ts.map +1 -1
- package/models/operations/updateprompt.js +0 -1
- package/models/operations/updateprompt.js.map +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +3 -3
- package/sdk/feedback.d.ts +2 -2
- package/sdk/feedback.js +2 -2
- package/sdk/models.d.ts +0 -17
- package/sdk/models.d.ts.map +1 -1
- package/sdk/models.js +0 -20
- package/sdk/models.js.map +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +0 -4
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/createprompt.ts +0 -1
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/deploymentinvoke.ts +0 -1
- package/src/models/operations/deployments.ts +0 -1
- package/src/models/operations/deploymentstream.ts +0 -1
- package/src/models/operations/getallprompts.ts +0 -1
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +16 -16
- package/src/models/operations/getoneprompt.ts +0 -1
- package/src/models/operations/getpromptversion.ts +0 -1
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/listpromptversions.ts +0 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +16 -16
- package/src/models/operations/updateprompt.ts +0 -1
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/feedback.ts +2 -2
- package/src/sdk/models.ts +0 -35
- package/funcs/modelsImportLitellm.d.ts +0 -17
- package/funcs/modelsImportLitellm.d.ts.map +0 -1
- package/funcs/modelsImportLitellm.js +0 -118
- package/funcs/modelsImportLitellm.js.map +0 -1
- package/funcs/modelsListLitellm.d.ts +0 -18
- package/funcs/modelsListLitellm.d.ts.map +0 -1
- package/funcs/modelsListLitellm.js +0 -105
- package/funcs/modelsListLitellm.js.map +0 -1
- package/models/components/litellmmodel.d.ts +0 -18
- package/models/components/litellmmodel.d.ts.map +0 -1
- package/models/components/litellmmodel.js +0 -60
- package/models/components/litellmmodel.js.map +0 -1
- package/models/components/litellmmodelinfo.d.ts +0 -44
- package/models/components/litellmmodelinfo.d.ts.map +0 -1
- package/models/components/litellmmodelinfo.js +0 -83
- package/models/components/litellmmodelinfo.js.map +0 -1
- package/models/components/litellmparams.d.ts +0 -18
- package/models/components/litellmparams.d.ts.map +0 -1
- package/models/components/litellmparams.js +0 -59
- package/models/components/litellmparams.js.map +0 -1
- package/models/components/modeldocument.d.ts +0 -39
- package/models/components/modeldocument.d.ts.map +0 -1
- package/models/components/modeldocument.js +0 -99
- package/models/components/modeldocument.js.map +0 -1
- package/src/funcs/modelsImportLitellm.ts +0 -166
- package/src/funcs/modelsListLitellm.ts +0 -144
- package/src/models/components/litellmmodel.ts +0 -50
- package/src/models/components/litellmmodelinfo.ts +0 -97
- package/src/models/components/litellmparams.ts +0 -43
- package/src/models/components/modeldocument.ts +0 -112
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { OrqCore } from "../core.js";
|
|
7
|
-
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
-
import * as M from "../lib/matchers.js";
|
|
9
|
-
import { compactMap } from "../lib/primitives.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 {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
-
import { Result } from "../types/fp.js";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* List models from configured LiteLLM instance
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Fetches the list of models from the LiteLLM instance configured for the workspace. Requires a stored LiteLLM integration.
|
|
31
|
-
*/
|
|
32
|
-
export function modelsListLitellm(
|
|
33
|
-
client: OrqCore,
|
|
34
|
-
options?: RequestOptions,
|
|
35
|
-
): APIPromise<
|
|
36
|
-
Result<
|
|
37
|
-
Array<{ [k: string]: any }>,
|
|
38
|
-
| OrqError
|
|
39
|
-
| ResponseValidationError
|
|
40
|
-
| ConnectionError
|
|
41
|
-
| RequestAbortedError
|
|
42
|
-
| RequestTimeoutError
|
|
43
|
-
| InvalidRequestError
|
|
44
|
-
| UnexpectedClientError
|
|
45
|
-
| SDKValidationError
|
|
46
|
-
>
|
|
47
|
-
> {
|
|
48
|
-
return new APIPromise($do(
|
|
49
|
-
client,
|
|
50
|
-
options,
|
|
51
|
-
));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async function $do(
|
|
55
|
-
client: OrqCore,
|
|
56
|
-
options?: RequestOptions,
|
|
57
|
-
): Promise<
|
|
58
|
-
[
|
|
59
|
-
Result<
|
|
60
|
-
Array<{ [k: string]: any }>,
|
|
61
|
-
| OrqError
|
|
62
|
-
| ResponseValidationError
|
|
63
|
-
| ConnectionError
|
|
64
|
-
| RequestAbortedError
|
|
65
|
-
| RequestTimeoutError
|
|
66
|
-
| InvalidRequestError
|
|
67
|
-
| UnexpectedClientError
|
|
68
|
-
| SDKValidationError
|
|
69
|
-
>,
|
|
70
|
-
APICall,
|
|
71
|
-
]
|
|
72
|
-
> {
|
|
73
|
-
const path = pathToFunc("/v2/models/litellm/models")();
|
|
74
|
-
|
|
75
|
-
const headers = new Headers(compactMap({
|
|
76
|
-
Accept: "application/json",
|
|
77
|
-
}));
|
|
78
|
-
|
|
79
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
80
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
81
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
82
|
-
|
|
83
|
-
const context = {
|
|
84
|
-
options: client._options,
|
|
85
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
86
|
-
operationID: "ModelListLitellm",
|
|
87
|
-
oAuth2Scopes: null,
|
|
88
|
-
|
|
89
|
-
resolvedSecurity: requestSecurity,
|
|
90
|
-
|
|
91
|
-
securitySource: client._options.apiKey,
|
|
92
|
-
retryConfig: options?.retries
|
|
93
|
-
|| client._options.retryConfig
|
|
94
|
-
|| { strategy: "none" },
|
|
95
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const requestRes = client._createRequest(context, {
|
|
99
|
-
security: requestSecurity,
|
|
100
|
-
method: "GET",
|
|
101
|
-
baseURL: options?.serverURL,
|
|
102
|
-
path: path,
|
|
103
|
-
headers: headers,
|
|
104
|
-
userAgent: client._options.userAgent,
|
|
105
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
106
|
-
}, options);
|
|
107
|
-
if (!requestRes.ok) {
|
|
108
|
-
return [requestRes, { status: "invalid" }];
|
|
109
|
-
}
|
|
110
|
-
const req = requestRes.value;
|
|
111
|
-
|
|
112
|
-
const doResult = await client._do(req, {
|
|
113
|
-
context,
|
|
114
|
-
isErrorStatusCode: (statusCode: number) =>
|
|
115
|
-
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
116
|
-
retryConfig: context.retryConfig,
|
|
117
|
-
retryCodes: context.retryCodes,
|
|
118
|
-
});
|
|
119
|
-
if (!doResult.ok) {
|
|
120
|
-
return [doResult, { status: "request-error", request: req }];
|
|
121
|
-
}
|
|
122
|
-
const response = doResult.value;
|
|
123
|
-
|
|
124
|
-
const [result] = await M.match<
|
|
125
|
-
Array<{ [k: string]: any }>,
|
|
126
|
-
| OrqError
|
|
127
|
-
| ResponseValidationError
|
|
128
|
-
| ConnectionError
|
|
129
|
-
| RequestAbortedError
|
|
130
|
-
| RequestTimeoutError
|
|
131
|
-
| InvalidRequestError
|
|
132
|
-
| UnexpectedClientError
|
|
133
|
-
| SDKValidationError
|
|
134
|
-
>(
|
|
135
|
-
M.json(200, z.array(z.record(z.any()))),
|
|
136
|
-
M.fail([404, "4XX"]),
|
|
137
|
-
M.fail([500, "5XX"]),
|
|
138
|
-
)(response, req);
|
|
139
|
-
if (!result.ok) {
|
|
140
|
-
return [result, { status: "complete", request: req, response }];
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return [result, { status: "complete", request: req, response }];
|
|
144
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
8
|
-
LiteLLMModelInfo,
|
|
9
|
-
LiteLLMModelInfo$Outbound,
|
|
10
|
-
LiteLLMModelInfo$outboundSchema,
|
|
11
|
-
} from "./litellmmodelinfo.js";
|
|
12
|
-
import {
|
|
13
|
-
LiteLLMParams,
|
|
14
|
-
LiteLLMParams$Outbound,
|
|
15
|
-
LiteLLMParams$outboundSchema,
|
|
16
|
-
} from "./litellmparams.js";
|
|
17
|
-
|
|
18
|
-
export type LiteLLMModel = {
|
|
19
|
-
litellmParams: LiteLLMParams;
|
|
20
|
-
modelInfo: LiteLLMModelInfo;
|
|
21
|
-
modelName: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/** @internal */
|
|
25
|
-
export type LiteLLMModel$Outbound = {
|
|
26
|
-
litellm_params: LiteLLMParams$Outbound;
|
|
27
|
-
model_info: LiteLLMModelInfo$Outbound;
|
|
28
|
-
model_name: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/** @internal */
|
|
32
|
-
export const LiteLLMModel$outboundSchema: z.ZodType<
|
|
33
|
-
LiteLLMModel$Outbound,
|
|
34
|
-
z.ZodTypeDef,
|
|
35
|
-
LiteLLMModel
|
|
36
|
-
> = z.object({
|
|
37
|
-
litellmParams: LiteLLMParams$outboundSchema,
|
|
38
|
-
modelInfo: LiteLLMModelInfo$outboundSchema,
|
|
39
|
-
modelName: z.string(),
|
|
40
|
-
}).transform((v) => {
|
|
41
|
-
return remap$(v, {
|
|
42
|
-
litellmParams: "litellm_params",
|
|
43
|
-
modelInfo: "model_info",
|
|
44
|
-
modelName: "model_name",
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export function liteLLMModelToJSON(liteLLMModel: LiteLLMModel): string {
|
|
49
|
-
return JSON.stringify(LiteLLMModel$outboundSchema.parse(liteLLMModel));
|
|
50
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
|
|
8
|
-
export type LiteLLMModelInfo = {
|
|
9
|
-
dbModel: boolean | null;
|
|
10
|
-
id: string | null;
|
|
11
|
-
inputCostPerToken?: number | undefined;
|
|
12
|
-
key: string | null;
|
|
13
|
-
litellmProvider: string | null;
|
|
14
|
-
maxInputTokens?: number | undefined;
|
|
15
|
-
maxOutputTokens?: number | undefined;
|
|
16
|
-
mode: string | null;
|
|
17
|
-
outputCostPerToken?: number | undefined;
|
|
18
|
-
supportedOpenaiParams?: Array<string> | null | undefined;
|
|
19
|
-
supportsFunctionCalling?: boolean | undefined;
|
|
20
|
-
supportsNativeStreaming?: boolean | undefined;
|
|
21
|
-
supportsReasoning?: boolean | undefined;
|
|
22
|
-
supportsResponseSchema?: boolean | undefined;
|
|
23
|
-
supportsSystemMessages?: boolean | undefined;
|
|
24
|
-
supportsToolChoice?: boolean | undefined;
|
|
25
|
-
supportsVision?: boolean | undefined;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @internal */
|
|
29
|
-
export type LiteLLMModelInfo$Outbound = {
|
|
30
|
-
db_model: boolean | null;
|
|
31
|
-
id: string | null;
|
|
32
|
-
input_cost_per_token?: number | undefined;
|
|
33
|
-
key: string | null;
|
|
34
|
-
litellm_provider: string | null;
|
|
35
|
-
max_input_tokens?: number | undefined;
|
|
36
|
-
max_output_tokens?: number | undefined;
|
|
37
|
-
mode: string | null;
|
|
38
|
-
output_cost_per_token?: number | undefined;
|
|
39
|
-
supported_openai_params?: Array<string> | null | undefined;
|
|
40
|
-
supports_function_calling?: boolean | undefined;
|
|
41
|
-
supports_native_streaming?: boolean | undefined;
|
|
42
|
-
supports_reasoning?: boolean | undefined;
|
|
43
|
-
supports_response_schema?: boolean | undefined;
|
|
44
|
-
supports_system_messages?: boolean | undefined;
|
|
45
|
-
supports_tool_choice?: boolean | undefined;
|
|
46
|
-
supports_vision?: boolean | undefined;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/** @internal */
|
|
50
|
-
export const LiteLLMModelInfo$outboundSchema: z.ZodType<
|
|
51
|
-
LiteLLMModelInfo$Outbound,
|
|
52
|
-
z.ZodTypeDef,
|
|
53
|
-
LiteLLMModelInfo
|
|
54
|
-
> = z.object({
|
|
55
|
-
dbModel: z.nullable(z.boolean()),
|
|
56
|
-
id: z.nullable(z.string()),
|
|
57
|
-
inputCostPerToken: z.number().optional(),
|
|
58
|
-
key: z.nullable(z.string()),
|
|
59
|
-
litellmProvider: z.nullable(z.string()),
|
|
60
|
-
maxInputTokens: z.number().int().optional(),
|
|
61
|
-
maxOutputTokens: z.number().int().optional(),
|
|
62
|
-
mode: z.nullable(z.string()),
|
|
63
|
-
outputCostPerToken: z.number().optional(),
|
|
64
|
-
supportedOpenaiParams: z.nullable(z.array(z.string())).optional(),
|
|
65
|
-
supportsFunctionCalling: z.boolean().optional(),
|
|
66
|
-
supportsNativeStreaming: z.boolean().optional(),
|
|
67
|
-
supportsReasoning: z.boolean().optional(),
|
|
68
|
-
supportsResponseSchema: z.boolean().optional(),
|
|
69
|
-
supportsSystemMessages: z.boolean().optional(),
|
|
70
|
-
supportsToolChoice: z.boolean().optional(),
|
|
71
|
-
supportsVision: z.boolean().optional(),
|
|
72
|
-
}).transform((v) => {
|
|
73
|
-
return remap$(v, {
|
|
74
|
-
dbModel: "db_model",
|
|
75
|
-
inputCostPerToken: "input_cost_per_token",
|
|
76
|
-
litellmProvider: "litellm_provider",
|
|
77
|
-
maxInputTokens: "max_input_tokens",
|
|
78
|
-
maxOutputTokens: "max_output_tokens",
|
|
79
|
-
outputCostPerToken: "output_cost_per_token",
|
|
80
|
-
supportedOpenaiParams: "supported_openai_params",
|
|
81
|
-
supportsFunctionCalling: "supports_function_calling",
|
|
82
|
-
supportsNativeStreaming: "supports_native_streaming",
|
|
83
|
-
supportsReasoning: "supports_reasoning",
|
|
84
|
-
supportsResponseSchema: "supports_response_schema",
|
|
85
|
-
supportsSystemMessages: "supports_system_messages",
|
|
86
|
-
supportsToolChoice: "supports_tool_choice",
|
|
87
|
-
supportsVision: "supports_vision",
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export function liteLLMModelInfoToJSON(
|
|
92
|
-
liteLLMModelInfo: LiteLLMModelInfo,
|
|
93
|
-
): string {
|
|
94
|
-
return JSON.stringify(
|
|
95
|
-
LiteLLMModelInfo$outboundSchema.parse(liteLLMModelInfo),
|
|
96
|
-
);
|
|
97
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
|
|
8
|
-
export type LiteLLMParams = {
|
|
9
|
-
mergeReasoningContentInChoices: boolean;
|
|
10
|
-
model: string;
|
|
11
|
-
useInPassThrough: boolean;
|
|
12
|
-
useLitellmProxy: boolean;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/** @internal */
|
|
16
|
-
export type LiteLLMParams$Outbound = {
|
|
17
|
-
merge_reasoning_content_in_choices: boolean;
|
|
18
|
-
model: string;
|
|
19
|
-
use_in_pass_through: boolean;
|
|
20
|
-
use_litellm_proxy: boolean;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/** @internal */
|
|
24
|
-
export const LiteLLMParams$outboundSchema: z.ZodType<
|
|
25
|
-
LiteLLMParams$Outbound,
|
|
26
|
-
z.ZodTypeDef,
|
|
27
|
-
LiteLLMParams
|
|
28
|
-
> = z.object({
|
|
29
|
-
mergeReasoningContentInChoices: z.boolean(),
|
|
30
|
-
model: z.string(),
|
|
31
|
-
useInPassThrough: z.boolean(),
|
|
32
|
-
useLitellmProxy: z.boolean(),
|
|
33
|
-
}).transform((v) => {
|
|
34
|
-
return remap$(v, {
|
|
35
|
-
mergeReasoningContentInChoices: "merge_reasoning_content_in_choices",
|
|
36
|
-
useInPassThrough: "use_in_pass_through",
|
|
37
|
-
useLitellmProxy: "use_litellm_proxy",
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
export function liteLLMParamsToJSON(liteLLMParams: LiteLLMParams): string {
|
|
42
|
-
return JSON.stringify(LiteLLMParams$outboundSchema.parse(liteLLMParams));
|
|
43
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
import {
|
|
11
|
-
ModelConfigurationResponse,
|
|
12
|
-
ModelConfigurationResponse$inboundSchema,
|
|
13
|
-
} from "./modelconfigurationresponse.js";
|
|
14
|
-
import { ModelMetadata, ModelMetadata$inboundSchema } from "./modelmetadata.js";
|
|
15
|
-
import {
|
|
16
|
-
ModelParameterDocument,
|
|
17
|
-
ModelParameterDocument$inboundSchema,
|
|
18
|
-
} from "./modelparameterdocument.js";
|
|
19
|
-
|
|
20
|
-
export type ModelDocument = {
|
|
21
|
-
configuration: ModelConfigurationResponse;
|
|
22
|
-
created: Date;
|
|
23
|
-
description: string | null;
|
|
24
|
-
displayName: string;
|
|
25
|
-
docsUrl: string | null;
|
|
26
|
-
enabled: boolean;
|
|
27
|
-
enabledForEndpoints: boolean;
|
|
28
|
-
enabledForPlayground: boolean;
|
|
29
|
-
hasCpuPricing: boolean;
|
|
30
|
-
hasFunctions: boolean;
|
|
31
|
-
id: string;
|
|
32
|
-
inputCost: number | null;
|
|
33
|
-
inputCurrency: string;
|
|
34
|
-
isActive: boolean;
|
|
35
|
-
metadata: ModelMetadata;
|
|
36
|
-
modelDeveloper?: string | undefined;
|
|
37
|
-
modelFamily?: string | undefined;
|
|
38
|
-
modelId: string;
|
|
39
|
-
modelType: string;
|
|
40
|
-
outputCost: number | null;
|
|
41
|
-
outputCurrency: string;
|
|
42
|
-
owner: string;
|
|
43
|
-
parameters: Array<ModelParameterDocument> | null;
|
|
44
|
-
pricingUrl: string | null;
|
|
45
|
-
provider: string;
|
|
46
|
-
refId: string;
|
|
47
|
-
updated: Date;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/** @internal */
|
|
51
|
-
export const ModelDocument$inboundSchema: z.ZodType<
|
|
52
|
-
ModelDocument,
|
|
53
|
-
z.ZodTypeDef,
|
|
54
|
-
unknown
|
|
55
|
-
> = z.object({
|
|
56
|
-
configuration: ModelConfigurationResponse$inboundSchema,
|
|
57
|
-
created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
58
|
-
description: z.nullable(z.string()),
|
|
59
|
-
display_name: z.string(),
|
|
60
|
-
docs_url: z.nullable(z.string()),
|
|
61
|
-
enabled: z.boolean(),
|
|
62
|
-
enabled_for_endpoints: z.boolean(),
|
|
63
|
-
enabled_for_playground: z.boolean(),
|
|
64
|
-
has_cpu_pricing: z.boolean(),
|
|
65
|
-
has_functions: z.boolean(),
|
|
66
|
-
id: z.string(),
|
|
67
|
-
input_cost: z.nullable(z.number()),
|
|
68
|
-
input_currency: z.string(),
|
|
69
|
-
is_active: z.boolean(),
|
|
70
|
-
metadata: ModelMetadata$inboundSchema,
|
|
71
|
-
model_developer: z.string().optional(),
|
|
72
|
-
model_family: z.string().optional(),
|
|
73
|
-
model_id: z.string(),
|
|
74
|
-
model_type: z.string(),
|
|
75
|
-
output_cost: z.nullable(z.number()),
|
|
76
|
-
output_currency: z.string(),
|
|
77
|
-
owner: z.string(),
|
|
78
|
-
parameters: z.nullable(z.array(ModelParameterDocument$inboundSchema)),
|
|
79
|
-
pricing_url: z.nullable(z.string()),
|
|
80
|
-
provider: z.string(),
|
|
81
|
-
refId: z.string(),
|
|
82
|
-
updated: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
83
|
-
}).transform((v) => {
|
|
84
|
-
return remap$(v, {
|
|
85
|
-
"display_name": "displayName",
|
|
86
|
-
"docs_url": "docsUrl",
|
|
87
|
-
"enabled_for_endpoints": "enabledForEndpoints",
|
|
88
|
-
"enabled_for_playground": "enabledForPlayground",
|
|
89
|
-
"has_cpu_pricing": "hasCpuPricing",
|
|
90
|
-
"has_functions": "hasFunctions",
|
|
91
|
-
"input_cost": "inputCost",
|
|
92
|
-
"input_currency": "inputCurrency",
|
|
93
|
-
"is_active": "isActive",
|
|
94
|
-
"model_developer": "modelDeveloper",
|
|
95
|
-
"model_family": "modelFamily",
|
|
96
|
-
"model_id": "modelId",
|
|
97
|
-
"model_type": "modelType",
|
|
98
|
-
"output_cost": "outputCost",
|
|
99
|
-
"output_currency": "outputCurrency",
|
|
100
|
-
"pricing_url": "pricingUrl",
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
export function modelDocumentFromJSON(
|
|
105
|
-
jsonString: string,
|
|
106
|
-
): SafeParseResult<ModelDocument, SDKValidationError> {
|
|
107
|
-
return safeParse(
|
|
108
|
-
jsonString,
|
|
109
|
-
(x) => ModelDocument$inboundSchema.parse(JSON.parse(x)),
|
|
110
|
-
`Failed to parse 'ModelDocument' from JSON`,
|
|
111
|
-
);
|
|
112
|
-
}
|