Skip to content

Commit 3c63bd0

Browse files
benshukbenshuk
andauthored
fix: 🐛 handle maestro input as a list of ChatMessages (#297)
Co-authored-by: benshuk <[email protected]>
1 parent 458b756 commit 3c63bd0

File tree

1 file changed

+6
-1
lines changed
  • ai21/clients/common/maestro

1 file changed

+6
-1
lines changed

ai21/clients/common/maestro/run.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ def _create_body(
3333
include: List[OutputOptions] | NotGiven,
3434
**kwargs,
3535
) -> dict:
36+
if isinstance(input, list):
37+
_input = [{"role": message.role, "content": message.content} for message in input]
38+
else:
39+
_input = input
40+
3641
return remove_not_given(
3742
{
38-
"input": input,
43+
"input": _input,
3944
"models": models,
4045
"tools": tools,
4146
"tool_resources": tool_resources,

0 commit comments

Comments
 (0)