Skip to content

json.dumps in aggregate_responses throws exception if object contains UUIDs #449

@Schumacher-Bastian

Description

@Schumacher-Bastian

I have a weaviate vector store where one property (article_id) is of type UUID.
Adding langtrace to my project has bricked my retriever because the questions.query.near_text call now raises an exception because the object is not JSON serializable.

This issue is cause by the "aggregate_responses" function in the "langtrace_python_sdk/instrumentation/weaviate/patch.py" uses json.dumps.

using return json.dumps(all_responses, default=str) would fix this issue.

Alternativeley you could let the user specify a json encoder when initializing langtrace like it is possible with flask: https://gist.github.com/claraj/3b2b95a62c5ba6860c03b5c737c214ab

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions