-
-
Notifications
You must be signed in to change notification settings - Fork 58
[Platform] OpenAI Responses API #149
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
Conversation
Hey @glengemann, thanks for working on this and thanks for checking in early for feedback 👍 I notice some things here:
what I'm basically saying here, I get why you checked in early - somehow this duplication feels odd, but the current extension points, like those supports methods, don't provide more flexibility. In those cases I'd like to start from the user land code: how would we want the user to select the different apis? do they care at this point? let's image we would use this: use Symfony\AI\Platform\Bridge\OpenAI;
$platform = OpenAI\PlatformFactory($apiKey);
$model = new OpenAI\GPT();
$response = $platform->request($model, $messages); vs. use Symfony\AI\Platform\Bridge\OpenAI;
$platform = OpenAI\PlatformFactory($apiKey);
$model = new OpenAI\Responses();
$response = $platform->request($model, $messages); So, my questions:
If we'd go with an option, we would need to find a way to extend the supports methods to check for that - and the |
@glengemann do you have some thoughts or plans with this or should we close this for now? |
Hi @chr-hertel! Let me work on this feature a little more. |
@chr-hertel I was trying to finish the PR because I now need to use the responses API (the websearch function for GPT-5 is only available through the responses API, not the completions API anymore). But I hit a problem here: The response_format key for structured output is only required by the completions API. The responses API, on the other hand, expects it under the text key. It looks like Ollama also doesn’t support response_format, see: So the question is: how do we deal with this? The only solution I can think of is to remove ResponseFormatFactory and let the model itself decide how the output should look—since it’s the only one that actually knows the proper structure. Then in the agent, call something like: $responseClass = $options['output_structure'];
$structuredOutputName = u($responseClass)->afterLast('\\')->toString();
$schema = $this->schemaFactory->buildProperties($responseClass);
$input->model->addStructuredOutputToInput($input, $structuredOutputName, $schema, $responseClass); It might not even be necessary to pass that many parameters. |
a3ce02a
to
899ca12
Compare
@MartkCz i guess this should cover the issue, doesn't it? ai/src/agent/src/StructuredOutput/AgentProcessor.php Lines 60 to 62 in 899ca12
basically if you use a model that doesn't support that feature, you can't use it. |
Hi! I've been playing around with the new OpenAI Responses API for a project. Just wondering if the changes in this branch are moving in the right direction.