feat(#127): refactor LlmService to use provider pattern
Refactor LlmService to delegate to LlmManagerService instead of using Ollama directly. This enables multiple provider support and user-specific provider configuration. Changes: - Remove direct Ollama client from LlmService - Delegate all LLM operations to provider via LlmManagerService - Update health status to use provider-agnostic interface - Add PrismaModule to LlmModule for manager service - Maintain backward compatibility with existing API - Achieve 89.74% test coverage Fixes #127 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import { Controller, Post, Get, Body, Res, HttpCode, HttpStatus } from "@nestjs/common";
|
||||
import { Response } from "express";
|
||||
import { LlmService, OllamaHealthStatus } from "./llm.service";
|
||||
import { LlmService } from "./llm.service";
|
||||
import { ChatRequestDto, ChatResponseDto, EmbedRequestDto, EmbedResponseDto } from "./dto";
|
||||
import type { LlmProviderHealthStatus } from "./providers/llm-provider.interface";
|
||||
|
||||
@Controller("llm")
|
||||
export class LlmController {
|
||||
constructor(private readonly llmService: LlmService) {}
|
||||
@Get("health") async health(): Promise<OllamaHealthStatus> {
|
||||
|
||||
@Get("health")
|
||||
async health(): Promise<LlmProviderHealthStatus> {
|
||||
return this.llmService.checkHealth();
|
||||
}
|
||||
@Get("models") async listModels(): Promise<{ models: string[] }> {
|
||||
|
||||
Reference in New Issue
Block a user