-
-
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
4b12911
commit a560550
Showing
1 changed file
with
20 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import asyncio | ||
from langchain.chat_models.anthropic import ChatAnthropic | ||
from codeinterpreterapi import CodeInterpreterSession | ||
|
||
|
||
async def run_with_claude(): | ||
llm = ChatAnthropic(model="claude-2") | ||
|
||
async with CodeInterpreterSession(llm=llm) as session: | ||
prompt = "Plot the nvidea stock vs microsoft stock over the last 6 months. " | ||
|
||
result = await session.generate_response(prompt) | ||
|
||
print("AI: ", result.content) | ||
for file in result.files: | ||
file.show_image() | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.run(run_with_claude()) |