@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.
Files changed (59) hide show
  1. package/dist/adapters/index.d.mts +4 -38
  2. package/dist/adapters/index.d.ts +4 -38
  3. package/dist/adapters/index.js +158 -325
  4. package/dist/adapters/index.mjs +158 -325
  5. package/dist/base-C58Dsr9p.d.ts +259 -0
  6. package/dist/base-tNgbBaSo.d.mts +259 -0
  7. package/dist/fallback/index.d.mts +4 -4
  8. package/dist/fallback/index.d.ts +4 -4
  9. package/dist/index.d.mts +8 -7
  10. package/dist/index.d.ts +8 -7
  11. package/dist/index.js +35 -43
  12. package/dist/index.mjs +35 -43
  13. package/dist/providers/anthropic/index.d.mts +3 -3
  14. package/dist/providers/anthropic/index.d.ts +3 -3
  15. package/dist/providers/anthropic/index.js +271 -212
  16. package/dist/providers/anthropic/index.mjs +271 -212
  17. package/dist/providers/azure/index.d.mts +3 -3
  18. package/dist/providers/azure/index.d.ts +3 -3
  19. package/dist/providers/azure/index.js +49 -1
  20. package/dist/providers/azure/index.mjs +49 -1
  21. package/dist/providers/fireworks/index.d.mts +1 -1
  22. package/dist/providers/fireworks/index.d.ts +1 -1
  23. package/dist/providers/fireworks/index.js +56 -0
  24. package/dist/providers/fireworks/index.mjs +56 -0
  25. package/dist/providers/google/index.d.mts +3 -3
  26. package/dist/providers/google/index.d.ts +3 -3
  27. package/dist/providers/google/index.js +254 -510
  28. package/dist/providers/google/index.mjs +254 -510
  29. package/dist/providers/ollama/index.d.mts +4 -4
  30. package/dist/providers/ollama/index.d.ts +4 -4
  31. package/dist/providers/ollama/index.js +10 -2
  32. package/dist/providers/ollama/index.mjs +10 -2
  33. package/dist/providers/openai/index.d.mts +3 -3
  34. package/dist/providers/openai/index.d.ts +3 -3
  35. package/dist/providers/openai/index.js +269 -529
  36. package/dist/providers/openai/index.mjs +269 -529
  37. package/dist/providers/openrouter/index.d.mts +3 -7
  38. package/dist/providers/openrouter/index.d.ts +3 -7
  39. package/dist/providers/openrouter/index.js +365 -902
  40. package/dist/providers/openrouter/index.mjs +365 -902
  41. package/dist/providers/togetherai/index.d.mts +3 -3
  42. package/dist/providers/togetherai/index.d.ts +3 -3
  43. package/dist/providers/togetherai/index.js +259 -509
  44. package/dist/providers/togetherai/index.mjs +259 -509
  45. package/dist/providers/xai/index.d.mts +3 -3
  46. package/dist/providers/xai/index.d.ts +3 -3
  47. package/dist/providers/xai/index.js +258 -513
  48. package/dist/providers/xai/index.mjs +258 -513
  49. package/dist/{types-BNCmlJMs.d.mts → types-B6dhnguR.d.mts} +1 -1
  50. package/dist/{types-DhktekQ3.d.ts → types-BQ31QIsA.d.ts} +2 -1
  51. package/dist/{types-CMMQ8s2O.d.mts → types-BSSiJW2o.d.mts} +2 -1
  52. package/dist/{base-DN1EfKnE.d.mts → types-BkQCSiIt.d.mts} +388 -214
  53. package/dist/{base-DuUNxtVg.d.ts → types-BkQCSiIt.d.ts} +388 -214
  54. package/dist/{types-Pj-vpmoT.d.ts → types-CCxPmkmK.d.ts} +1 -1
  55. package/dist/yourgpt/index.d.mts +1 -1
  56. package/dist/yourgpt/index.d.ts +1 -1
  57. package/package.json +1 -1
  58. package/dist/types-CMvvDo-E.d.mts +0 -428
  59. package/dist/types-CMvvDo-E.d.ts +0 -428
@@ -1,7 +1,7 @@
1
- import { L as LLMAdapter, W as WebSearchConfig, C as ChatCompletionRequest, S as StreamEvent, o as CompletionResult } from '../base-DN1EfKnE.mjs';
2
- export { e as AdapterFactory, B as AnthropicContentBlock, E as OpenAIContentBlock, y as attachmentToAnthropicDocument, x as attachmentToAnthropicImage, z as attachmentToOpenAIImage, p as formatMessages, r as formatMessagesForAnthropic, s as formatMessagesForOpenAI, q as formatTools, v as hasImageAttachments, w as hasMediaAttachments, t as messageToAnthropicContent, u as messageToOpenAIContent } from '../base-DN1EfKnE.mjs';
3
- import { d as OllamaModelOptions } from '../types-CMMQ8s2O.mjs';
4
- import '../types-CMvvDo-E.mjs';
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>;
@@ -1,7 +1,7 @@
1
- import { L as LLMAdapter, W as WebSearchConfig, C as ChatCompletionRequest, S as StreamEvent, o as CompletionResult } from '../base-DuUNxtVg.js';
2
- export { e as AdapterFactory, B as AnthropicContentBlock, E as OpenAIContentBlock, y as attachmentToAnthropicDocument, x as attachmentToAnthropicImage, z as attachmentToOpenAIImage, p as formatMessages, r as formatMessagesForAnthropic, s as formatMessagesForOpenAI, q as formatTools, v as hasImageAttachments, w as hasMediaAttachments, t as messageToAnthropicContent, u as messageToOpenAIContent } from '../base-DuUNxtVg.js';
3
- import { d as OllamaModelOptions } from '../types-DhktekQ3.js';
4
- import '../types-CMvvDo-E.js';
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>;