/
githubmirror
/
Open-Assistant
Обзор
Документация
Войти
/
githubmirror
/
Open-Assistant
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
website/src/pages/api/chat/plugin_config.ts
16 строк
506 B
Dragan Jovanović
Basic implementation of an plugin system for OA (#2765)
02 май 2023, 11:21
Не верифицирован
02 май 2023, 11:21
c871915
Код
Авторство
О чём код?
import { withoutRole } from "src/lib/auth"; import { createInferenceClient } from "src/lib/oasst_inference_client"; import { PluginEntry } from "src/types/Chat"; const handler = withoutRole("banned", async (req, res, token) => { const client = createInferenceClient(token); const { plugin } = req.body as { plugin: PluginEntry }; const data = await client.get_plugin_config({ plugin }); if (data) { return res.status(200).json(data); } res.status(400).end(); }); export default handler;