mirror of
https://github.com/LLM-Red-Team/glm-free-api.git
synced 2024-12-23 01:19:22 +08:00
支持指定绘图的智能体
This commit is contained in:
parent
6226615f53
commit
1b1b3dd322
@ -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: {
|
||||||
|
Loading…
Reference in New Issue
Block a user