From d7be4a043ef2e7b64773b482e6ca3ae34d15422d Mon Sep 17 00:00:00 2001 From: Yanyutin753 <132346501+Yanyutin753@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:43:01 +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 | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 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 6ecd2fa..16738dd 100644 --- a/src/api/routes/index.ts +++ b/src/api/routes/index.ts @@ -5,6 +5,7 @@ import chat from "./chat.ts"; import images from "./images.ts"; import ping from "./ping.ts"; import token from './token.js'; +import models from './models.ts'; export default [ { @@ -23,5 +24,6 @@ export default [ chat, images, 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..6dd3be5 --- /dev/null +++ b/src/api/routes/models.ts @@ -0,0 +1,45 @@ +import _ from 'lodash'; + +export default { + + prefix: '/v1', + + get: { + '/models': async () => { + return { + "data": [ + { + "id": "concise", + "object": "model", + "owned_by": "metaso-free-api" + }, + { + "id": "detail", + "object": "model", + "owned_by": "metaso-free-api" + }, + { + "id": "research", + "object": "model", + "owned_by": "metaso-free-api" + }, + { + "id": "concise-scholar", + "object": "model", + "owned_by": "metaso-free-api" + }, + { + "id": "detail-scholar", + "object": "model", + "owned_by": "metaso-free-api" + }, + { + "id": "research-scholar", + "object": "model", + "owned_by": "metaso-free-api" + } + ] + }; + } + } +} \ No newline at end of file