Skip to content

Commit f4fd5fb

Browse files
author
jinhaiyang
committed
【web_search】web_search
1 parent 4ddbbad commit f4fd5fb

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

tests/integration_tests/test.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# import time
2-
#
3-
# from zhipuai import ZhipuAI
4-
# client = ZhipuAI() # 填写您自己的APIKey
5-
#
6-
# response = client.videos.generations(
7-
# model="cogvideo",
8-
# prompt="一个年轻的艺术家在一片彩虹上用调色板作画。"
9-
# # prompt="一只卡通狐狸在森林里跳着欢快的爵士舞。"
10-
# # prompt="这是一部汽车广告片,描述了一位30岁的汽车赛车手戴着红色头盔的赛车冒险。背景是蔚蓝的天空和苛刻的沙漠环境,电影风格使用35毫米胶片拍摄,色彩鲜艳夺目。"
11-
# )
12-
# print(response)
13-
# task_id = response.id
14-
# task_status = response.task_status
15-
# get_cnt = 0
16-
#
17-
# while task_status == 'PROCESSING' and get_cnt <= 40:
18-
# result_response = client.videos.retrieve_videos_result(
19-
# id=task_id
20-
# )
21-
# print(result_response)
22-
# task_status = result_response.task_status
23-
#
24-
# time.sleep(2)
25-
# get_cnt += 1
1+
import time
2+
3+
from zhipuai import ZhipuAI
4+
client = ZhipuAI() # 填写您自己的APIKey
5+
6+
response = client.videos.generations(
7+
model="cogvideo",
8+
prompt="一个年轻的艺术家在一片彩虹上用调色板作画。"
9+
# prompt="一只卡通狐狸在森林里跳着欢快的爵士舞。"
10+
# prompt="这是一部汽车广告片,描述了一位30岁的汽车赛车手戴着红色头盔的赛车冒险。背景是蔚蓝的天空和苛刻的沙漠环境,电影风格使用35毫米胶片拍摄,色彩鲜艳夺目。"
11+
)
12+
print(response)
13+
task_id = response.id
14+
task_status = response.task_status
15+
get_cnt = 0
16+
17+
while task_status == 'PROCESSING' and get_cnt <= 40:
18+
result_response = client.videos.retrieve_videos_result(
19+
id=task_id
20+
)
21+
print(result_response)
22+
task_status = result_response.task_status
23+
24+
time.sleep(2)
25+
get_cnt += 1

0 commit comments

Comments
 (0)