@lovelymai/agent 1.0.1 → 1.0.3
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/agent.js +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/services/loop.d.ts +25 -1
- package/package.json +1 -1
package/dist/agent.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/services/loop.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type AgentManager = {
|
|
|
16
16
|
/** 环境参数对象 */
|
|
17
17
|
environment: Record<string, any>;
|
|
18
18
|
/** 事件回调 */
|
|
19
|
-
onEvent
|
|
19
|
+
onEvent: ((event: Event) => void) | undefined;
|
|
20
20
|
/** 更新工具 */
|
|
21
21
|
readonly updateTools: (tools: Tool[]) => void;
|
|
22
22
|
/** 开始 */
|
|
@@ -24,4 +24,28 @@ export type AgentManager = {
|
|
|
24
24
|
/** 结束 */
|
|
25
25
|
readonly stop: () => void;
|
|
26
26
|
};
|
|
27
|
+
export type Event = {
|
|
28
|
+
type: 'agent_start';
|
|
29
|
+
} | {
|
|
30
|
+
type: 'turn_start';
|
|
31
|
+
turnCount: number;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'message_update';
|
|
34
|
+
text: {
|
|
35
|
+
content?: string;
|
|
36
|
+
reasoning_content?: string;
|
|
37
|
+
};
|
|
38
|
+
} | {
|
|
39
|
+
type: 'tool_start';
|
|
40
|
+
toolCall: OpenAI.Chat.Completions.ChatCompletionMessageFunctionToolCall;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'tool_end';
|
|
43
|
+
toolCall: OpenAI.Chat.Completions.ChatCompletionMessageFunctionToolCall;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'agent_end';
|
|
46
|
+
turnCount: number;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'agent_error';
|
|
49
|
+
error: unknown;
|
|
50
|
+
};
|
|
27
51
|
export declare const createAgentManager: (client: OpenAI) => AgentManager;
|