Find answers from the community

G
Grecil
Offline, last seen 3 months ago
Joined September 25, 2024
Plain Text
from llama_index.llms.ollama import Ollama
llm=Ollama(model="llama3")

Plain Text
from llama_index.core.retrievers import VectorIndexRetriever
from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index.core.indices.postprocessor import SimilarityPostprocessor
retriever=VectorIndexRetriever(index=index,similarity_top_k=2,)
postprocessor=SimilarityPostprocessor(similarity_cutoff=0.5)
query_engine=RetrieverQueryEngine(node_postprocessors=[postprocessor],retriever=retriever,response_synthesizer=llm)

Plain Text
query_engine.query("What is 8086?")
2 comments
L