agent-tool-chat 1.1.5 → 1.2.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 +33 -0
- package/dist/agent-core/types.d.ts +6 -0
- package/dist/agent-tool-chat.css +1 -1
- package/dist/api/openai-compatible.d.ts +11 -0
- package/dist/api/openai.d.ts +2 -0
- package/dist/api/provider-registry.d.ts +8 -0
- package/dist/composables/useAgentChat.d.ts +18 -14
- package/dist/config.d.ts +11 -4
- package/dist/index.cjs +29 -30
- package/dist/index.d.ts +7 -2
- package/dist/index.js +3280 -3052
- package/dist/types.d.ts +58 -9
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -86,23 +86,70 @@ export interface ToolResult {
|
|
|
86
86
|
success: boolean;
|
|
87
87
|
status: 'running' | 'success' | 'error';
|
|
88
88
|
}
|
|
89
|
-
export interface
|
|
89
|
+
export interface ProviderModelOption {
|
|
90
|
+
label: string;
|
|
91
|
+
value: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ProviderCapabilities {
|
|
94
|
+
/** 是否支持温度参数,默认 true */
|
|
95
|
+
temperature?: boolean;
|
|
96
|
+
/** 是否显示思考模式开关 */
|
|
97
|
+
thinking?: boolean;
|
|
98
|
+
/** 是否显示思考强度选择 */
|
|
99
|
+
reasoningEffort?: boolean;
|
|
100
|
+
/** 是否支持工具调用,默认 true */
|
|
101
|
+
tools?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface ProviderPreset {
|
|
104
|
+
id: string;
|
|
105
|
+
name: string;
|
|
106
|
+
protocol: 'openai-compatible';
|
|
107
|
+
defaultBaseUrl: string;
|
|
108
|
+
defaultModel: string;
|
|
109
|
+
models: ProviderModelOption[];
|
|
110
|
+
/** 允许手动输入模型名,默认 true */
|
|
111
|
+
allowCustomModel?: boolean;
|
|
112
|
+
apiKeyUrl?: string;
|
|
113
|
+
capabilities: ProviderCapabilities;
|
|
114
|
+
/** 提供方私有请求字段注入,如 DeepSeek 的 thinking */
|
|
115
|
+
buildBody?: (body: Record<string, any>, config: LLMProviderConfig) => void;
|
|
116
|
+
/** 自定义鉴权头,默认 Bearer */
|
|
117
|
+
buildHeaders?: (apiKey: string) => Record<string, string>;
|
|
118
|
+
}
|
|
119
|
+
export interface ProviderSettings {
|
|
90
120
|
apiKey: string;
|
|
91
121
|
baseUrl: string;
|
|
92
122
|
model: string;
|
|
93
123
|
temperature: number;
|
|
94
|
-
|
|
124
|
+
thinking: boolean;
|
|
125
|
+
thinkingEffort: 'low' | 'high' | 'max';
|
|
126
|
+
}
|
|
127
|
+
export interface ChatSettings {
|
|
128
|
+
/** 当前模型提供方 ID */
|
|
129
|
+
providerId: string;
|
|
95
130
|
providerMode: 'direct' | 'proxy';
|
|
96
131
|
proxyUrl: string;
|
|
97
|
-
/**
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
thinkingEffort?: 'low' | 'high' | 'max';
|
|
101
|
-
/** md 内容表格行点击选择(触发"我选择 X"回灌对话),默认关闭 */
|
|
132
|
+
/** 各提供方独立配置 */
|
|
133
|
+
providers: Record<string, ProviderSettings>;
|
|
134
|
+
/** md 内容表格行点击选择(触发"我选择 X"回灌对话),默认开启 */
|
|
102
135
|
mdTableClick?: boolean;
|
|
103
|
-
/** md
|
|
136
|
+
/** md 内容列表项点击执行,默认开启 */
|
|
104
137
|
mdListClick?: boolean;
|
|
138
|
+
useTools?: boolean;
|
|
139
|
+
/** @deprecated 兼容旧代码,始终镜像当前 provider 的值 */
|
|
140
|
+
apiKey?: string;
|
|
141
|
+
/** @deprecated 兼容旧代码,始终镜像当前 provider 的值 */
|
|
142
|
+
baseUrl?: string;
|
|
143
|
+
/** @deprecated 兼容旧代码,始终镜像当前 provider 的值 */
|
|
144
|
+
model?: string;
|
|
145
|
+
/** @deprecated 兼容旧代码,始终镜像当前 provider 的值 */
|
|
146
|
+
temperature?: number;
|
|
147
|
+
/** @deprecated 兼容旧代码,始终镜像当前 provider 的值 */
|
|
148
|
+
thinking?: boolean;
|
|
149
|
+
/** @deprecated 兼容旧代码,始终镜像当前 provider 的值 */
|
|
150
|
+
thinkingEffort?: 'low' | 'high' | 'max';
|
|
105
151
|
}
|
|
152
|
+
export declare const DEFAULT_PROVIDER_SETTINGS: Record<string, ProviderSettings>;
|
|
106
153
|
export declare const DEFAULT_SETTINGS: ChatSettings;
|
|
107
154
|
export interface ChatCommand {
|
|
108
155
|
label: string;
|
|
@@ -113,8 +160,10 @@ export interface AgentChatOptions {
|
|
|
113
160
|
onToolCall?: (call: ToolCallEvent) => Promise<any>;
|
|
114
161
|
provider?: any;
|
|
115
162
|
providerConfig?: Partial<LLMProviderConfig>;
|
|
116
|
-
/**
|
|
163
|
+
/** 初始设置项:作为默认值,localStorage 中已保存的设置按字段覆盖 */
|
|
117
164
|
settings?: Partial<ChatSettings>;
|
|
165
|
+
/** 扩展模型提供方预设(OpenAI 兼容协议) */
|
|
166
|
+
providerPresets?: ProviderPreset[];
|
|
118
167
|
systemPrompt?: string;
|
|
119
168
|
storagePrefix?: string;
|
|
120
169
|
/** 上传的文件数据是否发给 LLM,默认 false(仅前端展示) */
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "agent-tool-chat",
|
|
3
3
|
"description": "An agent-driven chat plugin with ToolPackage architecture and host-controlled execution",
|
|
4
4
|
"author": "kangjinrui <1092014304@qq.com>",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
8
8
|
"type": "module",
|