File tree 1 file changed +54
-0
lines changed
1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,56 @@ test_completions_charglm()
185
185
```
186
186
187
187
188
+ ### 智能体
189
+ ``` python
190
+
191
+ def test_assistant () -> None :
192
+ client = ZhipuAI() # 填写您自己的APIKey
193
+
194
+
195
+ generate = client.assistant.conversation(
196
+ assistant_id = " 659e54b1b8006379b4b2abd6" ,
197
+ model = " glm-4-assistant" ,
198
+ messages = [
199
+ {
200
+ " role" : " user" ,
201
+ " content" : [{
202
+ " type" : " text" ,
203
+ " text" : " 帮我搜索下智谱的cogvideox发布时间"
204
+ }]
205
+ }
206
+ ],
207
+ stream = True ,
208
+ attachments = None ,
209
+ metadata = None ,
210
+ request_id = " request_1790291013237211136" ,
211
+ user_id = " 12345678"
212
+ )
213
+ for assistant in generate:
214
+ print (assistant)
215
+
216
+ test_assistant()
217
+ ```
218
+
219
+ ### 视频生成
220
+ ``` python
221
+
222
+
223
+ def test_videos ():
224
+ client = ZhipuAI() # 填写您自己的APIKey
225
+ try :
226
+ response = client.videos.generations(
227
+ model = " cogvideo" ,
228
+ prompt = " 一个开船的人" ,
229
+
230
+ user_id = " 1212222"
231
+ )
232
+ print (response)
233
+
234
+ test_videos()
235
+ ```
236
+
237
+
188
238
189
239
### 异常处理
190
240
@@ -229,6 +279,10 @@ Error codes are as followed:
229
279
230
280
231
281
### 更新日志
282
+ ` 2024-8-12 `
283
+ - 修改视频提示词可选,增加文件删除
284
+ - Assistant业务
285
+ - embedding 3 fix dimensions
232
286
` 2024-7-25 `
233
287
- cogvideo 修复
234
288
` 2024-7-12 `
You can’t perform that action at this time.
0 commit comments