-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenAIChatTarget raises BadRequestError 400 ('messages.0.content' must be a string) with OpenAI-compatible APIs #704
Comments
I'm a little confused. You're using OpenAIChatTarget for DeepSeek and Llama? How is that possible? It might be my lack of awareness but that could be part of the problem. |
@rlundeen2 also has this ongoing PR #687 to add support for Deepseek in AML Foundry which may be useful to you. |
Thanks for the clarification! I took a look at PR #687, and from what I understand, it focuses on adding support for Azure Foundry models like DeepSeek-R1, Mistral, and Llama 3.1. My case might be a bit different, and I may be misunderstanding something here. I'm using OpenAIChatTarget with services that expose an OpenAI-compatible API but are not part of Azure nor the official OpenAI API. Specifically:
Since these services implement the OpenAI API standard, I initially assumed OpenAIChatTarget would work seamlessly, but I encountered this issue. I’m wondering if this use case is something that should be supported within OpenAIChatTarget, or if it would make more sense to handle it separately (e.g., with an OpenAICompatibleChatTarget). Let me know if I'm missing something or if there's a better approach to handling this! |
So either it's not completely compatible or something changed in the openai SDK that we haven't noticed yet (?) Can you paste an example response you're getting? I can compare to what I'm seeing form openai targets. Making the proposed change would likely break our openai targets so I'd love to understand where the issue lies before suggesting how to move forward. |
Describe the bug
When using the OpenAIChatTarget class as adversarial_chat for RedTeamingOrchestrator, there is an error that told us no content as been send to the system prompt. This issue prevents the orchestrator from generating prompts, leading to a failure in executing adversarial chat interactions.
The issue can be resolved by modifying the _complete_chat_async method in openai_chat_target.py, specifically by changing msg.content to msg.content[0].get('text').
Steps/Code to Reproduce
Expected Results
Script runs without error
Actual Results
Screenshots
n/a
Versions
The text was updated successfully, but these errors were encountered: