chore: Clean input to openai generic client (#239)

This commit is contained in:
Pavlo Paliychuk 2024-12-11 13:04:28 -05:00 committed by GitHub
parent 9f3dd5552a
commit 425b35ba2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,6 +89,7 @@ class OpenAIGenericClient(LLMClient):
) -> dict[str, typing.Any]:
openai_messages: list[ChatCompletionMessageParam] = []
for m in messages:
m.content = self._clean_input(m.content)
if m.role == 'user':
openai_messages.append({'role': 'user', 'content': m.content})
elif m.role == 'system':