@jambonz/llm 0.6.8 → 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 +193 -21
- 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 +193 -21
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +192 -20
- 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 +192 -20
- package/dist/test-kit/index.js.map +1 -1
- package/dist/{types-4l2etrW-.d.cts → types-C3Cdt-km.d.cts} +32 -7
- package/dist/{types-4l2etrW-.d.ts → types-C3Cdt-km.d.ts} +32 -7
- 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;
|
|
@@ -298,7 +312,18 @@ interface AdapterManifest {
|
|
|
298
312
|
* talks to the customer's harness over its own WebSocket protocol.
|
|
299
313
|
*/
|
|
300
314
|
credentialOnly?: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* What a credential for this vendor is used for, which decides where the
|
|
317
|
+
* portal lists it. Absent means `llm`; `getManifest()` fills it in.
|
|
318
|
+
*/
|
|
319
|
+
category?: VendorCategory;
|
|
301
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* - `llm`: a language model behind the agent verb (and the harness, which takes its place).
|
|
323
|
+
* - `s2s`: a speech-to-speech model for the llm verb. Ids are the schema's verb names (`openai_s2s`).
|
|
324
|
+
* - `hosted`: an agent defined and run at the vendor, e.g. Dialogflow CES for the dialogflow verb.
|
|
325
|
+
*/
|
|
326
|
+
type VendorCategory = 'llm' | 's2s' | 'hosted';
|
|
302
327
|
interface AuthKindSchema {
|
|
303
328
|
kind: AuthKind;
|
|
304
329
|
displayName: string;
|
|
@@ -435,4 +460,4 @@ interface CreateLlmArgs<A extends AuthSpec = AuthSpec> {
|
|
|
435
460
|
client?: ClientOptions;
|
|
436
461
|
}
|
|
437
462
|
|
|
438
|
-
export type { AuthSpec as A, BedrockApiKeyAuth as B, CreateLlmArgs as C, FinishReason as F, GoogleApiKeyAuth as G, JsonSchema as J, LlmAdapter as L, Message as M, PromptRequest as P, Role as R, ServiceAccountJson as S, Tool as T, Usage as U,
|
|
463
|
+
export type { AuthSpec as A, BedrockApiKeyAuth as B, CreateLlmArgs as C, FinishReason as F, GoogleApiKeyAuth as G, JsonSchema as J, LlmAdapter as L, Message as M, PromptRequest as P, Role as R, ServiceAccountJson as S, Tool as T, Usage as U, VendorCategory as V, AuthKindSchema as a, AdapterFactory as b, AdapterManifest as c, ApiKeyAuth as d, AuthKind as e, AzureOpenAIApiKeyAuth as f, BedrockIamAuth as g, ClientOptions as h, ContentBlock as i, FormField as j, FormFieldType as k, GoogleServiceAccountAuth as l, LlmEvent as m, ModelCapabilities as n, ModelInfo as o, ToolCallEvent as p, VertexServiceAccountAuth as q };
|
|
@@ -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;
|
|
@@ -298,7 +312,18 @@ interface AdapterManifest {
|
|
|
298
312
|
* talks to the customer's harness over its own WebSocket protocol.
|
|
299
313
|
*/
|
|
300
314
|
credentialOnly?: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* What a credential for this vendor is used for, which decides where the
|
|
317
|
+
* portal lists it. Absent means `llm`; `getManifest()` fills it in.
|
|
318
|
+
*/
|
|
319
|
+
category?: VendorCategory;
|
|
301
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* - `llm`: a language model behind the agent verb (and the harness, which takes its place).
|
|
323
|
+
* - `s2s`: a speech-to-speech model for the llm verb. Ids are the schema's verb names (`openai_s2s`).
|
|
324
|
+
* - `hosted`: an agent defined and run at the vendor, e.g. Dialogflow CES for the dialogflow verb.
|
|
325
|
+
*/
|
|
326
|
+
type VendorCategory = 'llm' | 's2s' | 'hosted';
|
|
302
327
|
interface AuthKindSchema {
|
|
303
328
|
kind: AuthKind;
|
|
304
329
|
displayName: string;
|
|
@@ -435,4 +460,4 @@ interface CreateLlmArgs<A extends AuthSpec = AuthSpec> {
|
|
|
435
460
|
client?: ClientOptions;
|
|
436
461
|
}
|
|
437
462
|
|
|
438
|
-
export type { AuthSpec as A, BedrockApiKeyAuth as B, CreateLlmArgs as C, FinishReason as F, GoogleApiKeyAuth as G, JsonSchema as J, LlmAdapter as L, Message as M, PromptRequest as P, Role as R, ServiceAccountJson as S, Tool as T, Usage as U,
|
|
463
|
+
export type { AuthSpec as A, BedrockApiKeyAuth as B, CreateLlmArgs as C, FinishReason as F, GoogleApiKeyAuth as G, JsonSchema as J, LlmAdapter as L, Message as M, PromptRequest as P, Role as R, ServiceAccountJson as S, Tool as T, Usage as U, VendorCategory as V, AuthKindSchema as a, AdapterFactory as b, AdapterManifest as c, ApiKeyAuth as d, AuthKind as e, AzureOpenAIApiKeyAuth as f, BedrockIamAuth as g, ClientOptions as h, ContentBlock as i, FormField as j, FormFieldType as k, GoogleServiceAccountAuth as l, LlmEvent as m, ModelCapabilities as n, ModelInfo as o, ToolCallEvent as p, VertexServiceAccountAuth as q };
|
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",
|