From 93ce2c2335b2f8cf41b8b2bab24099169ffe3ebe Mon Sep 17 00:00:00 2001 From: Daniel Campagnoli Date: Thu, 5 Dec 2024 18:01:43 +0800 Subject: [PATCH] Revert mock-llm registry to return the same instance --- .../src/app/modules/agents/services/llm.service.spec.ts | 3 +-- src/llm/services/mock-llm.ts | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/modules/agents/services/llm.service.spec.ts b/frontend/src/app/modules/agents/services/llm.service.spec.ts index 745edbda..357911d2 100644 --- a/frontend/src/app/modules/agents/services/llm.service.spec.ts +++ b/frontend/src/app/modules/agents/services/llm.service.spec.ts @@ -1,10 +1,9 @@ import { TestBed } from '@angular/core/testing'; import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { LlmService, LLM } from './llm.service'; -import {environment} from "../../../../environments/environment"; -const LLM_LIST_API_URL = `${environment.apiBaseUrl}llms/list`; +const LLM_LIST_API_URL = `/api/llms/list`; describe('LlmService', () => { let service: LlmService; diff --git a/src/llm/services/mock-llm.ts b/src/llm/services/mock-llm.ts index 41769b21..af16cfcb 100644 --- a/src/llm/services/mock-llm.ts +++ b/src/llm/services/mock-llm.ts @@ -121,14 +121,15 @@ export class MockLLM extends BaseLLM { } } +export const mockLLM = new MockLLM(); + export function mockLLMRegistry(): Record LLM> { return { - 'mock:mock': () => new MockLLM(), + // Tests need the same instance returned + 'mock:mock': () => mockLLM, }; } -export const mockLLM = new MockLLM(); - export function mockLLMs(): AgentLLMs { return { easy: mockLLM,