@tinyweb_dev/agent-framework-llm 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cache-policy.d.ts +3 -0
- package/dist/cache-policy.d.ts.map +1 -0
- package/dist/index.cjs +2956 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2831 -0
- package/dist/index.js.map +1 -0
- package/dist/llm.cjs +1718 -0
- package/dist/llm.cjs.map +1 -0
- package/dist/llm.d.ts +284 -0
- package/dist/llm.d.ts.map +1 -0
- package/dist/llm.js +1692 -0
- package/dist/llm.js.map +1 -0
- package/dist/protocols/openai-chat.cjs +2443 -0
- package/dist/protocols/openai-chat.cjs.map +1 -0
- package/dist/protocols/openai-chat.d.ts +357 -0
- package/dist/protocols/openai-chat.d.ts.map +1 -0
- package/dist/protocols/openai-chat.js +2414 -0
- package/dist/protocols/openai-chat.js.map +1 -0
- package/dist/protocols/openai-compatible-chat.cjs +2443 -0
- package/dist/protocols/openai-compatible-chat.cjs.map +1 -0
- package/dist/protocols/openai-compatible-chat.d.ts +77 -0
- package/dist/protocols/openai-compatible-chat.d.ts.map +1 -0
- package/dist/protocols/openai-compatible-chat.js +2419 -0
- package/dist/protocols/openai-compatible-chat.js.map +1 -0
- package/dist/protocols/shared.cjs +904 -0
- package/dist/protocols/shared.cjs.map +1 -0
- package/dist/protocols/shared.d.ts +51 -0
- package/dist/protocols/shared.d.ts.map +1 -0
- package/dist/protocols/shared.js +857 -0
- package/dist/protocols/shared.js.map +1 -0
- package/dist/protocols/utils/openai-options.d.ts +15 -0
- package/dist/protocols/utils/openai-options.d.ts.map +1 -0
- package/dist/protocols/utils/tool-stream.d.ts +78 -0
- package/dist/protocols/utils/tool-stream.d.ts.map +1 -0
- package/dist/provider.cjs +20 -0
- package/dist/provider.cjs.map +1 -0
- package/dist/provider.d.ts +19 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +17 -0
- package/dist/provider.js.map +1 -0
- package/{src/providers/openai-compatible-profile.ts → dist/providers/openai-compatible-profile.cjs} +12 -12
- package/dist/providers/openai-compatible-profile.cjs.map +1 -0
- package/dist/providers/openai-compatible-profile.d.ts +52 -0
- package/dist/providers/openai-compatible-profile.d.ts.map +1 -0
- package/dist/providers/openai-compatible-profile.js +21 -0
- package/dist/providers/openai-compatible-profile.js.map +1 -0
- package/dist/providers/openai-compatible.cjs +2533 -0
- package/dist/providers/openai-compatible.cjs.map +1 -0
- package/dist/providers/openai-compatible.d.ts +128 -0
- package/dist/providers/openai-compatible.d.ts.map +1 -0
- package/dist/providers/openai-compatible.js +2495 -0
- package/dist/providers/openai-compatible.js.map +1 -0
- package/dist/providers/openai-options.cjs +797 -0
- package/dist/providers/openai-options.cjs.map +1 -0
- package/dist/providers/openai-options.d.ts +29 -0
- package/dist/providers/openai-options.d.ts.map +1 -0
- package/dist/providers/openai-options.js +792 -0
- package/dist/providers/openai-options.js.map +1 -0
- package/dist/providers/openai.cjs +2517 -0
- package/dist/providers/openai.cjs.map +1 -0
- package/dist/providers/openai.d.ts +87 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +2489 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/route/auth-options.cjs +855 -0
- package/dist/route/auth-options.cjs.map +1 -0
- package/dist/route/auth-options.d.ts +25 -0
- package/dist/route/auth-options.d.ts.map +1 -0
- package/dist/route/auth-options.js +852 -0
- package/dist/route/auth-options.js.map +1 -0
- package/dist/route/auth.cjs +855 -0
- package/dist/route/auth.cjs.map +1 -0
- package/dist/route/auth.d.ts +51 -0
- package/dist/route/auth.d.ts.map +1 -0
- package/dist/route/auth.js +836 -0
- package/dist/route/auth.js.map +1 -0
- package/dist/route/client.cjs +1844 -0
- package/dist/route/client.cjs.map +1 -0
- package/dist/route/client.d.ts +268 -0
- package/dist/route/client.d.ts.map +1 -0
- package/dist/route/client.js +1830 -0
- package/dist/route/client.js.map +1 -0
- package/dist/route/endpoint.cjs +756 -0
- package/dist/route/endpoint.cjs.map +1 -0
- package/dist/route/endpoint.d.ts +13 -0
- package/dist/route/endpoint.d.ts.map +1 -0
- package/dist/route/endpoint.js +752 -0
- package/dist/route/endpoint.js.map +1 -0
- package/dist/route/executor.cjs +1077 -0
- package/dist/route/executor.cjs.map +1 -0
- package/dist/route/executor.d.ts +13 -0
- package/dist/route/executor.d.ts.map +1 -0
- package/dist/route/executor.js +1072 -0
- package/dist/route/executor.js.map +1 -0
- package/dist/route/framing.cjs +773 -0
- package/dist/route/framing.cjs.map +1 -0
- package/dist/route/framing.d.ts +9 -0
- package/dist/route/framing.d.ts.map +1 -0
- package/dist/route/framing.js +750 -0
- package/dist/route/framing.js.map +1 -0
- package/dist/route/overflow-detect.d.ts +18 -0
- package/dist/route/overflow-detect.d.ts.map +1 -0
- package/dist/route/protocol.cjs +25 -0
- package/dist/route/protocol.cjs.map +1 -0
- package/dist/route/protocol.d.ts +40 -0
- package/dist/route/protocol.d.ts.map +1 -0
- package/dist/route/protocol.js +21 -0
- package/dist/route/protocol.js.map +1 -0
- package/dist/route/transport/http.d.ts +48 -0
- package/dist/route/transport/http.d.ts.map +1 -0
- package/dist/route/transport/index.cjs +969 -0
- package/dist/route/transport/index.cjs.map +1 -0
- package/dist/route/transport/index.d.ts +13 -0
- package/dist/route/transport/index.d.ts.map +1 -0
- package/dist/route/transport/index.js +967 -0
- package/dist/route/transport/index.js.map +1 -0
- package/dist/schema/errors.d.ts +181 -0
- package/dist/schema/errors.d.ts.map +1 -0
- package/dist/schema/events.d.ts +3224 -0
- package/dist/schema/events.d.ts.map +1 -0
- package/dist/schema/ids.d.ts +31 -0
- package/dist/schema/ids.d.ts.map +1 -0
- package/dist/schema/index.cjs +847 -0
- package/dist/schema/index.cjs.map +1 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +777 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/messages.d.ts +292 -0
- package/dist/schema/messages.d.ts.map +1 -0
- package/dist/schema/options.d.ts +123 -0
- package/dist/schema/options.d.ts.map +1 -0
- package/dist/tool-runtime.cjs +907 -0
- package/dist/tool-runtime.cjs.map +1 -0
- package/dist/tool-runtime.d.ts +50 -0
- package/dist/tool-runtime.d.ts.map +1 -0
- package/dist/tool-runtime.js +901 -0
- package/dist/tool-runtime.js.map +1 -0
- package/dist/tool.cjs +802 -0
- package/dist/tool.cjs.map +1 -0
- package/dist/tool.d.ts +111 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +796 -0
- package/dist/tool.js.map +1 -0
- package/package.json +112 -29
- package/src/cache-policy.ts +0 -92
- package/src/index.ts +0 -62
- package/src/llm.ts +0 -210
- package/src/protocols/openai-chat.ts +0 -464
- package/src/protocols/openai-compatible-chat.ts +0 -29
- package/src/protocols/shared.ts +0 -204
- package/src/protocols/utils/openai-options.ts +0 -56
- package/src/protocols/utils/tool-stream.ts +0 -135
- package/src/provider.ts +0 -32
- package/src/providers/openai-compatible.ts +0 -69
- package/src/providers/openai-options.ts +0 -71
- package/src/providers/openai.ts +0 -39
- package/src/route/auth-options.ts +0 -48
- package/src/route/auth.ts +0 -198
- package/src/route/client.ts +0 -459
- package/src/route/endpoint.ts +0 -28
- package/src/route/executor.ts +0 -396
- package/src/route/framing.ts +0 -13
- package/src/route/overflow-detect.ts +0 -74
- package/src/route/protocol.ts +0 -48
- package/src/route/transport/http.ts +0 -123
- package/src/route/transport/index.ts +0 -21
- package/src/schema/errors.ts +0 -225
- package/src/schema/events.ts +0 -335
- package/src/schema/ids.ts +0 -44
- package/src/schema/index.ts +0 -6
- package/src/schema/messages.ts +0 -250
- package/src/schema/options.ts +0 -231
- package/src/tool-runtime.ts +0 -301
- package/src/tool.ts +0 -212
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Route } from "../route/client";
|
|
3
|
+
import { HttpTransport } from "../route/transport";
|
|
4
|
+
import { Protocol } from "../route/protocol";
|
|
5
|
+
import { LLMEvent, Usage, type FinishReason } from "../schema";
|
|
6
|
+
import { ToolStream } from "./utils/tool-stream";
|
|
7
|
+
export declare const DEFAULT_BASE_URL = "https://api.openai.com/v1";
|
|
8
|
+
export declare const PATH = "/chat/completions";
|
|
9
|
+
export declare const bodyFields: {
|
|
10
|
+
model: Schema.String;
|
|
11
|
+
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
12
|
+
readonly role: Schema.Literal<"system">;
|
|
13
|
+
readonly content: Schema.String;
|
|
14
|
+
}>, Schema.Struct<{
|
|
15
|
+
readonly role: Schema.Literal<"user">;
|
|
16
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
17
|
+
readonly type: Schema.Literal<"text">;
|
|
18
|
+
readonly text: Schema.String;
|
|
19
|
+
}>, Schema.Struct<{
|
|
20
|
+
readonly type: Schema.Literal<"image_url">;
|
|
21
|
+
readonly image_url: Schema.Struct<{
|
|
22
|
+
readonly url: Schema.String;
|
|
23
|
+
}>;
|
|
24
|
+
}>]>>]>;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly role: Schema.Literal<"assistant">;
|
|
27
|
+
readonly content: Schema.NullOr<Schema.String>;
|
|
28
|
+
readonly tool_calls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
29
|
+
readonly id: Schema.String;
|
|
30
|
+
readonly type: Schema.tag<"function">;
|
|
31
|
+
readonly function: Schema.Struct<{
|
|
32
|
+
readonly name: Schema.String;
|
|
33
|
+
readonly arguments: Schema.String;
|
|
34
|
+
}>;
|
|
35
|
+
}>>>;
|
|
36
|
+
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
readonly role: Schema.Literal<"tool">;
|
|
39
|
+
readonly tool_call_id: Schema.String;
|
|
40
|
+
readonly content: Schema.String;
|
|
41
|
+
}>]>>;
|
|
42
|
+
tools: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
43
|
+
readonly type: Schema.tag<"function">;
|
|
44
|
+
readonly function: Schema.Struct<{
|
|
45
|
+
readonly name: Schema.String;
|
|
46
|
+
readonly description: Schema.String;
|
|
47
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
48
|
+
}>;
|
|
49
|
+
}>>>;
|
|
50
|
+
tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
51
|
+
readonly type: Schema.tag<"function">;
|
|
52
|
+
readonly function: Schema.Struct<{
|
|
53
|
+
readonly name: Schema.String;
|
|
54
|
+
}>;
|
|
55
|
+
}>]>>;
|
|
56
|
+
stream: Schema.Literal<true>;
|
|
57
|
+
stream_options: Schema.optional<Schema.Struct<{
|
|
58
|
+
readonly include_usage: Schema.Boolean;
|
|
59
|
+
}>>;
|
|
60
|
+
store: Schema.optional<Schema.Boolean>;
|
|
61
|
+
reasoning_effort: Schema.optional<Schema.Literals<("none" | "minimal" | "low" | "medium" | "high" | "xhigh")[]>>;
|
|
62
|
+
max_tokens: Schema.optional<Schema.Number>;
|
|
63
|
+
temperature: Schema.optional<Schema.Number>;
|
|
64
|
+
top_p: Schema.optional<Schema.Number>;
|
|
65
|
+
frequency_penalty: Schema.optional<Schema.Number>;
|
|
66
|
+
presence_penalty: Schema.optional<Schema.Number>;
|
|
67
|
+
seed: Schema.optional<Schema.Number>;
|
|
68
|
+
stop: Schema.optional<Schema.$Array<Schema.String>>;
|
|
69
|
+
};
|
|
70
|
+
declare const OpenAIChatBody: Schema.Struct<{
|
|
71
|
+
model: Schema.String;
|
|
72
|
+
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
73
|
+
readonly role: Schema.Literal<"system">;
|
|
74
|
+
readonly content: Schema.String;
|
|
75
|
+
}>, Schema.Struct<{
|
|
76
|
+
readonly role: Schema.Literal<"user">;
|
|
77
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
78
|
+
readonly type: Schema.Literal<"text">;
|
|
79
|
+
readonly text: Schema.String;
|
|
80
|
+
}>, Schema.Struct<{
|
|
81
|
+
readonly type: Schema.Literal<"image_url">;
|
|
82
|
+
readonly image_url: Schema.Struct<{
|
|
83
|
+
readonly url: Schema.String;
|
|
84
|
+
}>;
|
|
85
|
+
}>]>>]>;
|
|
86
|
+
}>, Schema.Struct<{
|
|
87
|
+
readonly role: Schema.Literal<"assistant">;
|
|
88
|
+
readonly content: Schema.NullOr<Schema.String>;
|
|
89
|
+
readonly tool_calls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
90
|
+
readonly id: Schema.String;
|
|
91
|
+
readonly type: Schema.tag<"function">;
|
|
92
|
+
readonly function: Schema.Struct<{
|
|
93
|
+
readonly name: Schema.String;
|
|
94
|
+
readonly arguments: Schema.String;
|
|
95
|
+
}>;
|
|
96
|
+
}>>>;
|
|
97
|
+
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
98
|
+
}>, Schema.Struct<{
|
|
99
|
+
readonly role: Schema.Literal<"tool">;
|
|
100
|
+
readonly tool_call_id: Schema.String;
|
|
101
|
+
readonly content: Schema.String;
|
|
102
|
+
}>]>>;
|
|
103
|
+
tools: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
104
|
+
readonly type: Schema.tag<"function">;
|
|
105
|
+
readonly function: Schema.Struct<{
|
|
106
|
+
readonly name: Schema.String;
|
|
107
|
+
readonly description: Schema.String;
|
|
108
|
+
readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
109
|
+
}>;
|
|
110
|
+
}>>>;
|
|
111
|
+
tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
|
|
112
|
+
readonly type: Schema.tag<"function">;
|
|
113
|
+
readonly function: Schema.Struct<{
|
|
114
|
+
readonly name: Schema.String;
|
|
115
|
+
}>;
|
|
116
|
+
}>]>>;
|
|
117
|
+
stream: Schema.Literal<true>;
|
|
118
|
+
stream_options: Schema.optional<Schema.Struct<{
|
|
119
|
+
readonly include_usage: Schema.Boolean;
|
|
120
|
+
}>>;
|
|
121
|
+
store: Schema.optional<Schema.Boolean>;
|
|
122
|
+
reasoning_effort: Schema.optional<Schema.Literals<("none" | "minimal" | "low" | "medium" | "high" | "xhigh")[]>>;
|
|
123
|
+
max_tokens: Schema.optional<Schema.Number>;
|
|
124
|
+
temperature: Schema.optional<Schema.Number>;
|
|
125
|
+
top_p: Schema.optional<Schema.Number>;
|
|
126
|
+
frequency_penalty: Schema.optional<Schema.Number>;
|
|
127
|
+
presence_penalty: Schema.optional<Schema.Number>;
|
|
128
|
+
seed: Schema.optional<Schema.Number>;
|
|
129
|
+
stop: Schema.optional<Schema.$Array<Schema.String>>;
|
|
130
|
+
}>;
|
|
131
|
+
export type OpenAIChatBody = Schema.Schema.Type<typeof OpenAIChatBody>;
|
|
132
|
+
interface ParserState {
|
|
133
|
+
readonly tools: ToolStream.State<number>;
|
|
134
|
+
readonly toolCallEvents: ReadonlyArray<LLMEvent>;
|
|
135
|
+
readonly usage?: Usage;
|
|
136
|
+
readonly finishReason?: FinishReason;
|
|
137
|
+
/** Running assistant text used to normalise cumulative `delta.content` providers. */
|
|
138
|
+
readonly textAcc: string;
|
|
139
|
+
}
|
|
140
|
+
export declare const protocol: Protocol<{
|
|
141
|
+
readonly messages: readonly ({
|
|
142
|
+
readonly content: string;
|
|
143
|
+
readonly role: "system";
|
|
144
|
+
} | {
|
|
145
|
+
readonly content: string | readonly ({
|
|
146
|
+
readonly type: "text";
|
|
147
|
+
readonly text: string;
|
|
148
|
+
} | {
|
|
149
|
+
readonly type: "image_url";
|
|
150
|
+
readonly image_url: {
|
|
151
|
+
readonly url: string;
|
|
152
|
+
};
|
|
153
|
+
})[];
|
|
154
|
+
readonly role: "user";
|
|
155
|
+
} | {
|
|
156
|
+
readonly content: string | null;
|
|
157
|
+
readonly role: "assistant";
|
|
158
|
+
readonly tool_calls?: readonly {
|
|
159
|
+
readonly function: {
|
|
160
|
+
readonly name: string;
|
|
161
|
+
readonly arguments: string;
|
|
162
|
+
};
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly type: "function";
|
|
165
|
+
}[] | undefined;
|
|
166
|
+
readonly reasoning_content?: string | undefined;
|
|
167
|
+
} | {
|
|
168
|
+
readonly content: string;
|
|
169
|
+
readonly role: "tool";
|
|
170
|
+
readonly tool_call_id: string;
|
|
171
|
+
})[];
|
|
172
|
+
readonly model: string;
|
|
173
|
+
readonly stream: true;
|
|
174
|
+
readonly stop?: readonly string[] | undefined;
|
|
175
|
+
readonly temperature?: number | undefined;
|
|
176
|
+
readonly seed?: number | undefined;
|
|
177
|
+
readonly tools?: readonly {
|
|
178
|
+
readonly function: {
|
|
179
|
+
readonly name: string;
|
|
180
|
+
readonly description: string;
|
|
181
|
+
readonly parameters: {
|
|
182
|
+
readonly [x: string]: unknown;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
readonly type: "function";
|
|
186
|
+
}[] | undefined;
|
|
187
|
+
readonly store?: boolean | undefined;
|
|
188
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
189
|
+
readonly function: {
|
|
190
|
+
readonly name: string;
|
|
191
|
+
};
|
|
192
|
+
readonly type: "function";
|
|
193
|
+
} | undefined;
|
|
194
|
+
readonly stream_options?: {
|
|
195
|
+
readonly include_usage: boolean;
|
|
196
|
+
} | undefined;
|
|
197
|
+
readonly reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
198
|
+
readonly max_tokens?: number | undefined;
|
|
199
|
+
readonly top_p?: number | undefined;
|
|
200
|
+
readonly frequency_penalty?: number | undefined;
|
|
201
|
+
readonly presence_penalty?: number | undefined;
|
|
202
|
+
}, string, {
|
|
203
|
+
readonly choices: readonly {
|
|
204
|
+
readonly delta?: {
|
|
205
|
+
readonly content?: string | null | undefined;
|
|
206
|
+
readonly tool_calls?: readonly {
|
|
207
|
+
readonly index: number;
|
|
208
|
+
readonly function?: {
|
|
209
|
+
readonly name?: string | null | undefined;
|
|
210
|
+
readonly arguments?: string | null | undefined;
|
|
211
|
+
} | null | undefined;
|
|
212
|
+
readonly id?: string | null | undefined;
|
|
213
|
+
}[] | null | undefined;
|
|
214
|
+
} | null | undefined;
|
|
215
|
+
readonly finish_reason?: string | null | undefined;
|
|
216
|
+
}[];
|
|
217
|
+
readonly usage?: {
|
|
218
|
+
readonly prompt_tokens?: number | undefined;
|
|
219
|
+
readonly completion_tokens?: number | undefined;
|
|
220
|
+
readonly total_tokens?: number | undefined;
|
|
221
|
+
readonly prompt_tokens_details?: {
|
|
222
|
+
readonly cached_tokens?: number | undefined;
|
|
223
|
+
} | null | undefined;
|
|
224
|
+
readonly completion_tokens_details?: {
|
|
225
|
+
readonly reasoning_tokens?: number | undefined;
|
|
226
|
+
} | null | undefined;
|
|
227
|
+
} | null | undefined;
|
|
228
|
+
}, ParserState>;
|
|
229
|
+
export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
230
|
+
readonly messages: readonly ({
|
|
231
|
+
readonly content: string;
|
|
232
|
+
readonly role: "system";
|
|
233
|
+
} | {
|
|
234
|
+
readonly content: string | readonly ({
|
|
235
|
+
readonly type: "text";
|
|
236
|
+
readonly text: string;
|
|
237
|
+
} | {
|
|
238
|
+
readonly type: "image_url";
|
|
239
|
+
readonly image_url: {
|
|
240
|
+
readonly url: string;
|
|
241
|
+
};
|
|
242
|
+
})[];
|
|
243
|
+
readonly role: "user";
|
|
244
|
+
} | {
|
|
245
|
+
readonly content: string | null;
|
|
246
|
+
readonly role: "assistant";
|
|
247
|
+
readonly tool_calls?: readonly {
|
|
248
|
+
readonly function: {
|
|
249
|
+
readonly name: string;
|
|
250
|
+
readonly arguments: string;
|
|
251
|
+
};
|
|
252
|
+
readonly id: string;
|
|
253
|
+
readonly type: "function";
|
|
254
|
+
}[] | undefined;
|
|
255
|
+
readonly reasoning_content?: string | undefined;
|
|
256
|
+
} | {
|
|
257
|
+
readonly content: string;
|
|
258
|
+
readonly role: "tool";
|
|
259
|
+
readonly tool_call_id: string;
|
|
260
|
+
})[];
|
|
261
|
+
readonly model: string;
|
|
262
|
+
readonly stream: true;
|
|
263
|
+
readonly stop?: readonly string[] | undefined;
|
|
264
|
+
readonly temperature?: number | undefined;
|
|
265
|
+
readonly seed?: number | undefined;
|
|
266
|
+
readonly tools?: readonly {
|
|
267
|
+
readonly function: {
|
|
268
|
+
readonly name: string;
|
|
269
|
+
readonly description: string;
|
|
270
|
+
readonly parameters: {
|
|
271
|
+
readonly [x: string]: unknown;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
readonly type: "function";
|
|
275
|
+
}[] | undefined;
|
|
276
|
+
readonly store?: boolean | undefined;
|
|
277
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
278
|
+
readonly function: {
|
|
279
|
+
readonly name: string;
|
|
280
|
+
};
|
|
281
|
+
readonly type: "function";
|
|
282
|
+
} | undefined;
|
|
283
|
+
readonly stream_options?: {
|
|
284
|
+
readonly include_usage: boolean;
|
|
285
|
+
} | undefined;
|
|
286
|
+
readonly reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
287
|
+
readonly max_tokens?: number | undefined;
|
|
288
|
+
readonly top_p?: number | undefined;
|
|
289
|
+
readonly frequency_penalty?: number | undefined;
|
|
290
|
+
readonly presence_penalty?: number | undefined;
|
|
291
|
+
}, string>;
|
|
292
|
+
export declare const route: Route<{
|
|
293
|
+
readonly messages: readonly ({
|
|
294
|
+
readonly content: string;
|
|
295
|
+
readonly role: "system";
|
|
296
|
+
} | {
|
|
297
|
+
readonly content: string | readonly ({
|
|
298
|
+
readonly type: "text";
|
|
299
|
+
readonly text: string;
|
|
300
|
+
} | {
|
|
301
|
+
readonly type: "image_url";
|
|
302
|
+
readonly image_url: {
|
|
303
|
+
readonly url: string;
|
|
304
|
+
};
|
|
305
|
+
})[];
|
|
306
|
+
readonly role: "user";
|
|
307
|
+
} | {
|
|
308
|
+
readonly content: string | null;
|
|
309
|
+
readonly role: "assistant";
|
|
310
|
+
readonly tool_calls?: readonly {
|
|
311
|
+
readonly function: {
|
|
312
|
+
readonly name: string;
|
|
313
|
+
readonly arguments: string;
|
|
314
|
+
};
|
|
315
|
+
readonly id: string;
|
|
316
|
+
readonly type: "function";
|
|
317
|
+
}[] | undefined;
|
|
318
|
+
readonly reasoning_content?: string | undefined;
|
|
319
|
+
} | {
|
|
320
|
+
readonly content: string;
|
|
321
|
+
readonly role: "tool";
|
|
322
|
+
readonly tool_call_id: string;
|
|
323
|
+
})[];
|
|
324
|
+
readonly model: string;
|
|
325
|
+
readonly stream: true;
|
|
326
|
+
readonly stop?: readonly string[] | undefined;
|
|
327
|
+
readonly temperature?: number | undefined;
|
|
328
|
+
readonly seed?: number | undefined;
|
|
329
|
+
readonly tools?: readonly {
|
|
330
|
+
readonly function: {
|
|
331
|
+
readonly name: string;
|
|
332
|
+
readonly description: string;
|
|
333
|
+
readonly parameters: {
|
|
334
|
+
readonly [x: string]: unknown;
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
readonly type: "function";
|
|
338
|
+
}[] | undefined;
|
|
339
|
+
readonly store?: boolean | undefined;
|
|
340
|
+
readonly tool_choice?: "required" | "none" | "auto" | {
|
|
341
|
+
readonly function: {
|
|
342
|
+
readonly name: string;
|
|
343
|
+
};
|
|
344
|
+
readonly type: "function";
|
|
345
|
+
} | undefined;
|
|
346
|
+
readonly stream_options?: {
|
|
347
|
+
readonly include_usage: boolean;
|
|
348
|
+
} | undefined;
|
|
349
|
+
readonly reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
350
|
+
readonly max_tokens?: number | undefined;
|
|
351
|
+
readonly top_p?: number | undefined;
|
|
352
|
+
readonly frequency_penalty?: number | undefined;
|
|
353
|
+
readonly presence_penalty?: number | undefined;
|
|
354
|
+
}, HttpTransport.HttpPrepared<string>>;
|
|
355
|
+
export declare const model: <Input extends import("..").RouteModelInput = import("..").RouteModelInput>(input: Input) => import("..").ModelRef;
|
|
356
|
+
export * as OpenAIChat from "./openai-chat";
|
|
357
|
+
//# sourceMappingURL=openai-chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-chat.d.ts","sourceRoot":"","sources":["../../src/protocols/openai-chat.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,MAAM,EAAE,MAAM,QAAQ,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAIvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,YAAY,EAMlB,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGhD,eAAO,MAAM,gBAAgB,8BAA8B,CAAA;AAC3D,eAAO,MAAM,IAAI,sBAAsB,CAAA;AA8DvC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBtB,CAAA;AACD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAA;AAChD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAA;AAkDtE,UAAU,WAAW;IACnB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IACxC,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;IACtB,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAA;IACpC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAoQD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgBnB,CAAA;AAIF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAKxB,CAAA;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAQhB,CAAA;AAKF,eAAO,MAAM,KAAK,oHAAc,CAAA;AAEhC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAA"}
|