Skip to content

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Sep 2, 2025

Q A
Bug fix? no
New feature? yes
Docs? no
Issues Fix #407
License MIT

@OskarStark OskarStark self-assigned this Sep 2, 2025
@OskarStark OskarStark added the Platform Issues & PRs about the AI Platform component label Sep 2, 2025
@OskarStark OskarStark changed the title [Platform][OpenAI] Add region option support [Platform][OpenAI] Add region option Sep 2, 2025
@OskarStark
Copy link
Contributor Author

Ready to merge

@chr-hertel
Copy link
Member

two things:

  • i think it would be more consistent to use $region in the ModelClient constructors as well - with the same argument as you used in the issue
  • what do you think about a BaseModelClient that encapsulates that base url handling, and all children could just call getBaseUrl() of the base implementation - taking care of the region handling

@OskarStark
Copy link
Contributor Author

i think it would be more consistent to use $region in the ModelClient constructors as well - with the same argument as you used in the issue

makes sense, lets do it

what do you think about a BaseModelClient that encapsulates that base url handling, and all children could just call getBaseUrl() of the base implementation - taking care of the region handling

I will have a look, but as a follow up then

@OskarStark OskarStark force-pushed the open-ai-platform branch 2 times, most recently from cee3e39 to 1f3501c Compare September 3, 2025 08:17
@OskarStark OskarStark marked this pull request as draft September 3, 2025 08:49
@OskarStark OskarStark force-pushed the open-ai-platform branch 2 times, most recently from 217af4e to 5df37f6 Compare September 3, 2025 12:20
* @author Christopher Hertel <mail@christopher-hertel.de>
*/
final readonly class ModelClient implements PlatformResponseFactory
final readonly class ModelClient extends AbstractModelClient implements PlatformResponseFactory
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chr-hertel in src/platform/src/Bridge/OpenAi/DallE/ModelClient.php we do not alias the ModelClientInterface to PlatformResponseFactory. Shall we streamline this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm afraid the PlatformResponseFactory is rather a artifact from old times and is not needed anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@OskarStark OskarStark marked this pull request as ready for review September 4, 2025 05:33
@OskarStark
Copy link
Contributor Author

Ready to merge from my side @chr-hertel @petski

Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general you could pull more logic up into the abstract implementation, but the region stuff was the important part to me at this point

@OskarStark OskarStark merged commit bb6b953 into symfony:main Sep 4, 2025
7 checks passed
@OskarStark OskarStark deleted the open-ai-platform branch September 4, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature Platform Issues & PRs about the AI Platform component Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Endpoint URL for api.openai.com hardcoded

4 participants