embedchain/notebooks/anthropic.ipynb
!pip install embedchain
You can find OPENAI_API_KEY on your OpenAI dashboard and ANTHROPIC_API_KEY on your Anthropic dashboard.
import os
from embedchain import App
os.environ["OPENAI_API_KEY"] = "sk-xxx"
os.environ["ANTHROPIC_API_KEY"] = "xxx"
app = App.from_config(config={
"provider": "anthropic",
"config": {
"model": "claude-instant-1",
"temperature": 0.5,
"top_p": 1,
"stream": False
}
})
app.add("https://www.forbes.com/profile/elon-musk")
while(True):
question = input("Enter question: ")
if question in ['q', 'exit', 'quit']:
break
answer = app.query(question)
print(answer)