We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ddee62 commit 0c7ec1dCopy full SHA for 0c7ec1d
1 file changed
langfuse/model.py
@@ -271,10 +271,16 @@ def __eq__(self, other):
271
return (
272
self.name == other.name
273
and self.version == other.version
274
+ and len(self.prompt) == len(other.prompt)
275
and all(
- m1["role"] == m2["role"] and m1["content"] == m2["content"]
276
+ # chatmessage equality
277
+ (m1["type"] == "message" and m2["type"] == "message"
278
+ and m1["role"] == m2["role"] and m1["content"] == m2["content"])
279
+ or
280
+ # placeholder equality
281
+ (m1["type"] == "placeholder" and m2["type"] == "placeholder"
282
+ and m1["name"] == m2["name"])
283
for m1, m2 in zip(self.prompt, other.prompt)
- if m1["type"] == "message" and m2["type"] == "message"
284
)
285
and self.config == other.config
286
0 commit comments