修复传model值时未进行智能体ID识别处理

This commit is contained in:
Vinlic 2024-03-27 17:25:47 +08:00
parent e2cf522844
commit fee72ca188

View File

@ -18,8 +18,8 @@ export default {
const token = _.sample(tokens); const token = _.sample(tokens);
const prompt = request.body.prompt; const prompt = request.body.prompt;
const responseFormat = _.defaultTo(request.body.response_format, "url"); const responseFormat = _.defaultTo(request.body.response_format, "url");
const model = request.body.model; const assistantId = /^[a-z0-9]{24,}$/.test(request.body.model) ? request.body.model : undefined
const imageUrls = await chat.generateImages(model, prompt, token); const imageUrls = await chat.generateImages(assistantId, prompt, token);
let data = []; let data = [];
if (responseFormat == "b64_json") { if (responseFormat == "b64_json") {
data = ( data = (