Skip to content

Commit fc1ed4a

Browse files
authored
♻️ refactor: refactor agent runtime to better code format (lobehub#6284)
* refactor agent runtime * update * update * fix * fix tests * refactor runtime method name
1 parent cb26cde commit fc1ed4a

File tree

9 files changed

+213
-619
lines changed

9 files changed

+213
-619
lines changed

src/app/(backend)/webapi/chat/[provider]/route.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('POST handler', () => {
7171

7272
// migrate to new AgentRuntime init api
7373
const spy = vi
74-
.spyOn(AgentRuntime, 'initializeWithProviderOptions')
74+
.spyOn(AgentRuntime, 'initializeWithProvider')
7575
.mockResolvedValue(new AgentRuntime(mockRuntime));
7676

7777
// 调用 POST 函数
@@ -117,7 +117,7 @@ describe('POST handler', () => {
117117

118118
const mockRuntime: LobeRuntimeAI = { baseURL: 'abc', chat: vi.fn() };
119119

120-
vi.spyOn(AgentRuntime, 'initializeWithProviderOptions').mockResolvedValue(
120+
vi.spyOn(AgentRuntime, 'initializeWithProvider').mockResolvedValue(
121121
new AgentRuntime(mockRuntime),
122122
);
123123

0 commit comments

Comments
 (0)