Skip to content

Endpoint URL for api.openai.com hardcoded #407

@petski

Description

@petski

See https://platform.openai.com/docs/guides/your-data#how-to-use-data-residency, and I quote:

For US processing, the URL is https://us.api.openai.com/. For EU processing, the URL is https://eu.api.openai.com/

Currently, the api.openai.com domain is hardcoded at least in:

src/platform/src/Bridge/OpenAi/Whisper/ModelClient.php:        return new RawHttpResult($this->httpClient->request('POST', \sprintf('https://api.openai.com/v1/audio/%s', $endpoint), [
src/platform/src/Bridge/OpenAi/Embeddings/ModelClient.php:        return new RawHttpResult($this->httpClient->request('POST', 'https://api.openai.com/v1/embeddings', [
src/platform/src/Bridge/OpenAi/DallE/ModelClient.php:        return new RawHttpResult($this->httpClient->request('POST', 'https://api.openai.com/v1/images/generations', [
src/platform/src/Bridge/OpenAi/Gpt/ModelClient.php:        return new RawHttpResult($this->httpClient->request('POST', 'https://api.openai.com/v1/chat/completions', [

A couple of PlatformResponseFactory's already seem to work with a baseUrl strategy. I'd like to propose the 4 ModelClient's above implement something simular.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions