From fee72ca188c46ce058deb9a12a1a8bf11716cc0d Mon Sep 17 00:00:00 2001 From: Vinlic Date: Wed, 27 Mar 2024 17:25:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=A0model=E5=80=BC?= =?UTF-8?q?=E6=97=B6=E6=9C=AA=E8=BF=9B=E8=A1=8C=E6=99=BA=E8=83=BD=E4=BD=93?= =?UTF-8?q?ID=E8=AF=86=E5=88=AB=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/routes/images.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/routes/images.ts b/src/api/routes/images.ts index ba67cbf..2118b89 100644 --- a/src/api/routes/images.ts +++ b/src/api/routes/images.ts @@ -18,8 +18,8 @@ export default { const token = _.sample(tokens); const prompt = request.body.prompt; const responseFormat = _.defaultTo(request.body.response_format, "url"); - const model = request.body.model; - const imageUrls = await chat.generateImages(model, prompt, token); + const assistantId = /^[a-z0-9]{24,}$/.test(request.body.model) ? request.body.model : undefined + const imageUrls = await chat.generateImages(assistantId, prompt, token); let data = []; if (responseFormat == "b64_json") { data = (