Skip to content

Commit 3487207

Browse files
committed
fix model
1 parent d7fb969 commit 3487207

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

langfuse/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def __init__(self, prompt: Prompt_Chat, is_fallback: bool = False):
231231
self.prompt: List[ChatMessageWithPlaceholdersDict] = []
232232

233233
for p in prompt.prompt:
234-
if hasattr(p, "type") and p.type == "placeholder":
234+
if hasattr(p, "type") and hasattr(p, "name"):
235235
self.prompt.append(
236236
ChatMessageWithPlaceholdersDict_Placeholder(
237237
type="placeholder",
@@ -240,7 +240,7 @@ def __init__(self, prompt: Prompt_Chat, is_fallback: bool = False):
240240
name=p.name,
241241
)
242242
)
243-
elif hasattr(p, "type") and p.type == "message":
243+
elif hasattr(p, "role") and hasattr(p, "content"):
244244
self.prompt.append(
245245
ChatMessageWithPlaceholdersDict_Message(
246246
type="message",

0 commit comments

Comments
 (0)