From f7c1fa7be3c96eeffd07161597648a8e43b20bd2 Mon Sep 17 00:00:00 2001 From: Yanyutin753 <132346501+Yanyutin753@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feat=20support=20/v1/models=20to=20be?= =?UTF-8?q?=20better=20use=20lobechat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/routes/index.ts | 4 +++- src/api/routes/models.ts | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/api/routes/models.ts diff --git a/src/api/routes/index.ts b/src/api/routes/index.ts index 72dc88f..c4dd754 100644 --- a/src/api/routes/index.ts +++ b/src/api/routes/index.ts @@ -4,6 +4,7 @@ import Response from '@/lib/response/Response.ts'; import chat from "./chat.ts"; import ping from "./ping.ts"; import token from './token.ts'; +import models from './models.ts'; export default [ { @@ -21,5 +22,6 @@ export default [ }, chat, ping, - token + token, + models ]; \ No newline at end of file diff --git a/src/api/routes/models.ts b/src/api/routes/models.ts new file mode 100644 index 0000000..2581d2e --- /dev/null +++ b/src/api/routes/models.ts @@ -0,0 +1,41 @@ +import _ from 'lodash'; + +export default { + + prefix: '/v1', + + get: { + '/models': async () => { + return { + "data": [ + { + "id": "moonshot-v1", + "object": "model", + "owned_by": "kimi-free-api" + }, + { + "id": "moonshot-v1-8k", + "object": "model", + "owned_by": "kimi-free-api" + }, + { + "id": "moonshot-v1-32k", + "object": "model", + "owned_by": "kimi-free-api" + }, + { + "id": "moonshot-v1-128k", + "object": "model", + "owned_by": "kimi-free-api" + }, + { + "id": "moonshot-v1-vision", + "object": "model", + "owned_by": "kimi-free-api" + } + ] + }; + } + + } +} \ No newline at end of file