File tree Expand file tree Collapse file tree 4 files changed +5
-19
lines changed Expand file tree Collapse file tree 4 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,7 @@ async def main():
14
14
response = await session .generate_response (user_request , files = files )
15
15
16
16
# output the response (text + image)
17
- print ("AI: " , response .content )
18
- for file in response .files :
19
- file .show_image ()
17
+ response .show ()
20
18
21
19
22
20
if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ async def main():
5
5
async with CodeInterpreterSession () as session :
6
6
response = await session .generate_response ("Plot a sin wave and show it to me." )
7
7
8
- print ("AI: " , response .content )
9
- for file in response .files :
10
- file .show_image ()
8
+ response .show ()
11
9
12
10
13
11
if __name__ == "__main__" :
Original file line number Diff line number Diff line change 1
- """
2
- The exciting part about this example is
3
- that the code interpreter has internet access
4
- so it can download the bitcoin chart from yahoo finance
5
- and plot it for you
6
- """
7
-
8
1
from datetime import datetime
9
2
10
3
from codeinterpreterapi import CodeInterpreterSession
@@ -18,9 +11,8 @@ async def main():
18
11
f"Plot the bitcoin chart of 2023 YTD (today is { currentdate } )"
19
12
)
20
13
21
- print ("AI: " , response .content )
22
- for file in response .files :
23
- file .show_image ()
14
+ # prints the text and shows the image
15
+ response .show ()
24
16
25
17
26
18
if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -37,9 +37,7 @@ async def main():
37
37
"Plot chart of company employee salaries"
38
38
)
39
39
40
- print ("AI: " , response .content )
41
- for file in response .files :
42
- file .show_image ()
40
+ response .show ()
43
41
44
42
45
43
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments