byron mackay
byron mackay6mo ago

I'm having issues with the `api/public/

UPDATE: Issue resolved. Didn't run the DB migrations. I'm having issues with the api/public/dataset-run-items endpoint not returning trace_ids. DataRunItem requires a trace_id, but they don't appear in the response. Stacktrace in thread. Any ideas on how to fix this?
4 Replies
byron mackay
byron mackay6mo ago
Relevant stack trace:
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/langfuse/client.py", line 2368, in get_langchain_handler
self.link(span, run_name)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/langfuse/client.py", line 2339, in link
self.langfuse.client.dataset_run_items.create(
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/langfuse/api/resources/dataset_run_items/client.py", line 88, in create
return pydantic_v1.parse_obj_as(DatasetRunItem, _response.json()) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pydantic/v1/tools.py", line 38, in parse_obj_as
return model_type(__root__=obj).__root__
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pydantic/v1/main.py", line 341, in __init__
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for ParsingModel[DatasetRunItem]
__root__ -> traceId
field required (type=value_error.missing)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/langfuse/client.py", line 2368, in get_langchain_handler
self.link(span, run_name)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/langfuse/client.py", line 2339, in link
self.langfuse.client.dataset_run_items.create(
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/langfuse/api/resources/dataset_run_items/client.py", line 88, in create
return pydantic_v1.parse_obj_as(DatasetRunItem, _response.json()) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pydantic/v1/tools.py", line 38, in parse_obj_as
return model_type(__root__=obj).__root__
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pydantic/v1/main.py", line 341, in __init__
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for ParsingModel[DatasetRunItem]
__root__ -> traceId
field required (type=value_error.missing)
I have the latest for both my python langfuse library and the langfuse docker image
Marc
Marc6mo ago
Looking at this right now for issues like this it’s best to directly post to GitHub with these debugging details I tried but could not reproduce this with the latest Python sdk and container version. Can you try again and post to GitHub if this issue persists? Sorry for the inconvenience! Currently making lots of improvements without meaning to break anything on the way (added lots of test to ensure backwards compatibility) @byron mackay
byron mackay
byron mackay6mo ago
Hi Marc, I was able to get it fixed. I needed to update the DB. Sorry for the confusion.
Marc
Marc6mo ago
awesome, thanks for confirming