import { api } from "./client";

export interface OllamaStatus {
  installed: boolean;
  version: string | null;
  installUrl: string;
}

export interface OllamaModel {
  name: string;
  parameterSize: string;
  quantization: string;
  sizeBytes: number;
  family: string;
  recommended: boolean;
  recommendationReason: string | null;
}

export interface OllamaModelsResponse {
  models: OllamaModel[];
  ramGb: number;
}

export const ollamaApi = {
  status(companyId: string): Promise<OllamaStatus> {
    return api.get<OllamaStatus>(`/companies/${companyId}/ollama/status`);
  },
  models(companyId: string): Promise<OllamaModelsResponse> {
    return api.get<OllamaModelsResponse>(`/companies/${companyId}/ollama/models`);
  },
};
