Download desktop/src/api/models.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 805 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/models.ts
- Command line
-
hf download hf://chenbhao/codev@e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/models.ts
-
curl -L -o models.ts https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/models.ts
805 Bytes
| import { api } from './client' | |
| import type { ModelInfo, EffortLevel } from '../types/settings' | |
| type ModelsResponse = { models: ModelInfo[]; provider: { id: string; name: string } | null } | |
| type CurrentModelResponse = { model: ModelInfo } | |
| type EffortResponse = { level: EffortLevel; available: EffortLevel[] } | |
| export const modelsApi = { | |
| list() { | |
| return api.get<ModelsResponse>('/api/models') | |
| }, | |
| getCurrent() { | |
| return api.get<CurrentModelResponse>('/api/models/current') | |
| }, | |
| setCurrent(modelId: string) { | |
| return api.put<{ ok: true; model: string }>('/api/models/current', { modelId }) | |
| }, | |
| getEffort() { | |
| return api.get<EffortResponse>('/api/effort') | |
| }, | |
| setEffort(level: EffortLevel) { | |
| return api.put<{ ok: true; level: EffortLevel }>('/api/effort', { level }) | |
| }, | |
| } | |