@yourgpt/llm-sdk 2.0.1 → 2.0.2-beta.1
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 +27 -4
- package/dist/adapters/index.d.ts +27 -4
- package/dist/adapters/index.js +395 -25
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +395 -25
- package/dist/adapters/index.mjs.map +1 -1
- package/dist/index.d.mts +17 -5
- package/dist/index.d.ts +17 -5
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -3
- package/dist/index.mjs.map +1 -1
- package/dist/providers/anthropic/index.d.mts +1 -2
- package/dist/providers/anthropic/index.d.ts +1 -2
- package/dist/providers/anthropic/index.js +108 -12
- package/dist/providers/anthropic/index.js.map +1 -1
- package/dist/providers/anthropic/index.mjs +108 -12
- package/dist/providers/anthropic/index.mjs.map +1 -1
- package/dist/providers/azure/index.d.mts +1 -2
- package/dist/providers/azure/index.d.ts +1 -2
- package/dist/providers/azure/index.js.map +1 -1
- package/dist/providers/azure/index.mjs.map +1 -1
- package/dist/providers/google/index.d.mts +1 -2
- package/dist/providers/google/index.d.ts +1 -2
- package/dist/providers/google/index.js +61 -2
- package/dist/providers/google/index.js.map +1 -1
- package/dist/providers/google/index.mjs +61 -2
- package/dist/providers/google/index.mjs.map +1 -1
- package/dist/providers/ollama/index.d.mts +8 -3
- package/dist/providers/ollama/index.d.ts +8 -3
- package/dist/providers/ollama/index.js +227 -17
- package/dist/providers/ollama/index.js.map +1 -1
- package/dist/providers/ollama/index.mjs +227 -17
- package/dist/providers/ollama/index.mjs.map +1 -1
- package/dist/providers/openai/index.d.mts +1 -2
- package/dist/providers/openai/index.d.ts +1 -2
- package/dist/providers/openai/index.js +57 -3
- package/dist/providers/openai/index.js.map +1 -1
- package/dist/providers/openai/index.mjs +57 -3
- package/dist/providers/openai/index.mjs.map +1 -1
- package/dist/providers/openrouter/index.d.mts +56 -3
- package/dist/providers/openrouter/index.d.ts +56 -3
- package/dist/providers/openrouter/index.js +90 -276
- package/dist/providers/openrouter/index.js.map +1 -1
- package/dist/providers/openrouter/index.mjs +89 -277
- package/dist/providers/openrouter/index.mjs.map +1 -1
- package/dist/providers/xai/index.d.mts +1 -2
- package/dist/providers/xai/index.d.ts +1 -2
- package/dist/providers/xai/index.js.map +1 -1
- package/dist/providers/xai/index.mjs.map +1 -1
- package/dist/{base-DdxolpKP.d.mts → types-ClJBhmS0.d.mts} +427 -3
- package/dist/{base-DdxolpKP.d.ts → types-ClJBhmS0.d.ts} +427 -3
- package/package.json +1 -1
- package/dist/types-Ck25ZYma.d.mts +0 -323
- package/dist/types-Dsz8SpdB.d.ts +0 -323
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LLMAdapter,
|
|
2
|
-
export {
|
|
1
|
+
import { L as LLMAdapter, W as WebSearchConfig, P as ChatCompletionRequest, g as StreamEvent, aj as CompletionResult, a2 as OllamaModelOptions } from '../types-ClJBhmS0.mjs';
|
|
2
|
+
export { Q as AdapterFactory, av as AnthropicContentBlock, aw as OpenAIContentBlock, at as attachmentToAnthropicDocument, as as attachmentToAnthropicImage, au as attachmentToOpenAIImage, ak as formatMessages, am as formatMessagesForAnthropic, an as formatMessagesForOpenAI, al as formatTools, aq as hasImageAttachments, ar as hasMediaAttachments, ao as messageToAnthropicContent, ap as messageToOpenAIContent } from '../types-ClJBhmS0.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -11,6 +11,11 @@ interface OpenAIAdapterConfig {
|
|
|
11
11
|
baseUrl?: string;
|
|
12
12
|
temperature?: number;
|
|
13
13
|
maxTokens?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Enable native web search for GPT models.
|
|
16
|
+
* Uses OpenAI's web_search_preview tool.
|
|
17
|
+
*/
|
|
18
|
+
webSearch?: boolean | WebSearchConfig;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
21
|
* OpenAI LLM Adapter
|
|
@@ -51,6 +56,11 @@ interface AnthropicAdapterConfig {
|
|
|
51
56
|
thinking?: ThinkingConfig;
|
|
52
57
|
temperature?: number;
|
|
53
58
|
maxTokens?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Enable native web search for Claude.
|
|
61
|
+
* When true, Claude can search the web to answer questions.
|
|
62
|
+
*/
|
|
63
|
+
webSearch?: boolean | WebSearchConfig;
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
56
66
|
* Anthropic LLM Adapter
|
|
@@ -99,11 +109,19 @@ interface OllamaAdapterConfig {
|
|
|
99
109
|
baseUrl?: string;
|
|
100
110
|
temperature?: number;
|
|
101
111
|
maxTokens?: number;
|
|
112
|
+
/** Ollama-specific model options */
|
|
113
|
+
options?: OllamaModelOptions;
|
|
102
114
|
}
|
|
103
115
|
/**
|
|
104
116
|
* Ollama LLM Adapter (Local models)
|
|
105
117
|
*
|
|
106
|
-
* Supports: Llama 3, Mistral, Phi, Gemma, CodeLlama, etc.
|
|
118
|
+
* Supports: Llama 3, Mistral, Phi, Gemma, CodeLlama, LLaVA (vision), etc.
|
|
119
|
+
*
|
|
120
|
+
* Features:
|
|
121
|
+
* - Tool/function calling (OpenAI-compatible format)
|
|
122
|
+
* - Vision support (images via base64)
|
|
123
|
+
* - Ollama-specific options (num_ctx, mirostat, etc.)
|
|
124
|
+
* - Raw message support for agent loop
|
|
107
125
|
*/
|
|
108
126
|
declare class OllamaAdapter implements LLMAdapter {
|
|
109
127
|
readonly provider = "ollama";
|
|
@@ -122,7 +140,7 @@ declare function createOllamaAdapter(config?: OllamaAdapterConfig): OllamaAdapte
|
|
|
122
140
|
* Google Gemini LLM Adapter
|
|
123
141
|
*
|
|
124
142
|
* Supports: Gemini 2.0, 1.5 Pro, 1.5 Flash, etc.
|
|
125
|
-
* Features: Vision, Audio, Video, PDF, Tools/Function Calling
|
|
143
|
+
* Features: Vision, Audio, Video, PDF, Tools/Function Calling, Google Search Grounding
|
|
126
144
|
*/
|
|
127
145
|
|
|
128
146
|
/**
|
|
@@ -139,6 +157,11 @@ interface GoogleAdapterConfig {
|
|
|
139
157
|
category: string;
|
|
140
158
|
threshold: string;
|
|
141
159
|
}>;
|
|
160
|
+
/**
|
|
161
|
+
* Enable native Google Search grounding for Gemini.
|
|
162
|
+
* When true, Gemini can search Google to answer questions.
|
|
163
|
+
*/
|
|
164
|
+
webSearch?: boolean | WebSearchConfig;
|
|
142
165
|
}
|
|
143
166
|
/**
|
|
144
167
|
* Google Gemini LLM Adapter
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LLMAdapter,
|
|
2
|
-
export {
|
|
1
|
+
import { L as LLMAdapter, W as WebSearchConfig, P as ChatCompletionRequest, g as StreamEvent, aj as CompletionResult, a2 as OllamaModelOptions } from '../types-ClJBhmS0.js';
|
|
2
|
+
export { Q as AdapterFactory, av as AnthropicContentBlock, aw as OpenAIContentBlock, at as attachmentToAnthropicDocument, as as attachmentToAnthropicImage, au as attachmentToOpenAIImage, ak as formatMessages, am as formatMessagesForAnthropic, an as formatMessagesForOpenAI, al as formatTools, aq as hasImageAttachments, ar as hasMediaAttachments, ao as messageToAnthropicContent, ap as messageToOpenAIContent } from '../types-ClJBhmS0.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -11,6 +11,11 @@ interface OpenAIAdapterConfig {
|
|
|
11
11
|
baseUrl?: string;
|
|
12
12
|
temperature?: number;
|
|
13
13
|
maxTokens?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Enable native web search for GPT models.
|
|
16
|
+
* Uses OpenAI's web_search_preview tool.
|
|
17
|
+
*/
|
|
18
|
+
webSearch?: boolean | WebSearchConfig;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
21
|
* OpenAI LLM Adapter
|
|
@@ -51,6 +56,11 @@ interface AnthropicAdapterConfig {
|
|
|
51
56
|
thinking?: ThinkingConfig;
|
|
52
57
|
temperature?: number;
|
|
53
58
|
maxTokens?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Enable native web search for Claude.
|
|
61
|
+
* When true, Claude can search the web to answer questions.
|
|
62
|
+
*/
|
|
63
|
+
webSearch?: boolean | WebSearchConfig;
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
56
66
|
* Anthropic LLM Adapter
|
|
@@ -99,11 +109,19 @@ interface OllamaAdapterConfig {
|
|
|
99
109
|
baseUrl?: string;
|
|
100
110
|
temperature?: number;
|
|
101
111
|
maxTokens?: number;
|
|
112
|
+
/** Ollama-specific model options */
|
|
113
|
+
options?: OllamaModelOptions;
|
|
102
114
|
}
|
|
103
115
|
/**
|
|
104
116
|
* Ollama LLM Adapter (Local models)
|
|
105
117
|
*
|
|
106
|
-
* Supports: Llama 3, Mistral, Phi, Gemma, CodeLlama, etc.
|
|
118
|
+
* Supports: Llama 3, Mistral, Phi, Gemma, CodeLlama, LLaVA (vision), etc.
|
|
119
|
+
*
|
|
120
|
+
* Features:
|
|
121
|
+
* - Tool/function calling (OpenAI-compatible format)
|
|
122
|
+
* - Vision support (images via base64)
|
|
123
|
+
* - Ollama-specific options (num_ctx, mirostat, etc.)
|
|
124
|
+
* - Raw message support for agent loop
|
|
107
125
|
*/
|
|
108
126
|
declare class OllamaAdapter implements LLMAdapter {
|
|
109
127
|
readonly provider = "ollama";
|
|
@@ -122,7 +140,7 @@ declare function createOllamaAdapter(config?: OllamaAdapterConfig): OllamaAdapte
|
|
|
122
140
|
* Google Gemini LLM Adapter
|
|
123
141
|
*
|
|
124
142
|
* Supports: Gemini 2.0, 1.5 Pro, 1.5 Flash, etc.
|
|
125
|
-
* Features: Vision, Audio, Video, PDF, Tools/Function Calling
|
|
143
|
+
* Features: Vision, Audio, Video, PDF, Tools/Function Calling, Google Search Grounding
|
|
126
144
|
*/
|
|
127
145
|
|
|
128
146
|
/**
|
|
@@ -139,6 +157,11 @@ interface GoogleAdapterConfig {
|
|
|
139
157
|
category: string;
|
|
140
158
|
threshold: string;
|
|
141
159
|
}>;
|
|
160
|
+
/**
|
|
161
|
+
* Enable native Google Search grounding for Gemini.
|
|
162
|
+
* When true, Gemini can search Google to answer questions.
|
|
163
|
+
*/
|
|
164
|
+
webSearch?: boolean | WebSearchConfig;
|
|
142
165
|
}
|
|
143
166
|
/**
|
|
144
167
|
* Google Gemini LLM Adapter
|