支持指定绘图的智能体

This commit is contained in:
Vinlic 2024-03-27 10:43:28 +08:00
parent 6226615f53
commit 1b1b3dd322

View File

@ -369,21 +369,19 @@ async function createCompletionStream(
} }
async function generateImages( async function generateImages(
model = MODEL_NAME, model = '65a232c082ff90a2ad2f15e2',
prompt: string, prompt: string,
refreshToken: string, refreshToken: string,
retryCount = 0 retryCount = 0
) { ) {
return (async () => { return (async () => {
const messages = [{ role: "user", content: prompt }]; const messages = [{ role: "user", content: prompt }];
// 官方AI绘图的智能体ID
const assistantId = "65a232c082ff90a2ad2f15e2";
// 请求流 // 请求流
const token = await acquireToken(refreshToken); const token = await acquireToken(refreshToken);
const result = await axios.post( const result = await axios.post(
"https://chatglm.cn/chatglm/backend-api/assistant/stream", "https://chatglm.cn/chatglm/backend-api/assistant/stream",
{ {
assistant_id: assistantId, assistant_id: model,
conversation_id: "", conversation_id: "",
messages: messagesPrepare(messages, []), messages: messagesPrepare(messages, []),
meta_data: { meta_data: {