Skip to content

Commit d200615

Browse files
committed
fix: correct Conversation.messages access and ToolSchema dict keys for mypy
1 parent 285145f commit d200615

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

plugins/litellm/vision_agents/plugins/litellm/litellm_llm.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ async def _build_model_request(self) -> list[dict[str, object]]:
225225
if self._instructions:
226226
messages.append({"role": "system", "content": self._instructions})
227227
if self._conversation:
228-
messages.extend(await self._conversation.get_messages())
228+
messages.extend(
229+
{"role": m.role, "content": m.content}
230+
for m in self._conversation.messages
231+
)
229232
return messages
230233

231234
def _convert_tools_to_provider_format(
@@ -235,9 +238,9 @@ def _convert_tools_to_provider_format(
235238
{
236239
"type": "function",
237240
"function": {
238-
"name": t.name,
239-
"description": t.description,
240-
"parameters": t.parameters,
241+
"name": t["name"],
242+
"description": t.get("description", ""),
243+
"parameters": t.get("parameters_schema", {}),
241244
},
242245
}
243246
for t in tools

0 commit comments

Comments
 (0)