Spaces:
Runtime error
Runtime error
File size: 591 Bytes
5676d16 c8866ac 1e8c421 c8866ac e0cbbfe ae0deb8 e0cbbfe ae0deb8 c8866ac e0cbbfe c8866ac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from codeinterpreterapi import CodeInterpreterSession, File
async def main():
async with CodeInterpreterSession() as session:
user_request = "Convert this dataset to excel."
files = [
File.from_path("examples/assets/iris.csv"),
]
response = await session.generate_response(user_request, files)
print("AI: ", response.content)
for file in response.files:
if file.name == "iris.xlsx":
file.save("examples/assets/iris.xlsx")
if __name__ == "__main__":
import asyncio
asyncio.run(main())
|