@yourgpt/llm-sdk 2.5.1-beta.1 → 2.5.1-beta.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/README.md +1 -19
- package/dist/adapters/index.d.mts +4 -4
- package/dist/adapters/index.d.ts +4 -4
- package/dist/adapters/index.js +15 -139
- package/dist/adapters/index.mjs +15 -139
- package/dist/{base-Cxq3ni0t.d.ts → base-C58Dsr9p.d.ts} +1 -5
- package/dist/{base-BYQKp9TW.d.mts → base-tNgbBaSo.d.mts} +1 -5
- package/dist/fallback/index.d.mts +4 -4
- package/dist/fallback/index.d.ts +4 -4
- package/dist/index.d.mts +8 -60
- package/dist/index.d.ts +8 -60
- package/dist/index.js +0 -59
- package/dist/index.mjs +0 -59
- package/dist/providers/anthropic/index.d.mts +3 -3
- package/dist/providers/anthropic/index.d.ts +3 -3
- package/dist/providers/anthropic/index.js +10 -91
- package/dist/providers/anthropic/index.mjs +10 -91
- package/dist/providers/azure/index.d.mts +3 -3
- package/dist/providers/azure/index.d.ts +3 -3
- package/dist/providers/azure/index.js +1 -0
- package/dist/providers/azure/index.mjs +1 -0
- package/dist/providers/fireworks/index.d.mts +67 -2
- package/dist/providers/fireworks/index.d.ts +67 -2
- package/dist/providers/fireworks/index.js +721 -1
- package/dist/providers/fireworks/index.mjs +719 -1
- package/dist/providers/google/index.d.mts +3 -3
- package/dist/providers/google/index.d.ts +3 -3
- package/dist/providers/google/index.js +4 -51
- package/dist/providers/google/index.mjs +4 -51
- package/dist/providers/ollama/index.d.mts +4 -4
- package/dist/providers/ollama/index.d.ts +4 -4
- package/dist/providers/ollama/index.js +1 -0
- package/dist/providers/ollama/index.mjs +1 -0
- package/dist/providers/openai/index.d.mts +3 -3
- package/dist/providers/openai/index.d.ts +3 -3
- package/dist/providers/openai/index.js +4 -51
- package/dist/providers/openai/index.mjs +4 -51
- package/dist/providers/openrouter/index.d.mts +3 -3
- package/dist/providers/openrouter/index.d.ts +3 -3
- package/dist/providers/openrouter/index.js +4 -51
- package/dist/providers/openrouter/index.mjs +4 -51
- package/dist/providers/togetherai/index.d.mts +3 -3
- package/dist/providers/togetherai/index.d.ts +3 -3
- package/dist/providers/togetherai/index.js +4 -51
- package/dist/providers/togetherai/index.mjs +4 -51
- package/dist/providers/xai/index.d.mts +3 -3
- package/dist/providers/xai/index.d.ts +3 -3
- package/dist/providers/xai/index.js +4 -51
- package/dist/providers/xai/index.mjs +4 -51
- package/dist/{types-mwMhCwOq.d.mts → types-B6dhnguR.d.mts} +1 -1
- package/dist/{types-TMilS-Dz.d.ts → types-BQ31QIsA.d.ts} +2 -2
- package/dist/{types-BvkiJ1dd.d.mts → types-BSSiJW2o.d.mts} +2 -2
- package/dist/{types-D774b0dg.d.mts → types-BkQCSiIt.d.mts} +2 -57
- package/dist/{types-D774b0dg.d.ts → types-BkQCSiIt.d.ts} +2 -57
- package/dist/{types-ChORafYS.d.ts → types-CCxPmkmK.d.ts} +1 -1
- package/dist/yourgpt/index.d.mts +1 -1
- package/dist/yourgpt/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -245,42 +245,6 @@ type ResponseFormat = {
|
|
|
245
245
|
strict?: boolean;
|
|
246
246
|
};
|
|
247
247
|
};
|
|
248
|
-
/**
|
|
249
|
-
* MCP (Model Context Protocol) server reference for a request.
|
|
250
|
-
*
|
|
251
|
-
* Vendor-neutral shape — each adapter translates to its provider's native
|
|
252
|
-
* field: OpenAI Responses `tools[type=mcp]`, Anthropic `mcp_servers` +
|
|
253
|
-
* `tools[type=mcp_toolset]` (beta `mcp-client-2025-11-20`), or local
|
|
254
|
-
* execution for adapters without native MCP.
|
|
255
|
-
*/
|
|
256
|
-
interface McpServerConfig {
|
|
257
|
-
/** Human-readable label sent to the provider (also used as MCP server name). */
|
|
258
|
-
label: string;
|
|
259
|
-
/** MCP server endpoint (HTTP/SSE URL). */
|
|
260
|
-
url: string;
|
|
261
|
-
/** Additional HTTP headers; the `Authorization` value is also extracted for providers that take a separate token field. */
|
|
262
|
-
headers?: Record<string, string>;
|
|
263
|
-
/** Restrict the model to a subset of the MCP server's exposed tools. */
|
|
264
|
-
allowedTools?: string[];
|
|
265
|
-
/** Approval policy for tool invocation. Defaults to "never" (no human-in-the-loop). */
|
|
266
|
-
requireApproval?: "never" | "always";
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Reasoning effort knob — normalized across providers.
|
|
270
|
-
*
|
|
271
|
-
* Maps to OpenAI Responses `reasoning.effort`, Anthropic `thinking`
|
|
272
|
-
* (adaptive+effort on Claude 4.6/4.7, budget_tokens on older models),
|
|
273
|
-
* Gemini `thinkingBudget`, xAI `reasoning_effort`. Adapters silently
|
|
274
|
-
* no-op when the underlying model doesn't support reasoning.
|
|
275
|
-
*
|
|
276
|
-
* Use the enum for the common case, or `{ budgetTokens }` / `{ raw }`
|
|
277
|
-
* for provider-specific escape hatches when full fidelity is required.
|
|
278
|
-
*/
|
|
279
|
-
type ReasoningEffort = "minimal" | "low" | "medium" | "high" | {
|
|
280
|
-
budgetTokens: number;
|
|
281
|
-
} | {
|
|
282
|
-
raw: Record<string, unknown>;
|
|
283
|
-
};
|
|
284
248
|
/**
|
|
285
249
|
* LLM configuration
|
|
286
250
|
*/
|
|
@@ -288,8 +252,6 @@ interface LLMConfig {
|
|
|
288
252
|
temperature?: number;
|
|
289
253
|
maxTokens?: number;
|
|
290
254
|
responseFormat?: ResponseFormat;
|
|
291
|
-
mcpServers?: McpServerConfig[];
|
|
292
|
-
reasoningEffort?: ReasoningEffort;
|
|
293
255
|
}
|
|
294
256
|
/**
|
|
295
257
|
* Tool call format (OpenAI style)
|
|
@@ -658,7 +620,7 @@ interface ToolMessage {
|
|
|
658
620
|
/**
|
|
659
621
|
* Content parts for multimodal user messages
|
|
660
622
|
*/
|
|
661
|
-
type UserContentPart = TextPart | ImagePart | FilePart
|
|
623
|
+
type UserContentPart = TextPart | ImagePart | FilePart;
|
|
662
624
|
interface TextPart {
|
|
663
625
|
type: "text";
|
|
664
626
|
text: string;
|
|
@@ -677,15 +639,6 @@ interface FilePart {
|
|
|
677
639
|
/** MIME type (e.g., 'application/pdf') */
|
|
678
640
|
mimeType: string;
|
|
679
641
|
}
|
|
680
|
-
interface AudioPart {
|
|
681
|
-
type: "input_audio";
|
|
682
|
-
input_audio: {
|
|
683
|
-
/** Base64-encoded audio data */
|
|
684
|
-
data: string;
|
|
685
|
-
/** Audio format (e.g., 'mp3', 'wav', 'ogg', 'webm', 'm4a', 'flac') */
|
|
686
|
-
format: string;
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
642
|
/**
|
|
690
643
|
* Tool definition with Zod schema support
|
|
691
644
|
*/
|
|
@@ -749,10 +702,6 @@ interface DoGenerateParams {
|
|
|
749
702
|
maxTokens?: number;
|
|
750
703
|
/** Structured-output / JSON-mode request format (provider-translated) */
|
|
751
704
|
responseFormat?: ResponseFormat;
|
|
752
|
-
/** MCP servers exposed to the model (provider-translated). */
|
|
753
|
-
mcpServers?: McpServerConfig[];
|
|
754
|
-
/** Reasoning/thinking effort knob (provider-translated). */
|
|
755
|
-
reasoningEffort?: ReasoningEffort;
|
|
756
705
|
/** Abort signal */
|
|
757
706
|
signal?: AbortSignal;
|
|
758
707
|
}
|
|
@@ -831,10 +780,6 @@ interface GenerateTextParams {
|
|
|
831
780
|
maxTokens?: number;
|
|
832
781
|
/** Structured-output / JSON-mode request format */
|
|
833
782
|
responseFormat?: ResponseFormat;
|
|
834
|
-
/** MCP servers exposed to the model (provider-translated). */
|
|
835
|
-
mcpServers?: McpServerConfig[];
|
|
836
|
-
/** Reasoning/thinking effort knob (provider-translated). */
|
|
837
|
-
reasoningEffort?: ReasoningEffort;
|
|
838
783
|
/** Abort signal */
|
|
839
784
|
signal?: AbortSignal;
|
|
840
785
|
}
|
|
@@ -1015,4 +960,4 @@ interface StorageFile {
|
|
|
1015
960
|
filename?: string;
|
|
1016
961
|
}
|
|
1017
962
|
|
|
1018
|
-
export { type
|
|
963
|
+
export { type ToolExecution as $, type ActionDefinition as A, type ToolResultChunk as B, type CoreMessage as C, type DoneEventMessage as D, type FinishChunk as E, type FilePart as F, type GenerateTextParams as G, type ErrorChunk as H, type ImagePart as I, type TokenUsage as J, type KnowledgeBaseConfig as K, type LanguageModel as L, type Message as M, type FinishReason as N, type ResponseOptions as O, type ProviderToolRuntimeOptions as P, type StorageFile as Q, type ResponseFormat as R, type StreamTextParams as S, type ToolContext as T, type UserMessage as U, DEFAULT_CAPABILITIES as V, type WebSearchConfig as W, type LLMConfig as X, type ToolLocation as Y, type UnifiedToolCall as Z, type UnifiedToolResult as _, type GenerateTextResult as a, type OpenAIToolSelectionHints as a0, type AnthropicToolSelectionHints as a1, type ToolNativeProviderHints as a2, type OpenAIProviderToolOptions as a3, type AnthropicProviderToolOptions as a4, type Citation as a5, type MessageAttachment as a6, type StreamTextResult as b, type Tool as c, type ToolDefinition as d, type ToolProfile as e, type StorageAdapter as f, type StreamEvent as g, type ToolCallInfo as h, type TokenUsageRaw as i, type ToolResponse as j, type StorageMessage as k, type ModelCapabilities as l, type DoGenerateParams as m, type DoGenerateResult as n, type SystemMessage as o, type AssistantMessage as p, type ToolMessage as q, type UserContentPart as r, type TextPart as s, type ToolCall as t, type ToolResult as u, type GenerateStep as v, type StreamPart as w, type StreamChunk as x, type TextDeltaChunk as y, type ToolCallChunk as z };
|
|
@@ -245,42 +245,6 @@ type ResponseFormat = {
|
|
|
245
245
|
strict?: boolean;
|
|
246
246
|
};
|
|
247
247
|
};
|
|
248
|
-
/**
|
|
249
|
-
* MCP (Model Context Protocol) server reference for a request.
|
|
250
|
-
*
|
|
251
|
-
* Vendor-neutral shape — each adapter translates to its provider's native
|
|
252
|
-
* field: OpenAI Responses `tools[type=mcp]`, Anthropic `mcp_servers` +
|
|
253
|
-
* `tools[type=mcp_toolset]` (beta `mcp-client-2025-11-20`), or local
|
|
254
|
-
* execution for adapters without native MCP.
|
|
255
|
-
*/
|
|
256
|
-
interface McpServerConfig {
|
|
257
|
-
/** Human-readable label sent to the provider (also used as MCP server name). */
|
|
258
|
-
label: string;
|
|
259
|
-
/** MCP server endpoint (HTTP/SSE URL). */
|
|
260
|
-
url: string;
|
|
261
|
-
/** Additional HTTP headers; the `Authorization` value is also extracted for providers that take a separate token field. */
|
|
262
|
-
headers?: Record<string, string>;
|
|
263
|
-
/** Restrict the model to a subset of the MCP server's exposed tools. */
|
|
264
|
-
allowedTools?: string[];
|
|
265
|
-
/** Approval policy for tool invocation. Defaults to "never" (no human-in-the-loop). */
|
|
266
|
-
requireApproval?: "never" | "always";
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Reasoning effort knob — normalized across providers.
|
|
270
|
-
*
|
|
271
|
-
* Maps to OpenAI Responses `reasoning.effort`, Anthropic `thinking`
|
|
272
|
-
* (adaptive+effort on Claude 4.6/4.7, budget_tokens on older models),
|
|
273
|
-
* Gemini `thinkingBudget`, xAI `reasoning_effort`. Adapters silently
|
|
274
|
-
* no-op when the underlying model doesn't support reasoning.
|
|
275
|
-
*
|
|
276
|
-
* Use the enum for the common case, or `{ budgetTokens }` / `{ raw }`
|
|
277
|
-
* for provider-specific escape hatches when full fidelity is required.
|
|
278
|
-
*/
|
|
279
|
-
type ReasoningEffort = "minimal" | "low" | "medium" | "high" | {
|
|
280
|
-
budgetTokens: number;
|
|
281
|
-
} | {
|
|
282
|
-
raw: Record<string, unknown>;
|
|
283
|
-
};
|
|
284
248
|
/**
|
|
285
249
|
* LLM configuration
|
|
286
250
|
*/
|
|
@@ -288,8 +252,6 @@ interface LLMConfig {
|
|
|
288
252
|
temperature?: number;
|
|
289
253
|
maxTokens?: number;
|
|
290
254
|
responseFormat?: ResponseFormat;
|
|
291
|
-
mcpServers?: McpServerConfig[];
|
|
292
|
-
reasoningEffort?: ReasoningEffort;
|
|
293
255
|
}
|
|
294
256
|
/**
|
|
295
257
|
* Tool call format (OpenAI style)
|
|
@@ -658,7 +620,7 @@ interface ToolMessage {
|
|
|
658
620
|
/**
|
|
659
621
|
* Content parts for multimodal user messages
|
|
660
622
|
*/
|
|
661
|
-
type UserContentPart = TextPart | ImagePart | FilePart
|
|
623
|
+
type UserContentPart = TextPart | ImagePart | FilePart;
|
|
662
624
|
interface TextPart {
|
|
663
625
|
type: "text";
|
|
664
626
|
text: string;
|
|
@@ -677,15 +639,6 @@ interface FilePart {
|
|
|
677
639
|
/** MIME type (e.g., 'application/pdf') */
|
|
678
640
|
mimeType: string;
|
|
679
641
|
}
|
|
680
|
-
interface AudioPart {
|
|
681
|
-
type: "input_audio";
|
|
682
|
-
input_audio: {
|
|
683
|
-
/** Base64-encoded audio data */
|
|
684
|
-
data: string;
|
|
685
|
-
/** Audio format (e.g., 'mp3', 'wav', 'ogg', 'webm', 'm4a', 'flac') */
|
|
686
|
-
format: string;
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
642
|
/**
|
|
690
643
|
* Tool definition with Zod schema support
|
|
691
644
|
*/
|
|
@@ -749,10 +702,6 @@ interface DoGenerateParams {
|
|
|
749
702
|
maxTokens?: number;
|
|
750
703
|
/** Structured-output / JSON-mode request format (provider-translated) */
|
|
751
704
|
responseFormat?: ResponseFormat;
|
|
752
|
-
/** MCP servers exposed to the model (provider-translated). */
|
|
753
|
-
mcpServers?: McpServerConfig[];
|
|
754
|
-
/** Reasoning/thinking effort knob (provider-translated). */
|
|
755
|
-
reasoningEffort?: ReasoningEffort;
|
|
756
705
|
/** Abort signal */
|
|
757
706
|
signal?: AbortSignal;
|
|
758
707
|
}
|
|
@@ -831,10 +780,6 @@ interface GenerateTextParams {
|
|
|
831
780
|
maxTokens?: number;
|
|
832
781
|
/** Structured-output / JSON-mode request format */
|
|
833
782
|
responseFormat?: ResponseFormat;
|
|
834
|
-
/** MCP servers exposed to the model (provider-translated). */
|
|
835
|
-
mcpServers?: McpServerConfig[];
|
|
836
|
-
/** Reasoning/thinking effort knob (provider-translated). */
|
|
837
|
-
reasoningEffort?: ReasoningEffort;
|
|
838
783
|
/** Abort signal */
|
|
839
784
|
signal?: AbortSignal;
|
|
840
785
|
}
|
|
@@ -1015,4 +960,4 @@ interface StorageFile {
|
|
|
1015
960
|
filename?: string;
|
|
1016
961
|
}
|
|
1017
962
|
|
|
1018
|
-
export { type
|
|
963
|
+
export { type ToolExecution as $, type ActionDefinition as A, type ToolResultChunk as B, type CoreMessage as C, type DoneEventMessage as D, type FinishChunk as E, type FilePart as F, type GenerateTextParams as G, type ErrorChunk as H, type ImagePart as I, type TokenUsage as J, type KnowledgeBaseConfig as K, type LanguageModel as L, type Message as M, type FinishReason as N, type ResponseOptions as O, type ProviderToolRuntimeOptions as P, type StorageFile as Q, type ResponseFormat as R, type StreamTextParams as S, type ToolContext as T, type UserMessage as U, DEFAULT_CAPABILITIES as V, type WebSearchConfig as W, type LLMConfig as X, type ToolLocation as Y, type UnifiedToolCall as Z, type UnifiedToolResult as _, type GenerateTextResult as a, type OpenAIToolSelectionHints as a0, type AnthropicToolSelectionHints as a1, type ToolNativeProviderHints as a2, type OpenAIProviderToolOptions as a3, type AnthropicProviderToolOptions as a4, type Citation as a5, type MessageAttachment as a6, type StreamTextResult as b, type Tool as c, type ToolDefinition as d, type ToolProfile as e, type StorageAdapter as f, type StreamEvent as g, type ToolCallInfo as h, type TokenUsageRaw as i, type ToolResponse as j, type StorageMessage as k, type ModelCapabilities as l, type DoGenerateParams as m, type DoGenerateResult as n, type SystemMessage as o, type AssistantMessage as p, type ToolMessage as q, type UserContentPart as r, type TextPart as s, type ToolCall as t, type ToolResult as u, type GenerateStep as v, type StreamPart as w, type StreamChunk as x, type TextDeltaChunk as y, type ToolCallChunk as z };
|
package/dist/yourgpt/index.d.mts
CHANGED
package/dist/yourgpt/index.d.ts
CHANGED