- Add ui/src/api/ollama.ts with ollamaApi.status() and ollamaApi.models() - Replace free-text Model input with hybrid dropdown/fallback in HermesLocalConfigFields - Dropdown shows pulled Ollama models with * prefix for recommended entries - Install callout shown when Ollama is absent (with link to installUrl) - Edit mode: selecting an Ollama model atomically sets model + provider:custom + base_url - Manual entry fallback via "Other (manual entry)..." option or when Ollama absent - Uses useCompany() hook for companyId (consistent with AgentConfigForm pattern)
31 lines
736 B
TypeScript
31 lines
736 B
TypeScript
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`);
|
|
},
|
|
};
|