@meetopenbot/openbot 0.1.8 → 0.1.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/context.js +2 -0
- package/dist/credits-auth.d.ts +1 -1
- package/dist/credits-auth.js +2 -0
- package/dist/model-registry.js +3 -1
- package/dist/model.js +15 -5
- package/dist/runtime.js +10 -3
- package/package.json +1 -2
package/dist/context.js
CHANGED
|
@@ -16,6 +16,8 @@ export const getContextBudgetForModel = (modelString) => {
|
|
|
16
16
|
'anthropic/claude-3-opus-20240229': 200000,
|
|
17
17
|
'anthropic/claude-3-sonnet-20240229': 200000,
|
|
18
18
|
'anthropic/claude-3-haiku-20240307': 200000,
|
|
19
|
+
'deepseek/deepseek-chat': 64000,
|
|
20
|
+
'deepseek/deepseek-reasoner': 64000,
|
|
19
21
|
};
|
|
20
22
|
return budgets[modelString] || DEFAULT_CONTEXT_BUDGET;
|
|
21
23
|
};
|
package/dist/credits-auth.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface CreditsAuthConfig {
|
|
|
5
5
|
baseUrl: string;
|
|
6
6
|
token: string;
|
|
7
7
|
}
|
|
8
|
-
export type CreditsProviderId = 'openai' | 'anthropic';
|
|
8
|
+
export type CreditsProviderId = 'openai' | 'anthropic' | 'google' | 'deepseek';
|
|
9
9
|
/** Cloud host injects these when routing LLM calls through OpenBot Credits. */
|
|
10
10
|
export declare function resolveCreditsAuthConfig(): CreditsAuthConfig | undefined;
|
|
11
11
|
export declare function creditsProviderBaseUrl(config: CreditsAuthConfig, provider: CreditsProviderId): string;
|
package/dist/credits-auth.js
CHANGED
|
@@ -4,6 +4,8 @@ export const CREDITS_API_KEY_PLACEHOLDER = 'openbot-credits';
|
|
|
4
4
|
const CREDITS_PROVIDER_PATHS = {
|
|
5
5
|
openai: 'openai/v1',
|
|
6
6
|
anthropic: 'anthropic/v1',
|
|
7
|
+
google: 'google/v1',
|
|
8
|
+
deepseek: 'deepseek/v1',
|
|
7
9
|
};
|
|
8
10
|
/** Cloud host injects these when routing LLM calls through OpenBot Credits. */
|
|
9
11
|
export function resolveCreditsAuthConfig() {
|
package/dist/model-registry.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
const DEFAULT_REGISTRY_URL = 'https://raw.githubusercontent.com/meetopenbot/openbot-registry/main/registry.json';
|
|
2
|
-
const API_KEY_PROVIDER_IDS = ['openai', 'anthropic', 'google'];
|
|
2
|
+
const API_KEY_PROVIDER_IDS = ['openai', 'anthropic', 'google', 'deepseek'];
|
|
3
3
|
export const PROVIDER_API_KEY_LINKS = {
|
|
4
4
|
openai: 'https://platform.openai.com/api-keys',
|
|
5
5
|
anthropic: 'https://console.anthropic.com/settings/keys',
|
|
6
6
|
google: 'https://aistudio.google.com/app/apikey',
|
|
7
|
+
deepseek: 'https://platform.deepseek.com/api_keys',
|
|
7
8
|
};
|
|
8
9
|
const FALLBACK_PROVIDERS = [
|
|
9
10
|
{ id: 'openai', label: 'OpenAI' },
|
|
10
11
|
{ id: 'anthropic', label: 'Anthropic' },
|
|
11
12
|
{ id: 'google', label: 'Google' },
|
|
13
|
+
{ id: 'deepseek', label: 'DeepSeek' },
|
|
12
14
|
];
|
|
13
15
|
let cachedRegistry;
|
|
14
16
|
export async function fetchModelRegistry() {
|
package/dist/model.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { createOpenAI, openai as defaultOpenai } from '@ai-sdk/openai';
|
|
2
2
|
import { createAnthropic, anthropic } from '@ai-sdk/anthropic';
|
|
3
|
-
import { google } from '@ai-sdk/google';
|
|
4
3
|
import { CREDITS_API_KEY_PLACEHOLDER, INTEGRATIONS_TOKEN_HEADER, creditsProviderBaseUrl, resolveCreditsAuthConfig, shouldUseCreditsAuth, } from './credits-auth.js';
|
|
4
|
+
const defaultDeepseek = createOpenAI({
|
|
5
|
+
baseURL: 'https://api.deepseek.com',
|
|
6
|
+
apiKey: process.env.DEEPSEEK_API_KEY,
|
|
7
|
+
});
|
|
8
|
+
const defaultGoogle = createOpenAI({
|
|
9
|
+
baseURL: 'https://generativelanguage.googleapis.com/v1beta/openai',
|
|
10
|
+
apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY,
|
|
11
|
+
});
|
|
5
12
|
function resolveCreditsProvider(provider, modelId) {
|
|
6
13
|
const config = resolveCreditsAuthConfig();
|
|
7
14
|
if (!config) {
|
|
@@ -16,6 +23,10 @@ function resolveCreditsProvider(provider, modelId) {
|
|
|
16
23
|
return createOpenAI({ baseURL, apiKey, headers })(modelId);
|
|
17
24
|
case 'anthropic':
|
|
18
25
|
return createAnthropic({ baseURL, apiKey, headers })(modelId);
|
|
26
|
+
case 'google':
|
|
27
|
+
return createOpenAI({ baseURL, apiKey, headers })(modelId);
|
|
28
|
+
case 'deepseek':
|
|
29
|
+
return createOpenAI({ baseURL, apiKey, headers })(modelId);
|
|
19
30
|
}
|
|
20
31
|
}
|
|
21
32
|
export function resolveModel(modelString, options) {
|
|
@@ -31,10 +42,9 @@ export function resolveModel(modelString, options) {
|
|
|
31
42
|
case 'anthropic':
|
|
32
43
|
return useCredits ? resolveCreditsProvider('anthropic', modelId) : anthropic(modelId);
|
|
33
44
|
case 'google':
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return google(modelId);
|
|
45
|
+
return useCredits ? resolveCreditsProvider('google', modelId) : defaultGoogle(modelId);
|
|
46
|
+
case 'deepseek':
|
|
47
|
+
return useCredits ? resolveCreditsProvider('deepseek', modelId) : defaultDeepseek(modelId);
|
|
38
48
|
default:
|
|
39
49
|
throw new Error(`Unsupported AI provider: "${provider}"`);
|
|
40
50
|
}
|
package/dist/runtime.js
CHANGED
|
@@ -313,7 +313,9 @@ export const openbotRuntime = (options) => (builder) => {
|
|
|
313
313
|
? 'gpt-4o-mini'
|
|
314
314
|
: provider === 'anthropic'
|
|
315
315
|
? 'claude-3-5-sonnet-20241022'
|
|
316
|
-
: '
|
|
316
|
+
: provider === 'deepseek'
|
|
317
|
+
? 'deepseek-chat'
|
|
318
|
+
: 'gemini-2.0-flash',
|
|
317
319
|
required: true,
|
|
318
320
|
defaultValue: currentModelId || '',
|
|
319
321
|
},
|
|
@@ -395,7 +397,10 @@ export const openbotRuntime = (options) => (builder) => {
|
|
|
395
397
|
if (!modelId)
|
|
396
398
|
return;
|
|
397
399
|
const apiKey = String(values.apiKey);
|
|
398
|
-
if (provider !== 'openai' &&
|
|
400
|
+
if (provider !== 'openai' &&
|
|
401
|
+
provider !== 'anthropic' &&
|
|
402
|
+
provider !== 'google' &&
|
|
403
|
+
provider !== 'deepseek') {
|
|
399
404
|
yield {
|
|
400
405
|
type: 'agent:output',
|
|
401
406
|
data: { content: `Unsupported provider: ${provider}` },
|
|
@@ -407,7 +412,9 @@ export const openbotRuntime = (options) => (builder) => {
|
|
|
407
412
|
? 'OPENAI_API_KEY'
|
|
408
413
|
: provider === 'anthropic'
|
|
409
414
|
? 'ANTHROPIC_API_KEY'
|
|
410
|
-
: '
|
|
415
|
+
: provider === 'deepseek'
|
|
416
|
+
? 'DEEPSEEK_API_KEY'
|
|
417
|
+
: 'GOOGLE_GENERATIVE_AI_API_KEY';
|
|
411
418
|
const newModelString = `${provider}/${modelId}`;
|
|
412
419
|
if (!storage)
|
|
413
420
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meetopenbot/openbot",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Monolithic OpenBot agent runtime with batteries-included tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@ai-sdk/anthropic": "^3.0.33",
|
|
22
|
-
"@ai-sdk/google": "^3.0.82",
|
|
23
22
|
"@ai-sdk/openai": "^3.0.13",
|
|
24
23
|
"@meetopenbot/plugin-sdk": "^0.1.6",
|
|
25
24
|
"ai": "^6.0.42",
|