from qdrant_client import QdrantClient, models
from llama_index.vector_stores.qdrant import QdrantVectorStore
from llama_index.core import Settings, VectorStoreIndex
from llama_index.llms.ollama import Ollama
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
from llama_index.core.retrievers import VectorIndexRetriever
client = QdrantClient(url='http://localhost:6333')
# Settings for the RAG application
Settings.llm = Ollama('llama3.1', request_timeout=10000.0)
Settings.embed_model = HuggingFaceEmbedding(model_name='sentence-transformers/all-MiniLM-L6-v2')
# Creating vector store from existing qdrant collection
vector_store = QdrantVectorStore(client=client, collection_name='demo_collection')
# Creating index from loaded store
index = VectorStoreIndex.from_vector_store(vector_store=vector_store)
query_engine = index.as_query_engine()
while True:
user_query = input()
if user_query == '/bye':
break
response = query_engine.query(
"Which institution was recognized as the top polytechnic college in Rajasthan for three consecutive years?"
)
print(response)
I am following tutorial and this code throws an error,
saying input must be a valid string.
Here is the stack trace.
self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for TextNode
text
Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.8/v/string_type