@jambonz/llm 0.6.9 → 0.6.11

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.
@@ -74,12 +74,16 @@ interface PromptRequest {
74
74
  maxTokens?: number;
75
75
  /**
76
76
  * Provider-specific request-body parameters merged verbatim into the
77
- * outgoing request by OpenAI-compatible adapters. Opt-in escape hatch for
78
- * fields the typed interface does not model — e.g. a vLLM/Mantle-served
79
- * Kimi endpoint's `{chat_template_kwargs: {enable_thinking: false}}` to
80
- * suppress chain-of-thought. Never sent unless set. Keys that collide with
81
- * library-managed fields (model, messages, stream, tools, …) are ignored,
82
- * so this can only add parameters, never override core request shape.
77
+ * outgoing request by OpenAI-compatible adapters and the Anthropic adapter
78
+ * (the Gemini adapters merge them into the generation config). Opt-in
79
+ * escape hatch for fields the typed interface does not model — e.g. a
80
+ * vLLM/Mantle-served Kimi endpoint's
81
+ * `{chat_template_kwargs: {enable_thinking: false}}` to suppress
82
+ * chain-of-thought, or Claude's `{output_config: {effort: 'low'}}` to cap
83
+ * how much it thinks before answering. Never sent unless set. Keys that
84
+ * collide with library-managed fields (model, messages, stream, tools, …)
85
+ * are ignored, so this can only add parameters, never override core
86
+ * request shape.
83
87
  */
84
88
  providerParams?: Record<string, unknown>;
85
89
  /** Abort the stream. Adapters MUST honor this and propagate to the vendor SDK. */
@@ -115,6 +119,16 @@ type LlmEvent = {
115
119
  id: string;
116
120
  name: string;
117
121
  arguments: unknown;
122
+ /**
123
+ * Opaque vendor-native state the adapter needs back when the call is
124
+ * written into history: pass the event to `appendAssistantToolCall`
125
+ * unchanged. Anthropic records the turn's content blocks here
126
+ * (`thinking`, `redacted_thinking`, text and `tool_use`, in order) and
127
+ * replays them, so the model keeps its reasoning after the tool result
128
+ * instead of working the turn out again. Absent unless the adapter
129
+ * set it.
130
+ */
131
+ vendorRaw?: unknown;
118
132
  } | {
119
133
  type: 'end';
120
134
  finishReason: FinishReason;
@@ -74,12 +74,16 @@ interface PromptRequest {
74
74
  maxTokens?: number;
75
75
  /**
76
76
  * Provider-specific request-body parameters merged verbatim into the
77
- * outgoing request by OpenAI-compatible adapters. Opt-in escape hatch for
78
- * fields the typed interface does not model — e.g. a vLLM/Mantle-served
79
- * Kimi endpoint's `{chat_template_kwargs: {enable_thinking: false}}` to
80
- * suppress chain-of-thought. Never sent unless set. Keys that collide with
81
- * library-managed fields (model, messages, stream, tools, …) are ignored,
82
- * so this can only add parameters, never override core request shape.
77
+ * outgoing request by OpenAI-compatible adapters and the Anthropic adapter
78
+ * (the Gemini adapters merge them into the generation config). Opt-in
79
+ * escape hatch for fields the typed interface does not model — e.g. a
80
+ * vLLM/Mantle-served Kimi endpoint's
81
+ * `{chat_template_kwargs: {enable_thinking: false}}` to suppress
82
+ * chain-of-thought, or Claude's `{output_config: {effort: 'low'}}` to cap
83
+ * how much it thinks before answering. Never sent unless set. Keys that
84
+ * collide with library-managed fields (model, messages, stream, tools, …)
85
+ * are ignored, so this can only add parameters, never override core
86
+ * request shape.
83
87
  */
84
88
  providerParams?: Record<string, unknown>;
85
89
  /** Abort the stream. Adapters MUST honor this and propagate to the vendor SDK. */
@@ -115,6 +119,16 @@ type LlmEvent = {
115
119
  id: string;
116
120
  name: string;
117
121
  arguments: unknown;
122
+ /**
123
+ * Opaque vendor-native state the adapter needs back when the call is
124
+ * written into history: pass the event to `appendAssistantToolCall`
125
+ * unchanged. Anthropic records the turn's content blocks here
126
+ * (`thinking`, `redacted_thinking`, text and `tool_use`, in order) and
127
+ * replays them, so the model keeps its reasoning after the tool result
128
+ * instead of working the turn out again. Absent unless the adapter
129
+ * set it.
130
+ */
131
+ vendorRaw?: unknown;
118
132
  } | {
119
133
  type: 'end';
120
134
  finishReason: FinishReason;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jambonz/llm",
3
- "version": "0.6.9",
3
+ "version": "0.6.11",
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",