embedchain/notebooks/together.ipynb
!pip install embedchain[together]
You can find OPENAI_API_KEY on your OpenAI dashboard and TOGETHER_API_KEY key on your Together dashboard.
import os
from embedchain import App
os.environ["OPENAI_API_KEY"] = ""
os.environ["TOGETHER_API_KEY"] = ""
app = App.from_config(config={
"provider": "together",
"config": {
"model": "mistralai/Mixtral-8x7B-Instruct-v0.1",
"temperature": 0.5,
"max_tokens": 1000
}
})
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)