@yourgpt/llm-sdk 2.1.10-alpha.0 → 2.5.1-beta.0
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/adapters/index.d.mts +4 -38
- package/dist/adapters/index.d.ts +4 -38
- package/dist/adapters/index.js +158 -325
- package/dist/adapters/index.mjs +158 -325
- package/dist/base-C58Dsr9p.d.ts +259 -0
- package/dist/base-tNgbBaSo.d.mts +259 -0
- package/dist/fallback/index.d.mts +4 -4
- package/dist/fallback/index.d.ts +4 -4
- package/dist/index.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +35 -43
- package/dist/index.mjs +35 -43
- package/dist/providers/anthropic/index.d.mts +3 -3
- package/dist/providers/anthropic/index.d.ts +3 -3
- package/dist/providers/anthropic/index.js +271 -212
- package/dist/providers/anthropic/index.mjs +271 -212
- package/dist/providers/azure/index.d.mts +3 -3
- package/dist/providers/azure/index.d.ts +3 -3
- package/dist/providers/azure/index.js +49 -1
- package/dist/providers/azure/index.mjs +49 -1
- package/dist/providers/fireworks/index.d.mts +1 -1
- package/dist/providers/fireworks/index.d.ts +1 -1
- package/dist/providers/fireworks/index.js +56 -0
- package/dist/providers/fireworks/index.mjs +56 -0
- package/dist/providers/google/index.d.mts +3 -3
- package/dist/providers/google/index.d.ts +3 -3
- package/dist/providers/google/index.js +254 -510
- package/dist/providers/google/index.mjs +254 -510
- package/dist/providers/ollama/index.d.mts +4 -4
- package/dist/providers/ollama/index.d.ts +4 -4
- package/dist/providers/ollama/index.js +10 -2
- package/dist/providers/ollama/index.mjs +10 -2
- package/dist/providers/openai/index.d.mts +3 -3
- package/dist/providers/openai/index.d.ts +3 -3
- package/dist/providers/openai/index.js +269 -529
- package/dist/providers/openai/index.mjs +269 -529
- package/dist/providers/openrouter/index.d.mts +3 -7
- package/dist/providers/openrouter/index.d.ts +3 -7
- package/dist/providers/openrouter/index.js +365 -902
- package/dist/providers/openrouter/index.mjs +365 -902
- package/dist/providers/togetherai/index.d.mts +3 -3
- package/dist/providers/togetherai/index.d.ts +3 -3
- package/dist/providers/togetherai/index.js +259 -509
- package/dist/providers/togetherai/index.mjs +259 -509
- package/dist/providers/xai/index.d.mts +3 -3
- package/dist/providers/xai/index.d.ts +3 -3
- package/dist/providers/xai/index.js +258 -513
- package/dist/providers/xai/index.mjs +258 -513
- package/dist/{types-BNCmlJMs.d.mts → types-B6dhnguR.d.mts} +1 -1
- package/dist/{types-DhktekQ3.d.ts → types-BQ31QIsA.d.ts} +2 -1
- package/dist/{types-CMMQ8s2O.d.mts → types-BSSiJW2o.d.mts} +2 -1
- package/dist/{base-DN1EfKnE.d.mts → types-BkQCSiIt.d.mts} +388 -214
- package/dist/{base-DuUNxtVg.d.ts → types-BkQCSiIt.d.ts} +388 -214
- package/dist/{types-Pj-vpmoT.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
- package/dist/types-CMvvDo-E.d.mts +0 -428
- package/dist/types-CMvvDo-E.d.ts +0 -428
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { L as LLMAdapter,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
import '../types-
|
|
1
|
+
import { L as LLMAdapter, C as ChatCompletionRequest, a as CompletionResult } from '../base-tNgbBaSo.mjs';
|
|
2
|
+
export { A as AdapterFactory, l as AnthropicContentBlock, O as OpenAIContentBlock, j as attachmentToAnthropicDocument, i as attachmentToAnthropicImage, k as attachmentToOpenAIImage, f as formatMessages, c as formatMessagesForAnthropic, d as formatMessagesForOpenAI, b as formatTools, h as hasImageAttachments, g as hasMediaAttachments, m as messageToAnthropicContent, e as messageToOpenAIContent } from '../base-tNgbBaSo.mjs';
|
|
3
|
+
import { W as WebSearchConfig, g as StreamEvent } from '../types-BkQCSiIt.mjs';
|
|
4
|
+
import { d as OllamaModelOptions } from '../types-BSSiJW2o.mjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -13,8 +13,6 @@ interface OpenAIAdapterConfig {
|
|
|
13
13
|
baseUrl?: string;
|
|
14
14
|
temperature?: number;
|
|
15
15
|
maxTokens?: number;
|
|
16
|
-
/** Disable extended thinking/reasoning for OpenRouter models */
|
|
17
|
-
disableThinking?: boolean;
|
|
18
16
|
/**
|
|
19
17
|
* Enable native web search for GPT models.
|
|
20
18
|
* Uses OpenAI's web_search_preview tool.
|
|
@@ -38,38 +36,6 @@ declare class OpenAIAdapter implements LLMAdapter {
|
|
|
38
36
|
private buildResponsesInput;
|
|
39
37
|
private buildResponsesTools;
|
|
40
38
|
private parseResponsesResult;
|
|
41
|
-
/**
|
|
42
|
-
* OpenAI reasoning models on OpenRouter (o1/o3/o4/gpt-5 family) hide their
|
|
43
|
-
* reasoning content on the chat-completions endpoint. To surface reasoning
|
|
44
|
-
* SUMMARIES (not raw CoT, which OpenAI never exposes) we have to use the
|
|
45
|
-
* Responses API, which streams `response.reasoning_summary_text.delta` events.
|
|
46
|
-
*
|
|
47
|
-
* Match by prefix on the OpenRouter model id. Excludes openai/gpt-4o,
|
|
48
|
-
* openai/gpt-4.1, openai/chatgpt-* — those continue on chat-completions.
|
|
49
|
-
*/
|
|
50
|
-
private isOpenAIReasoningModelOnOpenRouter;
|
|
51
|
-
/**
|
|
52
|
-
* Convert ActionDefinition[] (the chat-completions tool shape used by the
|
|
53
|
-
* adapter) to the Responses API tool shape.
|
|
54
|
-
*/
|
|
55
|
-
private buildResponsesToolsFromActions;
|
|
56
|
-
/**
|
|
57
|
-
* Streaming Responses API path for OpenAI reasoning models on OpenRouter.
|
|
58
|
-
*
|
|
59
|
-
* Maps Responses API SSE events back to the same StreamEvent shapes the
|
|
60
|
-
* chat-completions path emits, so downstream consumers (processChunk.ts,
|
|
61
|
-
* frontend tool handlers, plan approval, specialist delegations) see
|
|
62
|
-
* identical events regardless of which path produced them.
|
|
63
|
-
*
|
|
64
|
-
* response.reasoning_summary_text.delta → thinking:start (once) + thinking:delta
|
|
65
|
-
* response.output_text.delta → message:delta
|
|
66
|
-
* response.output_item.added (function_call) → action:start (queued buffer)
|
|
67
|
-
* response.function_call_arguments.delta → action:args (progressive)
|
|
68
|
-
* response.output_item.done (function_call) → final action:args + action:end
|
|
69
|
-
* response.completed → message:end + done(usage)
|
|
70
|
-
* response.error → error
|
|
71
|
-
*/
|
|
72
|
-
private streamWithResponsesAPI;
|
|
73
39
|
private completeWithResponses;
|
|
74
40
|
stream(request: ChatCompletionRequest): AsyncGenerator<StreamEvent>;
|
|
75
41
|
complete(request: ChatCompletionRequest): Promise<CompletionResult>;
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { L as LLMAdapter,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
import '../types-
|
|
1
|
+
import { L as LLMAdapter, C as ChatCompletionRequest, a as CompletionResult } from '../base-C58Dsr9p.js';
|
|
2
|
+
export { A as AdapterFactory, l as AnthropicContentBlock, O as OpenAIContentBlock, j as attachmentToAnthropicDocument, i as attachmentToAnthropicImage, k as attachmentToOpenAIImage, f as formatMessages, c as formatMessagesForAnthropic, d as formatMessagesForOpenAI, b as formatTools, h as hasImageAttachments, g as hasMediaAttachments, m as messageToAnthropicContent, e as messageToOpenAIContent } from '../base-C58Dsr9p.js';
|
|
3
|
+
import { W as WebSearchConfig, g as StreamEvent } from '../types-BkQCSiIt.js';
|
|
4
|
+
import { d as OllamaModelOptions } from '../types-BQ31QIsA.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -13,8 +13,6 @@ interface OpenAIAdapterConfig {
|
|
|
13
13
|
baseUrl?: string;
|
|
14
14
|
temperature?: number;
|
|
15
15
|
maxTokens?: number;
|
|
16
|
-
/** Disable extended thinking/reasoning for OpenRouter models */
|
|
17
|
-
disableThinking?: boolean;
|
|
18
16
|
/**
|
|
19
17
|
* Enable native web search for GPT models.
|
|
20
18
|
* Uses OpenAI's web_search_preview tool.
|
|
@@ -38,38 +36,6 @@ declare class OpenAIAdapter implements LLMAdapter {
|
|
|
38
36
|
private buildResponsesInput;
|
|
39
37
|
private buildResponsesTools;
|
|
40
38
|
private parseResponsesResult;
|
|
41
|
-
/**
|
|
42
|
-
* OpenAI reasoning models on OpenRouter (o1/o3/o4/gpt-5 family) hide their
|
|
43
|
-
* reasoning content on the chat-completions endpoint. To surface reasoning
|
|
44
|
-
* SUMMARIES (not raw CoT, which OpenAI never exposes) we have to use the
|
|
45
|
-
* Responses API, which streams `response.reasoning_summary_text.delta` events.
|
|
46
|
-
*
|
|
47
|
-
* Match by prefix on the OpenRouter model id. Excludes openai/gpt-4o,
|
|
48
|
-
* openai/gpt-4.1, openai/chatgpt-* — those continue on chat-completions.
|
|
49
|
-
*/
|
|
50
|
-
private isOpenAIReasoningModelOnOpenRouter;
|
|
51
|
-
/**
|
|
52
|
-
* Convert ActionDefinition[] (the chat-completions tool shape used by the
|
|
53
|
-
* adapter) to the Responses API tool shape.
|
|
54
|
-
*/
|
|
55
|
-
private buildResponsesToolsFromActions;
|
|
56
|
-
/**
|
|
57
|
-
* Streaming Responses API path for OpenAI reasoning models on OpenRouter.
|
|
58
|
-
*
|
|
59
|
-
* Maps Responses API SSE events back to the same StreamEvent shapes the
|
|
60
|
-
* chat-completions path emits, so downstream consumers (processChunk.ts,
|
|
61
|
-
* frontend tool handlers, plan approval, specialist delegations) see
|
|
62
|
-
* identical events regardless of which path produced them.
|
|
63
|
-
*
|
|
64
|
-
* response.reasoning_summary_text.delta → thinking:start (once) + thinking:delta
|
|
65
|
-
* response.output_text.delta → message:delta
|
|
66
|
-
* response.output_item.added (function_call) → action:start (queued buffer)
|
|
67
|
-
* response.function_call_arguments.delta → action:args (progressive)
|
|
68
|
-
* response.output_item.done (function_call) → final action:args + action:end
|
|
69
|
-
* response.completed → message:end + done(usage)
|
|
70
|
-
* response.error → error
|
|
71
|
-
*/
|
|
72
|
-
private streamWithResponsesAPI;
|
|
73
39
|
private completeWithResponses;
|
|
74
40
|
stream(request: ChatCompletionRequest): AsyncGenerator<StreamEvent>;
|
|
75
41
|
complete(request: ChatCompletionRequest): Promise<CompletionResult>;
|