Skip to content

Commit

Permalink
🅰️ claude-2 example
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Jul 29, 2023
1 parent 4b12911 commit a560550
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/anthropic_claude.py
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())

0 comments on commit a560550

Please sign in to comment.