@agentxjs/mono-driver 2.0.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/README.md +244 -0
- package/dist/index.d.ts +170 -0
- package/dist/index.js +450 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
- package/src/MonoDriver.ts +444 -0
- package/src/converters.ts +175 -0
- package/src/index.ts +53 -0
- package/src/types.ts +84 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MonoDriver Types
|
|
3
|
+
*
|
|
4
|
+
* MonoDriver = Unified cross-platform Driver
|
|
5
|
+
* - One interface, multiple LLM providers
|
|
6
|
+
* - Powered by Vercel AI SDK
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { DriverConfig } from "@agentxjs/core/driver";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Built-in LLM providers
|
|
13
|
+
*/
|
|
14
|
+
export type MonoBuiltinProvider =
|
|
15
|
+
| "anthropic"
|
|
16
|
+
| "openai"
|
|
17
|
+
| "google"
|
|
18
|
+
| "xai"
|
|
19
|
+
| "deepseek"
|
|
20
|
+
| "mistral";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Supported LLM providers
|
|
24
|
+
*
|
|
25
|
+
* Built-in providers + "openai-compatible" for any OpenAI-compatible API
|
|
26
|
+
* (Kimi, GLM, 豆包, Ollama, LM Studio, etc.)
|
|
27
|
+
*/
|
|
28
|
+
export type MonoProvider = MonoBuiltinProvider | "openai-compatible";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* OpenAI-compatible provider configuration
|
|
32
|
+
*
|
|
33
|
+
* For providers that expose an OpenAI-compatible API:
|
|
34
|
+
* - Kimi (Moonshot AI): baseURL = "https://api.moonshot.cn/v1"
|
|
35
|
+
* - GLM (Zhipu AI): baseURL = "https://open.bigmodel.cn/api/paas/v4"
|
|
36
|
+
* - 豆包 (Volcengine): baseURL = "https://ark.cn-beijing.volces.com/api/v3"
|
|
37
|
+
* - Ollama: baseURL = "http://localhost:11434/v1"
|
|
38
|
+
* - LM Studio: baseURL = "http://localhost:1234/v1"
|
|
39
|
+
*/
|
|
40
|
+
export interface OpenAICompatibleConfig {
|
|
41
|
+
/**
|
|
42
|
+
* Provider name (for logging and identification)
|
|
43
|
+
*/
|
|
44
|
+
name: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Base URL of the OpenAI-compatible API
|
|
48
|
+
*/
|
|
49
|
+
baseURL: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* API key
|
|
53
|
+
*/
|
|
54
|
+
apiKey?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* MonoDriver-specific options
|
|
59
|
+
*/
|
|
60
|
+
export interface MonoDriverOptions {
|
|
61
|
+
/**
|
|
62
|
+
* LLM Provider
|
|
63
|
+
* @default 'anthropic'
|
|
64
|
+
*/
|
|
65
|
+
provider?: MonoProvider;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Max agentic steps for tool calling
|
|
69
|
+
* @default 10
|
|
70
|
+
*/
|
|
71
|
+
maxSteps?: number;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Configuration for openai-compatible provider
|
|
75
|
+
*
|
|
76
|
+
* Required when provider is "openai-compatible"
|
|
77
|
+
*/
|
|
78
|
+
compatibleConfig?: OpenAICompatibleConfig;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* MonoDriverConfig - DriverConfig with MonoDriverOptions
|
|
83
|
+
*/
|
|
84
|
+
export type MonoDriverConfig = DriverConfig<MonoDriverOptions>;
|