Skip to content

Commit

Permalink
🧼 simplify examples
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Aug 3, 2023
1 parent ace6440 commit afd854a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
4 changes: 1 addition & 3 deletions examples/analyze_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ async def main():
response = await session.generate_response(user_request, files=files)

# output the response (text + image)
print("AI: ", response.content)
for file in response.files:
file.show_image()
response.show()


if __name__ == "__main__":
Expand Down
4 changes: 1 addition & 3 deletions examples/plot_sin_wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ async def main():
async with CodeInterpreterSession() as session:
response = await session.generate_response("Plot a sin wave and show it to me.")

print("AI: ", response.content)
for file in response.files:
file.show_image()
response.show()


if __name__ == "__main__":
Expand Down
12 changes: 2 additions & 10 deletions examples/show_bitcoin_chart.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
"""
The exciting part about this example is
that the code interpreter has internet access
so it can download the bitcoin chart from yahoo finance
and plot it for you
"""

from datetime import datetime

from codeinterpreterapi import CodeInterpreterSession
Expand All @@ -18,9 +11,8 @@ async def main():
f"Plot the bitcoin chart of 2023 YTD (today is {currentdate})"
)

print("AI: ", response.content)
for file in response.files:
file.show_image()
# prints the text and shows the image
response.show()


if __name__ == "__main__":
Expand Down
4 changes: 1 addition & 3 deletions examples/use_additional_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ async def main():
"Plot chart of company employee salaries"
)

print("AI: ", response.content)
for file in response.files:
file.show_image()
response.show()


if __name__ == "__main__":
Expand Down

0 comments on commit afd854a

Please sign in to comment.