@jambonz/llm 0.6.1 → 0.6.3
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/index.cjs +163 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +163 -38
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +215 -40
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.d.cts +2 -2
- package/dist/test-kit/index.d.ts +2 -2
- package/dist/test-kit/index.js +215 -40
- package/dist/test-kit/index.js.map +1 -1
- package/dist/{types-Y0o6rN3B.d.cts → types-dbgrfviJ.d.cts} +7 -1
- package/dist/{types-Y0o6rN3B.d.ts → types-dbgrfviJ.d.ts} +7 -1
- package/package.json +1 -1
|
@@ -355,8 +355,14 @@ interface LlmAdapter<A extends AuthSpec = AuthSpec> {
|
|
|
355
355
|
* content:[{type:'tool_use',...}]}`; Google: `{role:'model',
|
|
356
356
|
* parts:[{functionCall,...}]}`; etc.). The returned `Message` carries the
|
|
357
357
|
* wire shape in `vendorRaw` and is round-trippable through `stream()`.
|
|
358
|
+
*
|
|
359
|
+
* `assistantText` is any text the model emitted BEFORE the tool calls in the
|
|
360
|
+
* same turn. Vendors allow it alongside the call (OpenAI: `content`;
|
|
361
|
+
* Anthropic and Google: a text block/part preceding the call), and dropping
|
|
362
|
+
* it makes the model believe it never spoke — on the post-tool turn it
|
|
363
|
+
* repeats itself. Adapters MUST carry it onto the wire when non-empty.
|
|
358
364
|
*/
|
|
359
|
-
appendAssistantToolCall(history: Message[], toolCalls: ReadonlyArray<ToolCallEvent
|
|
365
|
+
appendAssistantToolCall(history: Message[], toolCalls: ReadonlyArray<ToolCallEvent>, assistantText?: string): Message[];
|
|
360
366
|
/**
|
|
361
367
|
* Append a tool-result message to history in the vendor's native shape.
|
|
362
368
|
* The returned array MUST be a valid `messages` input for a subsequent `stream()` call
|
|
@@ -355,8 +355,14 @@ interface LlmAdapter<A extends AuthSpec = AuthSpec> {
|
|
|
355
355
|
* content:[{type:'tool_use',...}]}`; Google: `{role:'model',
|
|
356
356
|
* parts:[{functionCall,...}]}`; etc.). The returned `Message` carries the
|
|
357
357
|
* wire shape in `vendorRaw` and is round-trippable through `stream()`.
|
|
358
|
+
*
|
|
359
|
+
* `assistantText` is any text the model emitted BEFORE the tool calls in the
|
|
360
|
+
* same turn. Vendors allow it alongside the call (OpenAI: `content`;
|
|
361
|
+
* Anthropic and Google: a text block/part preceding the call), and dropping
|
|
362
|
+
* it makes the model believe it never spoke — on the post-tool turn it
|
|
363
|
+
* repeats itself. Adapters MUST carry it onto the wire when non-empty.
|
|
358
364
|
*/
|
|
359
|
-
appendAssistantToolCall(history: Message[], toolCalls: ReadonlyArray<ToolCallEvent
|
|
365
|
+
appendAssistantToolCall(history: Message[], toolCalls: ReadonlyArray<ToolCallEvent>, assistantText?: string): Message[];
|
|
360
366
|
/**
|
|
361
367
|
* Append a tool-result message to history in the vendor's native shape.
|
|
362
368
|
* The returned array MUST be a valid `messages` input for a subsequent `stream()` call
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jambonz/llm",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Voice-oriented LLM adapter library — a uniform interface for streaming chat completions from multiple LLM vendors, with first-class support for tool calls, AbortSignal interruption, and lossless history round-tripping.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|