Find answers from the community

Home
Members
PuddingBread
P
PuddingBread
Offline, last seen 3 months ago
Joined September 25, 2024
Hi Team LlamaIndex!

We are having increase load on our application, and notice that sometimes our database (weaviate) connections times out. We are using the simple chat engine streaming method. This then sometimes result in an error like this: ''''HTTPSConnectionPool(host='xxxxxxxxx.europe-west3.gcp.weaviate.cloud', port=443): Read timed out. (read timeout=60)''' is there any way into gracefully retrying a chat when this happens? Or any other recommended ways in handling this?
3 comments
P
L
Hi team Llama, when using the
Plain Text
vector_store = WeaviateVectorStore(
    weaviate_client=client, index_name="LlamaIndex"
)
index = VectorStoreIndex.from_vector_store(store)

Is it possible to then check if said index has any documents loaded?
8 comments
P
W
Hi Team LammaIndex,
We're playing around with using the docstore and ingestion pipeline. Two questions arise. First, we notice that when for the IngestionPipeline we pass in an IngestionCache as well as a vector store, that embeddings are saved in the IngestionCache. Is this intended behaviour?
Moreover, when using this simple snippet to upload documents, add it to the doc_store and run i through the pipeline, it results in more documents/nodes than files uploaded. We see that these are split per page. However, how can we identify the relationships between these nodes, so that we can return general file id's, and add all related nodes later to an index?

Plain Text
 
async def add_documents(
    files: List[UploadFile] = File(...),
) -> List[str]:
    try:
        print(len(files))
        with tempfile.TemporaryDirectory() as tempdir:
            for file in files:
                with open(f"{tempdir}/{file.filename}", "wb+") as buffer:
                    shutil.copyfileobj(file.file, buffer)
            reader = SimpleDirectoryReader(tempdir)
            documents = reader.load_data(show_progress=True)
            for document in documents:
                print(document.get_node_info)
                print(document.ref_doc_id)
            print(len(documents))
            mongodb_docstore.add_documents(documents)
            await pipeline.arun(documents=documents)
            return [document.doc_id for document in documents]
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))


So we can see that len files is the amount of documents uploaded to the route. Then we can see in the show_progress that indeed 2 files are loaded. But the for loop is executed as many times as there are pages. ref_doc_id is deprecated, and also show none. Relations in node info is also an empty object.
How to return two file id's with which we can later retrieve the nodes from the doc_store, and add them to an collection?
12 comments
P
L
W
Hi team llama! We have an issue with the tokencountpredictor. Specifically in an environment where we have integrated llamaindex in Fastapi. We use dependency injection (scoped) to create the context with tokencounter.
However when we use the aquery method on the index, and multiple requests are processed at the same time, the tokencounter is not working as expected. The tokencounter returns inconistent counts, where it seems to accumulate token counts from different requests and return them together in one.
E.g. we fire the same request 20 times, it will return for the first few request that zero tokens were used, and then suddenly for the 7th request that it used 15k tokens.
This seems strange to use since the instances of the tokencounter and context are passed into all the pipeline steps scoped with dependency injection.

Is this a familiar sound issue for you? If not I can provide a minimal reproduction and script to send multiple requests with the output.
Thanks in advance, we look out for a reply 🙂
3 comments
P
L