@arcote.tech/arc-ai-openai 0.7.8 → 0.7.10
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/package.json +2 -2
- package/src/index.ts +22 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcote.tech/arc-ai-openai",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.10",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "OpenAI adapter for Arc AI framework",
|
|
7
7
|
"main": "./src/index.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type-check": "tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@arcote.tech/arc-ai": "^0.7.
|
|
13
|
+
"@arcote.tech/arc-ai": "^0.7.10",
|
|
14
14
|
"typescript": "^5.0.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -132,6 +132,9 @@ export function openai(config: OpenAIConfig): LLMProvider {
|
|
|
132
132
|
...(previous_response_id ? { previous_response_id } : {}),
|
|
133
133
|
...(request.temperature != null ? { temperature: request.temperature } : {}),
|
|
134
134
|
...(request.maxTokens != null ? { max_output_tokens: request.maxTokens } : {}),
|
|
135
|
+
...(request.reasoningEffort != null
|
|
136
|
+
? { reasoning: { effort: request.reasoningEffort } }
|
|
137
|
+
: {}),
|
|
135
138
|
};
|
|
136
139
|
|
|
137
140
|
const tools = translateTools(request.tools);
|
|
@@ -284,13 +287,11 @@ export function openai(config: OpenAIConfig): LLMProvider {
|
|
|
284
287
|
orderedBlocks[idx] = block;
|
|
285
288
|
toolCallArgBuffers.set(item.call_id, "");
|
|
286
289
|
toolCallIndex.set(item.call_id, idx);
|
|
290
|
+
// Phase 1: tool call ujawniony — klient pokazuje "Przygotowuje: {name}…"
|
|
287
291
|
onChunk({
|
|
288
|
-
type: "
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
name: item.name,
|
|
292
|
-
arguments: {},
|
|
293
|
-
},
|
|
292
|
+
type: "tool_call_started",
|
|
293
|
+
toolCallId: item.call_id,
|
|
294
|
+
toolCallName: item.name,
|
|
294
295
|
});
|
|
295
296
|
}
|
|
296
297
|
break;
|
|
@@ -303,7 +304,7 @@ export function openai(config: OpenAIConfig): LLMProvider {
|
|
|
303
304
|
if (block?.type === "text") {
|
|
304
305
|
block.text += event.delta;
|
|
305
306
|
}
|
|
306
|
-
onChunk({ type: "
|
|
307
|
+
onChunk({ type: "text_delta", textDelta: event.delta });
|
|
307
308
|
break;
|
|
308
309
|
}
|
|
309
310
|
|
|
@@ -311,6 +312,12 @@ export function openai(config: OpenAIConfig): LLMProvider {
|
|
|
311
312
|
if (event.call_id && event.delta) {
|
|
312
313
|
const existing = toolCallArgBuffers.get(event.call_id) ?? "";
|
|
313
314
|
toolCallArgBuffers.set(event.call_id, existing + event.delta);
|
|
315
|
+
// Phase 2: streaming JSON args — opcjonalne dla UI (loader).
|
|
316
|
+
onChunk({
|
|
317
|
+
type: "tool_call_arguments_delta",
|
|
318
|
+
toolCallId: event.call_id,
|
|
319
|
+
argumentsDelta: event.delta,
|
|
320
|
+
});
|
|
314
321
|
}
|
|
315
322
|
break;
|
|
316
323
|
}
|
|
@@ -334,6 +341,12 @@ export function openai(config: OpenAIConfig): LLMProvider {
|
|
|
334
341
|
block.arguments = args;
|
|
335
342
|
}
|
|
336
343
|
}
|
|
344
|
+
// Phase 3: args complete — klient promotuje status do "executing".
|
|
345
|
+
onChunk({
|
|
346
|
+
type: "tool_call_arguments_complete",
|
|
347
|
+
toolCallId: item.call_id,
|
|
348
|
+
arguments: args,
|
|
349
|
+
});
|
|
337
350
|
}
|
|
338
351
|
break;
|
|
339
352
|
}
|
|
@@ -389,6 +402,8 @@ export function openai(config: OpenAIConfig): LLMProvider {
|
|
|
389
402
|
"gpt-4.1-nano": { inputPer1M: 0.1, outputPer1M: 0.4, cachedInputPer1M: 0.025 },
|
|
390
403
|
"gpt-5.4-nano": { inputPer1M: 0.1, outputPer1M: 0.4, cachedInputPer1M: 0.025 },
|
|
391
404
|
"gpt-5.4-mini": { inputPer1M: 0.4, outputPer1M: 1.6, cachedInputPer1M: 0.1 },
|
|
405
|
+
"gpt-5.4": { inputPer1M: 2.5, outputPer1M: 15.0, cachedInputPer1M: 0.25 },
|
|
406
|
+
"gpt-5": { inputPer1M: 1.25, outputPer1M: 10.0, cachedInputPer1M: 0.125 },
|
|
392
407
|
};
|
|
393
408
|
|
|
394
409
|
return {
|