-
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e99626
commit 955c06d
Showing
7 changed files
with
30 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
import asyncio | ||
|
||
from codeinterpreterapi import CodeInterpreterSession | ||
|
||
|
||
async def run_with_claude(): | ||
async with CodeInterpreterSession(model="claude-2") as session: | ||
result = await session.generate_response( | ||
"Plot the nvidea stock vs microsoft stock over the last 6 months." | ||
) | ||
result.show() | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.run(run_with_claude()) | ||
with CodeInterpreterSession(model="claude-2") as session: | ||
result = session.generate_response( | ||
"Plot the nvidea stock vs microsoft stock over the last 6 months." | ||
) | ||
result.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
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()) | ||
with CodeInterpreterSession() as session: | ||
user_request = "Convert this dataset to excel." | ||
files = [ | ||
File.from_path("examples/assets/iris.csv"), | ||
] | ||
|
||
response = 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters