Skip to content

Commit

Permalink
πŸ‘¨πŸ»β€πŸ”¬ dataset analysis example
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Jul 16, 2023
1 parent b706710 commit 11d77f8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/analyze_dataset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from codeinterpreterapi import CodeInterpreterSession
from codeinterpreterapi.schema import File


async def main():
# context manager for start/stop of the session
async with CodeInterpreterSession() as session:
# define the user request
user_request = "Analyze this dataset and plot something interesting about it."
files = [
File.from_path("examples/assets/iris.csv"),
]

# generate the response
response = await session.generate_response(
user_request, files=files
)

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


if __name__ == "__main__":
import asyncio

# run the async function
asyncio.run(main())

0 comments on commit 11d77f8

Please sign in to comment.