| 29 | export type Method = z.infer<typeof Method> |
| 30 | |
| 31 | export async function methods() { |
| 32 | const s = await state().then((x) => x.methods) |
| 33 | const result = mapValues(s, (x) => |
| 34 | x.methods.map( |
| 35 | (y): Method => ({ |
| 36 | type: y.type, |
| 37 | label: y.label, |
| 38 | }), |
| 39 | ), |
| 40 | ) |
| 41 | // Add ollama as a special local provider with custom connect flow |
| 42 | result["ollama"] = [ |
| 43 | { |
| 44 | type: "api", |
| 45 | label: "Connect to local instance", |
| 46 | }, |
| 47 | ] |
| 48 | result["minimax"] = [ |
| 49 | { |
| 50 | type: "api", |
| 51 | label: "API Key", |
| 52 | }, |
| 53 | ] |
| 54 | result["minimax-coding-plan"] = [ |
| 55 | { |
| 56 | type: "api", |
| 57 | label: "API Key", |
| 58 | }, |
| 59 | ] |
| 60 | return result |
| 61 | } |
| 62 | |
| 63 | export const Authorization = z |
| 64 | .object({ |