Find answers from the community

Updated 3 months ago

Node

I am inserting images into my index with a mimetype, and then when querying the index am getting this

Plain Text
"Error generating summary: 'NodeWithScore' object has no attribute 'image_mimetype'"


Plain Text
image_doc = ImageDocument(
            doc_id=f"{image_request.userId}_{image_id}",
            image=image_data,
            text=image_request.text_request.text
            if image_request.text_request
            else "",
            image_mimetype=image_request.mimetype,
        )


the mimetype is there and correct, but it doesn't end up in my vector database somehow and now is causing an error?
L
Z
31 comments
NodeWithScore only has a node and score attribute

To access it, I think you'd need to node_with_score.node.image_mimetype
that's not my error
cause I definitely am not trying to access the node.image_mimetype lol
working on building my own query engine I think because the issue is I really just need it to stop thinking about if an image is relevant or not and just know that all images are relevant that it can see in the vector database but to pick the best ones to achieve the task
If you have the full traceback, it can probably help track down the issue
lemme get it, that's FastAPI
all I'm getting is a basic error message :thinkRoll:
Maybe because you have it wrapped in a try/except somewhere
So the traceback is being swallowed
I do insert the image_mimetype and I do check, it's definitely being set on insert
but it's definitely not making it to Qdrant
so ImageDocument is also removing my image_mimetype somewhere too
Hmm, so 1) I wonder if the node parser is removing it

2) the llamaindex code probably shouldn't be passing in NodeWithScore objects there, feels like a bug
yeahhhhh so is there a way for me to just retrieve everything filtered for a user and then have it just select the top_k most relevant ones but guarantee it selects them?
filters are applied before top k is found
understood, but that doesn't change anything because they're all the same User ID and it still is giving me nothin even with an AI generated metadata
Plain Text
{"id_": "131f30e5-472e-4aeb-b04f-446118e10915", "embedding": null, "metadata": {"user_id": "65a0349f048a9118ff98", "text": "The image shows a black-and-white portrait of a young man with a thoughtful expression, possibly symbolizing introspection or a serious, contemplative personality."}, "excluded_embed_metadata_keys": [], "excluded_llm_metadata_keys": [], "relationships": {"1": {"node_id": "65a0349f048a9118ff98_65ab0bea34fd19fa6f92", "node_type": "4", "metadata": {"user_id": "65a0349f048a9118ff98", "text": "The image shows a black-and-white portrait of a young man with a thoughtful expression, possibly symbolizing introspection or a serious, contemplative personality."}, "hash": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", "class_name": "RelatedNodeInfo"}}, "hash": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", "text": "", "start_char_idx": 0, "end_char_idx": 0, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "image": "/9j/4AAQSkZJRgABAQAASABIAAD/4QBwRXhpZgAATU0AKgAAAAgABAESAAMAAAABAAEAAAFCAAQAAAABAAACDgFDAAQAAAABAAACqIdpAAQAAAABAAAAPgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACDaADAAQAAAABAAACpwAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgCpwINAwERAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCN
Plain Text
The image shows a black-and-white portrait of a young man with a thoughtful expression, possibly symbolizing introspection or a serious, contemplative personality.
that was my own generation
using the multimodal_agent.acompletion endpoint
not what it gave me.
Add a reply
Sign up and join the conversation on Discord