@cogitator-ai/openai-compat 21.1.13 → 21.2.1
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 +183 -46
- package/dist/client/openai-adapter.d.ts +35 -7
- package/dist/client/openai-adapter.d.ts.map +1 -1
- package/dist/client/openai-adapter.js +139 -57
- package/dist/client/openai-adapter.js.map +1 -1
- package/dist/client/thread-manager.d.ts +4 -3
- package/dist/client/thread-manager.d.ts.map +1 -1
- package/dist/client/thread-manager.js +7 -5
- package/dist/client/thread-manager.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/server/agents/agent-turn.d.ts +134 -0
- package/dist/server/agents/agent-turn.d.ts.map +1 -0
- package/dist/server/agents/agent-turn.js +340 -0
- package/dist/server/agents/agent-turn.js.map +1 -0
- package/dist/server/agents/shared.d.ts +62 -0
- package/dist/server/agents/shared.d.ts.map +1 -0
- package/dist/server/agents/shared.js +136 -0
- package/dist/server/agents/shared.js.map +1 -0
- package/dist/server/api-server.d.ts +50 -10
- package/dist/server/api-server.d.ts.map +1 -1
- package/dist/server/api-server.js +61 -24
- package/dist/server/api-server.js.map +1 -1
- package/dist/server/routes/chat-completions.d.ts +15 -0
- package/dist/server/routes/chat-completions.d.ts.map +1 -0
- package/dist/server/routes/chat-completions.js +305 -0
- package/dist/server/routes/chat-completions.js.map +1 -0
- package/dist/server/routes/models.d.ts +8 -0
- package/dist/server/routes/models.d.ts.map +1 -0
- package/dist/server/routes/models.js +27 -0
- package/dist/server/routes/models.js.map +1 -0
- package/dist/server/routes/responses.d.ts +229 -0
- package/dist/server/routes/responses.d.ts.map +1 -0
- package/dist/server/routes/responses.js +484 -0
- package/dist/server/routes/responses.js.map +1 -0
- package/dist/server/routes/runs.d.ts +5 -1
- package/dist/server/routes/runs.d.ts.map +1 -1
- package/dist/server/routes/runs.js +16 -6
- package/dist/server/routes/runs.js.map +1 -1
- package/dist/types/openai-types.d.ts +3 -1
- package/dist/types/openai-types.d.ts.map +1 -1
- package/package.json +11 -7
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat Completions API (`POST /v1/chat/completions`) over registered Cogitator agents: the
|
|
3
|
+
* request's `model` names the agent.
|
|
4
|
+
*/
|
|
5
|
+
import { nanoid } from 'nanoid';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { InvalidRequestError } from '../../client/errors.js';
|
|
8
|
+
import { toAgentResponseFormat } from '../../client/openai-adapter.js';
|
|
9
|
+
import { assertToolChoice, } from '../agents/agent-turn.js';
|
|
10
|
+
import { abortOnDisconnect, chatUsage, clientErrorMessage, openEventStream, parseRequestBody, sendModelNotFound, sendTurnError, toImageInput, } from '../agents/shared.js';
|
|
11
|
+
const textPart = z.looseObject({ type: z.literal('text'), text: z.string() });
|
|
12
|
+
const imagePart = z.looseObject({
|
|
13
|
+
type: z.literal('image_url'),
|
|
14
|
+
image_url: z.looseObject({ url: z.string().min(1) }),
|
|
15
|
+
});
|
|
16
|
+
const refusalPart = z.looseObject({ type: z.literal('refusal'), refusal: z.string() });
|
|
17
|
+
const textContent = z.union([z.string(), z.array(textPart)]);
|
|
18
|
+
const toolCallSchema = z.looseObject({
|
|
19
|
+
id: z.string().min(1),
|
|
20
|
+
type: z.literal('function'),
|
|
21
|
+
function: z.looseObject({ name: z.string().min(1), arguments: z.string() }),
|
|
22
|
+
});
|
|
23
|
+
const messageSchema = z.discriminatedUnion('role', [
|
|
24
|
+
z.looseObject({ role: z.literal('system'), content: textContent }),
|
|
25
|
+
z.looseObject({ role: z.literal('developer'), content: textContent }),
|
|
26
|
+
z.looseObject({
|
|
27
|
+
role: z.literal('user'),
|
|
28
|
+
content: z.union([z.string(), z.array(z.discriminatedUnion('type', [textPart, imagePart]))]),
|
|
29
|
+
}),
|
|
30
|
+
z.looseObject({
|
|
31
|
+
role: z.literal('assistant'),
|
|
32
|
+
content: z
|
|
33
|
+
.union([z.string(), z.array(z.discriminatedUnion('type', [textPart, refusalPart]))])
|
|
34
|
+
.nullish(),
|
|
35
|
+
tool_calls: z.array(toolCallSchema).optional(),
|
|
36
|
+
}),
|
|
37
|
+
z.looseObject({ role: z.literal('tool'), content: textContent, tool_call_id: z.string().min(1) }),
|
|
38
|
+
]);
|
|
39
|
+
const functionSchema = z.looseObject({
|
|
40
|
+
name: z.string().regex(/^[a-zA-Z0-9_-]{1,64}$/, 'must match ^[a-zA-Z0-9_-]{1,64}$'),
|
|
41
|
+
description: z.string().optional(),
|
|
42
|
+
parameters: z.record(z.string(), z.unknown()).optional(),
|
|
43
|
+
strict: z.boolean().nullish(),
|
|
44
|
+
});
|
|
45
|
+
const responseFormatSchema = z.discriminatedUnion('type', [
|
|
46
|
+
z.looseObject({ type: z.literal('text') }),
|
|
47
|
+
z.looseObject({ type: z.literal('json_object') }),
|
|
48
|
+
z.looseObject({
|
|
49
|
+
type: z.literal('json_schema'),
|
|
50
|
+
json_schema: z.looseObject({
|
|
51
|
+
name: z.string().min(1),
|
|
52
|
+
description: z.string().optional(),
|
|
53
|
+
schema: z.record(z.string(), z.unknown()).optional(),
|
|
54
|
+
strict: z.boolean().nullish(),
|
|
55
|
+
}),
|
|
56
|
+
}),
|
|
57
|
+
]);
|
|
58
|
+
const positiveInt = z.number().int().positive();
|
|
59
|
+
const requestSchema = z.looseObject({
|
|
60
|
+
model: z.string().min(1),
|
|
61
|
+
messages: z.array(messageSchema).min(1),
|
|
62
|
+
stream: z.boolean().nullish(),
|
|
63
|
+
stream_options: z.looseObject({ include_usage: z.boolean().optional() }).nullish(),
|
|
64
|
+
tools: z
|
|
65
|
+
.array(z.looseObject({ type: z.literal('function'), function: functionSchema }))
|
|
66
|
+
.optional(),
|
|
67
|
+
tool_choice: z
|
|
68
|
+
.union([
|
|
69
|
+
z.enum(['none', 'auto', 'required']),
|
|
70
|
+
z.looseObject({
|
|
71
|
+
type: z.literal('function'),
|
|
72
|
+
function: z.looseObject({ name: z.string().min(1) }),
|
|
73
|
+
}),
|
|
74
|
+
])
|
|
75
|
+
.optional(),
|
|
76
|
+
parallel_tool_calls: z.boolean().optional(),
|
|
77
|
+
temperature: z.number().min(0).max(2).nullish(),
|
|
78
|
+
top_p: z.number().min(0).max(1).nullish(),
|
|
79
|
+
max_tokens: positiveInt.nullish(),
|
|
80
|
+
max_completion_tokens: positiveInt.nullish(),
|
|
81
|
+
stop: z.union([z.string(), z.array(z.string()).max(4)]).nullish(),
|
|
82
|
+
response_format: responseFormatSchema.optional(),
|
|
83
|
+
n: z.literal(1, { error: 'only n: 1 is supported' }).nullish(),
|
|
84
|
+
});
|
|
85
|
+
function joinText(content) {
|
|
86
|
+
if (typeof content === 'string')
|
|
87
|
+
return content;
|
|
88
|
+
return content.map((part) => part.text ?? part.refusal ?? '').join('');
|
|
89
|
+
}
|
|
90
|
+
function toConversationItems(messages) {
|
|
91
|
+
const items = [];
|
|
92
|
+
for (const message of messages) {
|
|
93
|
+
switch (message.role) {
|
|
94
|
+
case 'system':
|
|
95
|
+
case 'developer':
|
|
96
|
+
items.push({ kind: 'system', text: joinText(message.content) });
|
|
97
|
+
break;
|
|
98
|
+
case 'user': {
|
|
99
|
+
if (typeof message.content === 'string') {
|
|
100
|
+
items.push({ kind: 'user', text: message.content, images: [] });
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
const text = message.content
|
|
104
|
+
.flatMap((part) => (part.type === 'text' ? [part.text] : []))
|
|
105
|
+
.join('\n');
|
|
106
|
+
const images = message.content.flatMap((part) => part.type === 'image_url' ? [toImageInput(part.image_url.url)] : []);
|
|
107
|
+
items.push({ kind: 'user', text, images });
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
case 'assistant': {
|
|
111
|
+
const text = message.content ? joinText(message.content) : '';
|
|
112
|
+
if (text)
|
|
113
|
+
items.push({ kind: 'assistant', text });
|
|
114
|
+
for (const call of message.tool_calls ?? []) {
|
|
115
|
+
items.push({
|
|
116
|
+
kind: 'function_call',
|
|
117
|
+
callId: call.id,
|
|
118
|
+
name: call.function.name,
|
|
119
|
+
arguments: call.function.arguments,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
case 'tool':
|
|
125
|
+
items.push({
|
|
126
|
+
kind: 'function_call_output',
|
|
127
|
+
callId: message.tool_call_id,
|
|
128
|
+
output: joinText(message.content),
|
|
129
|
+
});
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (!items.some((item) => item.kind !== 'system')) {
|
|
134
|
+
throw new InvalidRequestError('messages must contain a user message', 'messages');
|
|
135
|
+
}
|
|
136
|
+
return items;
|
|
137
|
+
}
|
|
138
|
+
function toToolChoice(choice) {
|
|
139
|
+
if (choice === undefined)
|
|
140
|
+
return 'auto';
|
|
141
|
+
if (typeof choice === 'string')
|
|
142
|
+
return choice;
|
|
143
|
+
return { name: choice.function.name };
|
|
144
|
+
}
|
|
145
|
+
function toResponseFormat(format) {
|
|
146
|
+
if (!format)
|
|
147
|
+
return undefined;
|
|
148
|
+
if (format.type === 'json_schema') {
|
|
149
|
+
const value = {
|
|
150
|
+
type: 'json_schema',
|
|
151
|
+
json_schema: {
|
|
152
|
+
name: format.json_schema.name,
|
|
153
|
+
schema: format.json_schema.schema ?? {},
|
|
154
|
+
...(format.json_schema.description !== undefined && {
|
|
155
|
+
description: format.json_schema.description,
|
|
156
|
+
}),
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
return toAgentResponseFormat(value);
|
|
160
|
+
}
|
|
161
|
+
return toAgentResponseFormat({ type: format.type });
|
|
162
|
+
}
|
|
163
|
+
function toolCallsOf(result) {
|
|
164
|
+
return result.functionCalls.map((call) => ({
|
|
165
|
+
id: call.callId,
|
|
166
|
+
type: 'function',
|
|
167
|
+
function: { name: call.name, arguments: call.arguments },
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
export function registerChatCompletionRoutes(fastify, options) {
|
|
171
|
+
const { directory, runner, heartbeatMs, bodyLimit } = options;
|
|
172
|
+
fastify.post('/v1/chat/completions', { bodyLimit }, async (request, reply) => {
|
|
173
|
+
let body;
|
|
174
|
+
let items;
|
|
175
|
+
try {
|
|
176
|
+
body = parseRequestBody(requestSchema, request.body);
|
|
177
|
+
items = toConversationItems(body.messages);
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
return sendTurnError(reply, error, 'chat completion');
|
|
181
|
+
}
|
|
182
|
+
const agent = directory.get(body.model);
|
|
183
|
+
if (!agent)
|
|
184
|
+
return sendModelNotFound(reply, body.model);
|
|
185
|
+
const id = `chatcmpl-${nanoid()}`;
|
|
186
|
+
const created = Math.floor(Date.now() / 1000);
|
|
187
|
+
const turn = (signal, onToken) => ({
|
|
188
|
+
agent,
|
|
189
|
+
items,
|
|
190
|
+
functions: (body.tools ?? []).map((tool) => ({
|
|
191
|
+
name: tool.function.name,
|
|
192
|
+
...(tool.function.description !== undefined && {
|
|
193
|
+
description: tool.function.description,
|
|
194
|
+
}),
|
|
195
|
+
...(tool.function.parameters !== undefined && { parameters: tool.function.parameters }),
|
|
196
|
+
})),
|
|
197
|
+
toolChoice: toToolChoice(body.tool_choice),
|
|
198
|
+
...(body.parallel_tool_calls !== undefined && {
|
|
199
|
+
parallelToolCalls: body.parallel_tool_calls,
|
|
200
|
+
}),
|
|
201
|
+
...(body.temperature != null && { temperature: body.temperature }),
|
|
202
|
+
...(body.top_p != null && { topP: body.top_p }),
|
|
203
|
+
...((body.max_completion_tokens ?? body.max_tokens) != null && {
|
|
204
|
+
maxTokens: (body.max_completion_tokens ?? body.max_tokens),
|
|
205
|
+
}),
|
|
206
|
+
...(body.stop != null && { stop: typeof body.stop === 'string' ? [body.stop] : body.stop }),
|
|
207
|
+
...(body.response_format && { responseFormat: toResponseFormat(body.response_format) }),
|
|
208
|
+
signal,
|
|
209
|
+
...(onToken && { onToken }),
|
|
210
|
+
});
|
|
211
|
+
try {
|
|
212
|
+
const check = turn(new AbortController().signal);
|
|
213
|
+
assertToolChoice(check.agent, check.functions, check.toolChoice);
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
return sendTurnError(reply, error, 'request');
|
|
217
|
+
}
|
|
218
|
+
if (!body.stream) {
|
|
219
|
+
const signal = abortOnDisconnect(reply);
|
|
220
|
+
let result;
|
|
221
|
+
try {
|
|
222
|
+
result = await runner.run(turn(signal));
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
return sendTurnError(reply, error, `Chat completion ${id}`);
|
|
226
|
+
}
|
|
227
|
+
const toolCalls = toolCallsOf(result);
|
|
228
|
+
return reply.send({
|
|
229
|
+
id,
|
|
230
|
+
object: 'chat.completion',
|
|
231
|
+
created,
|
|
232
|
+
model: body.model,
|
|
233
|
+
system_fingerprint: null,
|
|
234
|
+
choices: [
|
|
235
|
+
{
|
|
236
|
+
index: 0,
|
|
237
|
+
message: {
|
|
238
|
+
role: 'assistant',
|
|
239
|
+
content: result.refusal ? null : result.text || (toolCalls.length > 0 ? null : ''),
|
|
240
|
+
refusal: result.refusal ? result.text : null,
|
|
241
|
+
...(toolCalls.length > 0 && { tool_calls: toolCalls }),
|
|
242
|
+
annotations: [],
|
|
243
|
+
},
|
|
244
|
+
logprobs: null,
|
|
245
|
+
finish_reason: result.finishReason,
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
usage: chatUsage(result.usage),
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
const includeUsage = body.stream_options?.include_usage === true;
|
|
252
|
+
const stream = openEventStream(reply, heartbeatMs);
|
|
253
|
+
const chunk = (delta, finishReason = null) => ({
|
|
254
|
+
id,
|
|
255
|
+
object: 'chat.completion.chunk',
|
|
256
|
+
created,
|
|
257
|
+
model: body.model,
|
|
258
|
+
system_fingerprint: null,
|
|
259
|
+
choices: [{ index: 0, delta, logprobs: null, finish_reason: finishReason }],
|
|
260
|
+
...(includeUsage && { usage: null }),
|
|
261
|
+
});
|
|
262
|
+
const send = (data) => stream.write(`data: ${JSON.stringify(data)}\n\n`);
|
|
263
|
+
send(chunk({ role: 'assistant', content: '', refusal: null }));
|
|
264
|
+
try {
|
|
265
|
+
const result = await runner.run(turn(stream.signal, (token) => send(chunk({ content: token }))));
|
|
266
|
+
if (result.refusal)
|
|
267
|
+
send(chunk({ refusal: result.text }));
|
|
268
|
+
const toolCalls = toolCallsOf(result);
|
|
269
|
+
if (toolCalls.length > 0) {
|
|
270
|
+
send(chunk({ tool_calls: toolCalls.map((call, index) => ({ index, ...call })) }));
|
|
271
|
+
}
|
|
272
|
+
send(chunk({}, result.finishReason));
|
|
273
|
+
if (includeUsage) {
|
|
274
|
+
send({
|
|
275
|
+
id,
|
|
276
|
+
object: 'chat.completion.chunk',
|
|
277
|
+
created,
|
|
278
|
+
model: body.model,
|
|
279
|
+
system_fingerprint: null,
|
|
280
|
+
choices: [],
|
|
281
|
+
usage: chatUsage(result.usage),
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
stream.write('data: [DONE]\n\n');
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
if (!stream.signal.aborted) {
|
|
288
|
+
const invalid = error instanceof InvalidRequestError;
|
|
289
|
+
send({
|
|
290
|
+
error: {
|
|
291
|
+
message: clientErrorMessage(error, `Chat completion ${id}`),
|
|
292
|
+
type: invalid ? 'invalid_request_error' : 'server_error',
|
|
293
|
+
param: invalid ? (error.param ?? null) : null,
|
|
294
|
+
code: invalid ? 'invalid_request' : 'server_error',
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
finally {
|
|
300
|
+
stream.end();
|
|
301
|
+
}
|
|
302
|
+
return reply;
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=chat-completions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completions.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;YACD,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;YACrC,IAAI,YAAY,EAAE,CAAC;gBACjB,IAAI,CAAC;oBACH,EAAE;oBACF,MAAM,EAAE,uBAAuB;oBAC/B,OAAO;oBACP,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,kBAAkB,EAAE,IAAI;oBACxB,OAAO,EAAE,EAAE;oBACX,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;iBAC/B,CAAC,CAAC;YACL,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBAC3B,MAAM,OAAO,GAAG,KAAK,YAAY,mBAAmB,CAAC;gBACrD,IAAI,CAAC;oBACH,KAAK,EAAE;wBACL,OAAO,EAAE,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,CAAC;wBAC3D,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,cAAc;wBACxD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;wBAC7C,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,cAAc;qBACnD;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Models API: the registered agents, which the Chat Completions and Responses endpoints take as
|
|
3
|
+
* `model`, and the `cogitator` model of the Assistants API.
|
|
4
|
+
*/
|
|
5
|
+
import type { FastifyInstance } from 'fastify';
|
|
6
|
+
import type { AgentDirectory } from '../agents/shared.js';
|
|
7
|
+
export declare function registerModelRoutes(fastify: FastifyInstance, directory: AgentDirectory): void;
|
|
8
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/server/routes/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUvD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,QAmBtF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Models API: the registered agents, which the Chat Completions and Responses endpoints take as
|
|
3
|
+
* `model`, and the `cogitator` model of the Assistants API.
|
|
4
|
+
*/
|
|
5
|
+
import { COGITATOR_MODEL_ID } from '../../client/openai-adapter.js';
|
|
6
|
+
import { sendNotFound } from './shared.js';
|
|
7
|
+
export function registerModelRoutes(fastify, directory) {
|
|
8
|
+
const models = () => {
|
|
9
|
+
const ids = [...directory.names()];
|
|
10
|
+
if (!ids.includes(COGITATOR_MODEL_ID))
|
|
11
|
+
ids.push(COGITATOR_MODEL_ID);
|
|
12
|
+
return ids.map((id) => ({
|
|
13
|
+
id,
|
|
14
|
+
object: 'model',
|
|
15
|
+
created: directory.createdAt,
|
|
16
|
+
owned_by: 'cogitator',
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
fastify.get('/v1/models', async () => ({ object: 'list', data: models() }));
|
|
20
|
+
fastify.get('/v1/models/:model', async (request, reply) => {
|
|
21
|
+
const model = models().find((candidate) => candidate.id === request.params.model);
|
|
22
|
+
if (!model)
|
|
23
|
+
return sendNotFound(reply, 'model', request.params.model);
|
|
24
|
+
return reply.send(model);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/server/routes/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AASxC,MAAM,UAAU,mBAAmB,CAAC,OAAwB,EAAE,SAAyB;IACrF,MAAM,MAAM,GAAG,GAAkB,EAAE;QACjC,MAAM,GAAG,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACpE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACtB,EAAE;YACF,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,SAAS,CAAC,SAAS;YAC5B,QAAQ,EAAE,WAAW;SACtB,CAAC,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAE5E,OAAO,CAAC,GAAG,CAAgC,mBAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QACvF,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClF,IAAI,CAAC,KAAK;YAAE,OAAO,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Responses API (`/v1/responses`) over registered Cogitator agents: the request's `model` names
|
|
3
|
+
* the agent. Responses are kept in memory, so `previous_response_id` carries a conversation on.
|
|
4
|
+
*/
|
|
5
|
+
import type { FastifyInstance } from 'fastify';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { type AgentTurnRunner, type ConversationItem } from '../agents/agent-turn.js';
|
|
8
|
+
import { type AgentDirectory, responseUsage } from '../agents/shared.js';
|
|
9
|
+
declare const inputItem: z.ZodUnion<readonly [z.ZodObject<{
|
|
10
|
+
type: z.ZodLiteral<"function_call">;
|
|
11
|
+
id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
call_id: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
arguments: z.ZodString;
|
|
15
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"function_call_output">;
|
|
17
|
+
id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
call_id: z.ZodString;
|
|
19
|
+
output: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"input_text">;
|
|
21
|
+
text: z.ZodString;
|
|
22
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"output_text">;
|
|
24
|
+
text: z.ZodString;
|
|
25
|
+
}, z.core.$loose>], "type">>]>;
|
|
26
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
27
|
+
type: z.ZodOptional<z.ZodLiteral<"message">>;
|
|
28
|
+
id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
role: z.ZodEnum<{
|
|
30
|
+
assistant: "assistant";
|
|
31
|
+
user: "user";
|
|
32
|
+
system: "system";
|
|
33
|
+
developer: "developer";
|
|
34
|
+
}>;
|
|
35
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
36
|
+
type: z.ZodLiteral<"input_text">;
|
|
37
|
+
text: z.ZodString;
|
|
38
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"input_image">;
|
|
40
|
+
image_url: z.ZodString;
|
|
41
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
auto: "auto";
|
|
43
|
+
low: "low";
|
|
44
|
+
high: "high";
|
|
45
|
+
}>>;
|
|
46
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"output_text">;
|
|
48
|
+
text: z.ZodString;
|
|
49
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"refusal">;
|
|
51
|
+
refusal: z.ZodString;
|
|
52
|
+
}, z.core.$loose>], "type">>]>;
|
|
53
|
+
}, z.core.$loose>]>;
|
|
54
|
+
declare const requestSchema: z.ZodObject<{
|
|
55
|
+
model: z.ZodString;
|
|
56
|
+
input: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
57
|
+
type: z.ZodLiteral<"function_call">;
|
|
58
|
+
id: z.ZodOptional<z.ZodString>;
|
|
59
|
+
call_id: z.ZodString;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
arguments: z.ZodString;
|
|
62
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"function_call_output">;
|
|
64
|
+
id: z.ZodOptional<z.ZodString>;
|
|
65
|
+
call_id: z.ZodString;
|
|
66
|
+
output: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"input_text">;
|
|
68
|
+
text: z.ZodString;
|
|
69
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"output_text">;
|
|
71
|
+
text: z.ZodString;
|
|
72
|
+
}, z.core.$loose>], "type">>]>;
|
|
73
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
74
|
+
type: z.ZodOptional<z.ZodLiteral<"message">>;
|
|
75
|
+
id: z.ZodOptional<z.ZodString>;
|
|
76
|
+
role: z.ZodEnum<{
|
|
77
|
+
assistant: "assistant";
|
|
78
|
+
user: "user";
|
|
79
|
+
system: "system";
|
|
80
|
+
developer: "developer";
|
|
81
|
+
}>;
|
|
82
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"input_text">;
|
|
84
|
+
text: z.ZodString;
|
|
85
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
86
|
+
type: z.ZodLiteral<"input_image">;
|
|
87
|
+
image_url: z.ZodString;
|
|
88
|
+
detail: z.ZodOptional<z.ZodEnum<{
|
|
89
|
+
auto: "auto";
|
|
90
|
+
low: "low";
|
|
91
|
+
high: "high";
|
|
92
|
+
}>>;
|
|
93
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
94
|
+
type: z.ZodLiteral<"output_text">;
|
|
95
|
+
text: z.ZodString;
|
|
96
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
97
|
+
type: z.ZodLiteral<"refusal">;
|
|
98
|
+
refusal: z.ZodString;
|
|
99
|
+
}, z.core.$loose>], "type">>]>;
|
|
100
|
+
}, z.core.$loose>]>>]>;
|
|
101
|
+
instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
|
+
previous_response_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
type: z.ZodLiteral<"function">;
|
|
105
|
+
name: z.ZodString;
|
|
106
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
+
parameters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
108
|
+
strict: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
109
|
+
}, z.core.$loose>>>;
|
|
110
|
+
tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
111
|
+
auto: "auto";
|
|
112
|
+
none: "none";
|
|
113
|
+
required: "required";
|
|
114
|
+
}>, z.ZodObject<{
|
|
115
|
+
type: z.ZodLiteral<"function">;
|
|
116
|
+
name: z.ZodString;
|
|
117
|
+
}, z.core.$loose>]>>;
|
|
118
|
+
parallel_tool_calls: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
119
|
+
temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
120
|
+
top_p: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
121
|
+
max_output_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
122
|
+
store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
123
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
124
|
+
stream: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
125
|
+
text: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
126
|
+
format: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
127
|
+
type: z.ZodLiteral<"text">;
|
|
128
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
129
|
+
type: z.ZodLiteral<"json_object">;
|
|
130
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"json_schema">;
|
|
132
|
+
name: z.ZodString;
|
|
133
|
+
description: z.ZodOptional<z.ZodString>;
|
|
134
|
+
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
135
|
+
strict: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
136
|
+
}, z.core.$loose>], "type">>;
|
|
137
|
+
}, z.core.$loose>>>;
|
|
138
|
+
background: z.ZodOptional<z.ZodNullable<z.ZodLiteral<false>>>;
|
|
139
|
+
}, z.core.$loose>;
|
|
140
|
+
type ResponsesRequest = z.output<typeof requestSchema>;
|
|
141
|
+
type InputItem = z.output<typeof inputItem>;
|
|
142
|
+
type OutputContent = {
|
|
143
|
+
type: 'output_text';
|
|
144
|
+
text: string;
|
|
145
|
+
annotations: never[];
|
|
146
|
+
} | {
|
|
147
|
+
type: 'refusal';
|
|
148
|
+
refusal: string;
|
|
149
|
+
};
|
|
150
|
+
type OutputItem = {
|
|
151
|
+
type: 'message';
|
|
152
|
+
id: string;
|
|
153
|
+
status: 'in_progress' | 'completed' | 'incomplete';
|
|
154
|
+
role: 'assistant';
|
|
155
|
+
content: OutputContent[];
|
|
156
|
+
} | {
|
|
157
|
+
type: 'function_call';
|
|
158
|
+
id: string;
|
|
159
|
+
call_id: string;
|
|
160
|
+
name: string;
|
|
161
|
+
arguments: string;
|
|
162
|
+
status: 'in_progress' | 'completed';
|
|
163
|
+
};
|
|
164
|
+
type ResponseStatus = 'in_progress' | 'completed' | 'incomplete' | 'failed';
|
|
165
|
+
interface ResponseObject {
|
|
166
|
+
id: string;
|
|
167
|
+
object: 'response';
|
|
168
|
+
created_at: number;
|
|
169
|
+
status: ResponseStatus;
|
|
170
|
+
completed_at: number | null;
|
|
171
|
+
error: {
|
|
172
|
+
code: string;
|
|
173
|
+
message: string;
|
|
174
|
+
} | null;
|
|
175
|
+
incomplete_details: {
|
|
176
|
+
reason: 'max_output_tokens' | 'content_filter';
|
|
177
|
+
} | null;
|
|
178
|
+
instructions: string | null;
|
|
179
|
+
max_output_tokens: number | null;
|
|
180
|
+
model: string;
|
|
181
|
+
output: OutputItem[];
|
|
182
|
+
parallel_tool_calls: boolean;
|
|
183
|
+
previous_response_id: string | null;
|
|
184
|
+
reasoning: {
|
|
185
|
+
effort: null;
|
|
186
|
+
summary: null;
|
|
187
|
+
};
|
|
188
|
+
store: boolean;
|
|
189
|
+
temperature: number | null;
|
|
190
|
+
text: {
|
|
191
|
+
format: Record<string, unknown>;
|
|
192
|
+
};
|
|
193
|
+
tool_choice: ResponsesRequest['tool_choice'] | 'auto';
|
|
194
|
+
tools: NonNullable<ResponsesRequest['tools']>;
|
|
195
|
+
top_p: number | null;
|
|
196
|
+
truncation: 'disabled';
|
|
197
|
+
usage: ReturnType<typeof responseUsage> | null;
|
|
198
|
+
user: null;
|
|
199
|
+
metadata: Record<string, string>;
|
|
200
|
+
}
|
|
201
|
+
/** An input item as `GET /v1/responses/{id}/input_items` lists it. */
|
|
202
|
+
type StoredInputItem = InputItem & {
|
|
203
|
+
id: string;
|
|
204
|
+
};
|
|
205
|
+
interface StoredResponse {
|
|
206
|
+
response: ResponseObject;
|
|
207
|
+
/** The conversation up to and including this response, for `previous_response_id` */
|
|
208
|
+
conversation: ConversationItem[];
|
|
209
|
+
inputItems: StoredInputItem[];
|
|
210
|
+
}
|
|
211
|
+
/** Responses kept in memory, the oldest dropped first beyond `maxSize`. */
|
|
212
|
+
export declare class ResponseStore {
|
|
213
|
+
private readonly maxSize;
|
|
214
|
+
private responses;
|
|
215
|
+
constructor(maxSize?: number);
|
|
216
|
+
get(id: string): StoredResponse | undefined;
|
|
217
|
+
set(id: string, stored: StoredResponse): void;
|
|
218
|
+
delete(id: string): boolean;
|
|
219
|
+
}
|
|
220
|
+
export interface ResponseRouteOptions {
|
|
221
|
+
directory: AgentDirectory;
|
|
222
|
+
runner: AgentTurnRunner;
|
|
223
|
+
store: ResponseStore;
|
|
224
|
+
heartbeatMs: number;
|
|
225
|
+
bodyLimit: number;
|
|
226
|
+
}
|
|
227
|
+
export declare function registerResponseRoutes(fastify: FastifyInstance, options: ResponseRouteOptions): void;
|
|
228
|
+
export {};
|
|
229
|
+
//# sourceMappingURL=responses.d.ts.map
|
|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