byron mackay
byron mackay6mo ago

When I attempt to get a prompt from

FIXED: Force reinstalling langfuse's python package seemed to do the trick When I attempt to get a prompt from Langfuse, I'm getting the following error:
Error while fetching prompt 'PROMPT_NAME-latest': 'Prompt_Chat' object has no attribute 'type'
Traceback (most recent call last):
File "/Users/byronmackay/app/venv/lib/python3.12/site-packages/langfuse/client.py", line 609, in _fetch_prompt_and_update_cache
if promptResponse.type == "chat":
^^^^^^^^^^^^^^^^^^^
AttributeError: 'Prompt_Chat' object has no attribute 'type'
Error while fetching prompt 'PROMPT_NAME-latest': 'Prompt_Chat' object has no attribute 'type'
Traceback (most recent call last):
File "/Users/byronmackay/app/venv/lib/python3.12/site-packages/langfuse/client.py", line 609, in _fetch_prompt_and_update_cache
if promptResponse.type == "chat":
^^^^^^^^^^^^^^^^^^^
AttributeError: 'Prompt_Chat' object has no attribute 'type'
This is a self hosted version of Langfuse using the latest. The return json does have the type and the object Prompt_Chat has the property type. Any ideas why I'd be getting this error?
3 Replies
byron mackay
byron mackay5mo ago
Environment: - langfuse==2.27.1 - language: python - docker file is up to date JSON response
{
"id": "clvbdigib000r13c73mrbbc3e",
"createdAt": "2024-04-22T19:52:02.580Z",
"updatedAt": "2024-04-22T19:52:19.451Z",
"projectId": "cltyrwd9100012wl7n2r3mrop",
"createdBy": "cltyrsxly00002wl75il4gufi",
"prompt": "Determine how the company...",
"name": "PROMPT_NAME",
"version": 1,
"type": "text",
"isActive": true,
"config": {},
"tags": [
"trend"
]
}
{
"id": "clvbdigib000r13c73mrbbc3e",
"createdAt": "2024-04-22T19:52:02.580Z",
"updatedAt": "2024-04-22T19:52:19.451Z",
"projectId": "cltyrwd9100012wl7n2r3mrop",
"createdBy": "cltyrsxly00002wl75il4gufi",
"prompt": "Determine how the company...",
"name": "PROMPT_NAME",
"version": 1,
"type": "text",
"isActive": true,
"config": {},
"tags": [
"trend"
]
}
Oddly enough, even though the type in the json is "text", the code returns a Prompt_Chat object instead of a Prompt_Text object On top of that, I see that the Prompt_Chat and Prompt_Text objects do in fact have a type property
byron mackay
byron mackay5mo ago
No description
byron mackay
byron mackay5mo ago
FIXED: force reinstalled langfuse's package did the trick