@blueking/chat-helper 0.0.12-beta.13 → 0.0.12-beta.14
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 +8 -2
- package/dist/agent/type.d.ts +69 -0
- package/dist/agent/type.ts.js +1 -1
- package/dist/agent/use-agent.d.ts +515 -357
- package/dist/agent/use-agent.ts.js +50 -11
- package/dist/event/ag-ui.d.ts +2 -0
- package/dist/event/ag-ui.ts.js +34 -3
- package/dist/event/type.d.ts +14 -3
- package/dist/event/type.ts.js +2 -0
- package/dist/http/fetch/fetch.ts.js +80 -16
- package/dist/http/index.d.ts +4 -2
- package/dist/http/module/agent.d.ts +2 -0
- package/dist/http/module/agent.ts.js +19 -2
- package/dist/http/module/index.d.ts +4 -2
- package/dist/http/module/message.d.ts +2 -2
- package/dist/http/module/session.d.ts +2 -1
- package/dist/http/module/session.ts.js +19 -0
- package/dist/http/transform/agent.d.ts +9 -1
- package/dist/http/transform/agent.ts.js +27 -0
- package/dist/http/transform/message.ts.js +4 -0
- package/dist/index.d.ts +3536 -2751
- package/dist/message/type.d.ts +18 -3
- package/dist/message/type.ts.js +2 -0
- package/dist/message/use-message.d.ts +593 -385
- package/dist/session/type.d.ts +14 -0
- package/dist/session/use-session.d.ts +2341 -1924
- package/dist/session/use-session.ts.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1885,13 +1885,19 @@ A: 使用 `agent.chat` 的 `url` 和 `config` 参数:
|
|
|
1885
1885
|
// 使用不同的端点
|
|
1886
1886
|
agent.chat(userInput, sessionCode, 'custom_chat/');
|
|
1887
1887
|
|
|
1888
|
-
//
|
|
1888
|
+
// 添加自定义请求参数(如 temperature)
|
|
1889
1889
|
agent.chat(userInput, sessionCode, undefined, {
|
|
1890
1890
|
data: {
|
|
1891
1891
|
temperature: 0.8,
|
|
1892
|
-
model: 'gpt-4',
|
|
1893
1892
|
},
|
|
1894
1893
|
});
|
|
1894
|
+
|
|
1895
|
+
// 模型热切换:传入第 6 个参数 model(值为 llm_code,需在 GET llms/ 列表内)
|
|
1896
|
+
agent.chat(userInput, sessionCode, undefined, undefined, property, 'hy3-preview');
|
|
1897
|
+
|
|
1898
|
+
// 拉取可用模型列表
|
|
1899
|
+
const llmList = await agent.getLlms({ llm_type: 'chat.completion' });
|
|
1900
|
+
// agent.models 同步更新
|
|
1895
1901
|
```
|
|
1896
1902
|
|
|
1897
1903
|
### Q: 消息列表如何实现自动滚动到底部?
|
package/dist/agent/type.d.ts
CHANGED
|
@@ -126,3 +126,72 @@ export interface IAgentResources {
|
|
|
126
126
|
mcp?: IAgentResourceItem[];
|
|
127
127
|
tool?: IAgentResourceItem[];
|
|
128
128
|
}
|
|
129
|
+
/** 模型能力属性(后端 property 字段) */
|
|
130
|
+
export interface ILlmProperty {
|
|
131
|
+
agent_type?: string;
|
|
132
|
+
default?: boolean;
|
|
133
|
+
is_self_host?: boolean;
|
|
134
|
+
max_model_len?: number;
|
|
135
|
+
support_summary?: boolean;
|
|
136
|
+
support_thinking?: boolean;
|
|
137
|
+
support_thinking_quick?: boolean;
|
|
138
|
+
support_tools?: boolean;
|
|
139
|
+
support_vision?: boolean;
|
|
140
|
+
support_window?: boolean;
|
|
141
|
+
}
|
|
142
|
+
/** 可用模型列表查询参数 */
|
|
143
|
+
export interface ILlmListQuery {
|
|
144
|
+
/** 模糊搜索关键词,按 llm_name / description / base_model 匹配 */
|
|
145
|
+
fuzzy?: string;
|
|
146
|
+
/** 模型类型,不传时默认 chat.completion */
|
|
147
|
+
llm_type?: string;
|
|
148
|
+
/** 按模型支持的功能过滤,逗号分隔,如 tool_call,vision */
|
|
149
|
+
supports?: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 可用模型项(对齐 plugin_api/llms/ 与 chat-x IModelOption)
|
|
153
|
+
* 字段以 snake_case 与后端保持一致,便于直接透传给 ModelSelector
|
|
154
|
+
*/
|
|
155
|
+
export interface ILlmItem {
|
|
156
|
+
/** 基础模型标识,如 hunyuan */
|
|
157
|
+
base_model?: string;
|
|
158
|
+
/** 模型描述 */
|
|
159
|
+
description?: string;
|
|
160
|
+
/** 是否禁用(前端扩展字段) */
|
|
161
|
+
disabled?: boolean;
|
|
162
|
+
/** 模型图标地址 */
|
|
163
|
+
icon?: string;
|
|
164
|
+
/** 模型主键 id */
|
|
165
|
+
id: number;
|
|
166
|
+
/** 模型编码(chat_completion 热切换传此值) */
|
|
167
|
+
llm_code: string;
|
|
168
|
+
/** 模型展示名(ModelSelector v-model 选中值) */
|
|
169
|
+
llm_name: string;
|
|
170
|
+
/** 模型类型,如 chat.completion */
|
|
171
|
+
llm_type: string;
|
|
172
|
+
/** 最大 token 数 */
|
|
173
|
+
max_token_size: number;
|
|
174
|
+
/** 模型能力属性 */
|
|
175
|
+
property: ILlmProperty;
|
|
176
|
+
/** 空间维度鉴权模式 */
|
|
177
|
+
space_auth_mode: string;
|
|
178
|
+
/** 标签名列表 */
|
|
179
|
+
tag_names?: string[];
|
|
180
|
+
/** 用户维度鉴权模式 */
|
|
181
|
+
user_auth_mode: string;
|
|
182
|
+
}
|
|
183
|
+
/** 后端 llms/ 原始响应项(字段可能缺省) */
|
|
184
|
+
export interface ILlmItemApi {
|
|
185
|
+
base_model?: string;
|
|
186
|
+
description?: string;
|
|
187
|
+
icon?: string;
|
|
188
|
+
id?: number;
|
|
189
|
+
llm_code: string;
|
|
190
|
+
llm_name: string;
|
|
191
|
+
llm_type?: string;
|
|
192
|
+
max_token_size?: number;
|
|
193
|
+
property?: ILlmProperty | null;
|
|
194
|
+
space_auth_mode?: string;
|
|
195
|
+
tag_names?: string[];
|
|
196
|
+
user_auth_mode?: string;
|
|
197
|
+
}
|
package/dist/agent/type.ts.js
CHANGED
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
|
-
*/ /**
|
|
25
|
+
*/ /** 后端 llms/ 原始响应项(字段可能缺省) */ export { };
|