@jambonz/llm 0.6.9 → 0.6.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/dist/index.cjs +136 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +136 -19
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +136 -19
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.d.cts +1 -1
- package/dist/test-kit/index.d.ts +1 -1
- package/dist/test-kit/index.js +136 -19
- package/dist/test-kit/index.js.map +1 -1
- package/dist/{types-C_yrWq_0.d.cts → types-C3Cdt-km.d.cts} +20 -6
- package/dist/{types-C_yrWq_0.d.ts → types-C3Cdt-km.d.ts} +20 -6
- package/package.json +1 -1
|
@@ -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
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
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
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
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.
|
|
3
|
+
"version": "0.6.10",
|
|
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",
|