Skip to content

Commit

Permalink
Merge pull request #1 from Yanyutin753/main
Browse files Browse the repository at this point in the history
✨feat support /v1/models to be better to use lobechat
  • Loading branch information
Vinlic authored Apr 24, 2024
2 parents 9a761dc + 34d5453 commit 087773d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Response from '@/lib/response/Response.ts';
import chat from "./chat.ts";
import token from "./token.ts";
import ping from "./ping.ts";
import models from './models.ts';

export default [
{
Expand All @@ -21,5 +22,6 @@ export default [
},
chat,
token,
ping
ping,
models
];
46 changes: 46 additions & 0 deletions src/api/routes/models.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import _ from 'lodash';

export default {

prefix: '/v1',

get: {
'/models': async () => {
return {
"data": [
{
"id": "SparkDesk-v1.1",
"object": "model",
"owned_by": "spark-free-api"
},
{
"id": "SparkDesk-v2.1",
"object": "model",
"owned_by": "spark-free-api"
},
{
"id": "SparkDesk-v3.1",
"object": "model",
"owned_by": "spark-free-api"
},
{
"id": "SparkDesk-v3.5",
"object": "model",
"owned_by": "spark-free-api"
},
{
"id": "SparkDesk-v1",
"object": "model",
"owned_by": "spark-free-api"
},
{
"id": "SparkDesk-v1-vision",
"object": "model",
"owned_by": "spark-free-api"
}
]
};
}

}
}

0 comments on commit 087773d

Please sign in to comment.