Skip to content

Commit

Permalink
支持指定绘图的智能体
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinlic committed Mar 27, 2024
1 parent 6226615 commit 1b1b3dd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/api/controllers/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,21 +369,19 @@ async function createCompletionStream(
}

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

0 comments on commit 1b1b3dd

Please sign in to comment.