(aiDataDir: string, assistantId: string)
| 10 | import type { AssistantConfig } from '@openchatlab/node-runtime' |
| 11 | |
| 12 | export function loadAssistantConfig(aiDataDir: string, assistantId: string): AssistantConfig | null { |
| 13 | const filePath = path.join(aiDataDir, 'assistants', `${assistantId}.md`) |
| 14 | if (!fs.existsSync(filePath)) return null |
| 15 | |
| 16 | try { |
| 17 | const content = fs.readFileSync(filePath, 'utf-8') |
| 18 | return parseAssistantFile(content, filePath) |
| 19 | } catch { |
| 20 | return null |
| 21 | } |
| 22 | } |
no test coverage detected