Skip to content

Commit

Permalink
Revert mock-llm registry to return the same instance
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcampagnolitg committed Dec 5, 2024
1 parent 1124c8c commit 93ce2c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions frontend/src/app/modules/agents/services/llm.service.spec.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
7 changes: 4 additions & 3 deletions src/llm/services/mock-llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,15 @@ export class MockLLM extends BaseLLM {
}
}

export const mockLLM = new MockLLM();

export function mockLLMRegistry(): Record<string, () => 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,
Expand Down

0 comments on commit 93ce2c2

Please sign in to comment.