Spaces:
Paused
Paused
Update app.js
Browse files
app.js
CHANGED
|
@@ -175,6 +175,112 @@ const app = express();
|
|
| 175 |
app.use(express.json());
|
| 176 |
app.use(express.urlencoded({ extended: true }));
|
| 177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
// 主要路由处理
|
| 179 |
app.post('/ai/v1/chat/completions', async (req, res) => {
|
| 180 |
// o1开头的模型,不支持流式输出
|
|
|
|
| 175 |
app.use(express.json());
|
| 176 |
app.use(express.urlencoded({ extended: true }));
|
| 177 |
|
| 178 |
+
const modles_list = '{
|
| 179 |
+
"object": "list",
|
| 180 |
+
"data": [
|
| 181 |
+
{
|
| 182 |
+
"id": "cursor-small",
|
| 183 |
+
"object": "model",
|
| 184 |
+
"created": 1610076050,
|
| 185 |
+
"owned_by": "cursor"
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"id": "gpt-4",
|
| 189 |
+
"object": "model",
|
| 190 |
+
"created": 1610076051,
|
| 191 |
+
"owned_by": "openai"
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"id": "claude-3.5-sonnet",
|
| 195 |
+
"object": "model",
|
| 196 |
+
"created": 1610076052,
|
| 197 |
+
"owned_by": "anthropic"
|
| 198 |
+
},
|
| 199 |
+
{
|
| 200 |
+
"id": "gpt-4o",
|
| 201 |
+
"object": "model",
|
| 202 |
+
"created": 1610076053,
|
| 203 |
+
"owned_by": "openai"
|
| 204 |
+
},
|
| 205 |
+
{
|
| 206 |
+
"id": "claude-3-opus",
|
| 207 |
+
"object": "model",
|
| 208 |
+
"created": 1610076054,
|
| 209 |
+
"owned_by": "anthropic"
|
| 210 |
+
},
|
| 211 |
+
{
|
| 212 |
+
"id": "gpt-3.5-turbo",
|
| 213 |
+
"object": "model",
|
| 214 |
+
"created": 1610076055,
|
| 215 |
+
"owned_by": "openai"
|
| 216 |
+
},
|
| 217 |
+
{
|
| 218 |
+
"id": "gpt-4-turbo-2024-04-09",
|
| 219 |
+
"object": "model",
|
| 220 |
+
"created": 1610076056,
|
| 221 |
+
"owned_by": "openai"
|
| 222 |
+
},
|
| 223 |
+
{
|
| 224 |
+
"id": "gpt-4o-128k",
|
| 225 |
+
"object": "model",
|
| 226 |
+
"created": 1610076057,
|
| 227 |
+
"owned_by": "openai"
|
| 228 |
+
},
|
| 229 |
+
{
|
| 230 |
+
"id": "gemini-1.5-flash-500k",
|
| 231 |
+
"object": "model",
|
| 232 |
+
"created": 1610076058,
|
| 233 |
+
"owned_by": "google"
|
| 234 |
+
},
|
| 235 |
+
{
|
| 236 |
+
"id": "claude-3-haiku-200k",
|
| 237 |
+
"object": "model",
|
| 238 |
+
"created": 1610076059,
|
| 239 |
+
"owned_by": "anthropic"
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"id": "claude-3-5-sonnet-200k",
|
| 243 |
+
"object": "model",
|
| 244 |
+
"created": 1610076060,
|
| 245 |
+
"owned_by": "anthropic"
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"id": "claude-3-5-sonnet-20241022",
|
| 249 |
+
"object": "model",
|
| 250 |
+
"created": 1610076061,
|
| 251 |
+
"owned_by": "anthropic"
|
| 252 |
+
},
|
| 253 |
+
{
|
| 254 |
+
"id": "gpt-4o-mini",
|
| 255 |
+
"object": "model",
|
| 256 |
+
"created": 1610076062,
|
| 257 |
+
"owned_by": "openai"
|
| 258 |
+
},
|
| 259 |
+
{
|
| 260 |
+
"id": "o1-mini",
|
| 261 |
+
"object": "model",
|
| 262 |
+
"created": 1610076063,
|
| 263 |
+
"owned_by": "openai"
|
| 264 |
+
},
|
| 265 |
+
{
|
| 266 |
+
"id": "o1-preview",
|
| 267 |
+
"object": "model",
|
| 268 |
+
"created": 1610076064,
|
| 269 |
+
"owned_by": "openai"
|
| 270 |
+
},
|
| 271 |
+
{
|
| 272 |
+
"id": "claude-3.5-haiku",
|
| 273 |
+
"object": "model",
|
| 274 |
+
"created": 1610076065,
|
| 275 |
+
"owned_by": "anthropic"
|
| 276 |
+
}
|
| 277 |
+
]
|
| 278 |
+
}';
|
| 279 |
+
|
| 280 |
+
app.post('/ai/v1/models', async (req, res) => {
|
| 281 |
+
return modles_list;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
// 主要路由处理
|
| 285 |
app.post('/ai/v1/chat/completions', async (req, res) => {
|
| 286 |
// o1开头的模型,不支持流式输出
|