@opentiny/next-remoter 0.4.0 → 0.4.2
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/components/TinyRobotChat.vue.d.ts +24 -24
- package/dist/composable/useBuiltinMcpServer.d.ts +5 -5
- package/dist/index.d.ts +1 -2
- package/dist/next-remoter-runtime.es.js +156928 -179957
- package/dist/next-remoter.cjs.js +48 -48
- package/dist/next-remoter.css +1 -1
- package/dist/next-remoter.es.js +9305 -9061
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/composable/useNextAgent.d.ts +0 -54
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/next-remoter",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://docs.opentiny.design/next-sdk/guide/tiny-robot-remoter.html",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@ai-sdk/openai": "^3.0.0",
|
|
49
49
|
"@ai-sdk/provider": "^3.0.0",
|
|
50
50
|
"@ai-sdk/provider-utils": "^4.0.14",
|
|
51
|
-
"@opentiny/next-sdk": "0.4.
|
|
51
|
+
"@opentiny/next-sdk": "0.4.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@opentiny/unplugin-tiny-vue": "^1.0.0",
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { IAgentModelProviderOption, AgentModelProvider } from '@opentiny/next-sdk';
|
|
2
|
-
import { Ref } from 'vue';
|
|
3
|
-
|
|
4
|
-
export type INextAgetOption = {
|
|
5
|
-
/** 设置适配哪种UI框架,以便返回正确格式的message */
|
|
6
|
-
ui?: 'matechat' | 'antdx' | 'elplusx' | 'tdchat';
|
|
7
|
-
/** 代理的后台地址,比如:'https://agent.opentiny.design/api/v1/webmcp-trial/',若私有化部署,请填入私有化地址。 */
|
|
8
|
-
agentRoot: string;
|
|
9
|
-
/** 初始的受控应用的会话id, 如果多个应用,需要使用英文逗号分隔 */
|
|
10
|
-
sessionId?: string;
|
|
11
|
-
/** 访问 llm 时,预置的系统提示词 */
|
|
12
|
-
systemPrompt?: string;
|
|
13
|
-
/** 大语言模型 的 modelId, 比如:'deepseek-ai/DeepSeek-V3' */
|
|
14
|
-
model: string;
|
|
15
|
-
/** 一次对话中的最大步数(模型-工具循环),默认 30 */
|
|
16
|
-
maxSteps?: number;
|
|
17
|
-
/** 自定义流数据处理函数,将 llm 返回的流数据,按自定义的格式,保存到messages 数组中。
|
|
18
|
-
* 如果设置,则代替内部默认的流处理函数。
|
|
19
|
-
*/
|
|
20
|
-
processStream?: (stream: ReadableStream<string>, messages: Ref<any[]>, senderContent: string) => Promise<void>;
|
|
21
|
-
llmConfig: IAgentModelProviderOption['llmConfig'];
|
|
22
|
-
};
|
|
23
|
-
/** 快速实现Opentiny Next遥控器的智能体
|
|
24
|
-
*
|
|
25
|
-
* @summary
|
|
26
|
-
* 引用 next-sdk 中的 AgentModelProvider 类,实现 llm 的对话,以及添加受控应用。
|
|
27
|
-
* 在一次对话中,实现应用的tool调用,从而达到操控网页的能力。
|
|
28
|
-
*/
|
|
29
|
-
export declare function useNextAgent(option: INextAgetOption): {
|
|
30
|
-
/** 一个AgentModelProvider实例 */
|
|
31
|
-
agent: AgentModelProvider;
|
|
32
|
-
/** agent的实时状态 */
|
|
33
|
-
status: Ref<"error" | "ready" | "submitted" | "streaming", "error" | "ready" | "submitted" | "streaming">;
|
|
34
|
-
/** 聊天会话记录 */
|
|
35
|
-
messages: Ref<never[], never[]>;
|
|
36
|
-
/** 输入框的文本 */
|
|
37
|
-
inputValue: Ref<string, string>;
|
|
38
|
-
/** 发起流式对话函数 */
|
|
39
|
-
chatStream: () => Promise<void>;
|
|
40
|
-
/** 中断会话函数 */
|
|
41
|
-
stopChat: () => void;
|
|
42
|
-
/** 新建会话函数 */
|
|
43
|
-
newConversation: () => void;
|
|
44
|
-
/** 添加一个sessionId的函数,允许是短码 */
|
|
45
|
-
addSessionId: (sid: string) => Promise<void>;
|
|
46
|
-
};
|
|
47
|
-
export interface TdChatMessage {
|
|
48
|
-
avatar?: string;
|
|
49
|
-
name?: string;
|
|
50
|
-
role?: string;
|
|
51
|
-
datetime?: string;
|
|
52
|
-
content?: string;
|
|
53
|
-
reasoning?: string;
|
|
54
|
-
}
|