@jambonz/llm 0.6.2 → 0.6.4

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.
@@ -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>): Message[];
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>): Message[];
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.2",
3
+ "version": "0.6.4",
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",