3.2 KiB
3.2 KiB
In [ ]:
!pip install embedchain[elasticsearch]In [ ]:
import os
from embedchain import App
os.environ["OPENAI_API_KEY"] = "sk-xxx"In [ ]:
app = App.from_config(config={
"provider": "elasticsearch",
"config": {
"collection_name": "es-index",
"es_url": "your-elasticsearch-url.com",
"allow_reset": True,
"api_key": "xxx"
}
})In [ ]:
app.add("https://www.forbes.com/profile/elon-musk")In [ ]:
while(True):
question = input("Enter question: ")
if question in ['q', 'exit', 'quit']:
break
answer = app.query(question)
print(answer)