-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path18_agent_input_is_list.py
48 lines (44 loc) · 1.19 KB
/
18_agent_input_is_list.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
"""
import sys
sys.path.append('..')
from agentica import Agent, AzureOpenAIChat
m = Agent()
# Single Image
m.print_response(
[
{"type": "text", "text": "描述图片"},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
},
},
],
stream=True
)
# Multiple Images
m.print_response(
[
{
"type": "text",
"text": "一句话说明两张图片的不同",
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
},
},
{
"type": "image_url",
"image_url": {
"url": "https://img-blog.csdnimg.cn/img_convert/0ab31bdb17bebbab9c8f4185f3655b6d.jpeg"
},
},
],
stream=True
)