Skip to content

Commit 596fcd2

Browse files
committed
BaseMessages take into account 'input_text' key too (for xray)
1 parent c2e2b9c commit 596fcd2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/agentlab/llm/llm_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,13 @@ def __str__(self, warn_if_image=False) -> str:
401401
else:
402402
logging.info(msg)
403403

404-
return "\n".join([elem["text"] for elem in self["content"] if elem["type"] == "text"])
404+
return "\n".join(
405+
[
406+
elem["text"]
407+
for elem in self["content"]
408+
if elem["type"] == "text" or elem["type"] == "input_text"
409+
]
410+
)
405411

406412
def add_content(self, type: str, content: Any):
407413
if isinstance(self["content"], str):

0 commit comments

Comments
 (0)