Zack Saadioui
8/26/2024
1
2
bash
pip install llama-index openai
1
2
3
4
python
query_engine = index.as_query_engine()
response = query_engine.query("Your query goes here")
print(response)
1
2
3
4
5
6
7
python
while True:
user_input = input("User: ")
if user_input.lower() == 'exit':
break
response = query_engine.query(user_input)
print("Chatbot:", response)
1
2
3
python
from llama_index.llms import OpenAI
index = VectorStoreIndex.from_documents(documents, service_context=ServiceContext(llm=OpenAI(model="gpt-3.5-turbo", temperature=0.7)))
Copyright © Arsturn 2024