Skip to content

Support adding model name path segments to non-Azure URLs #473

Open
@devUndef1ned

Description

@devUndef1ned

In my company we use APIM for requests to LLM. We have similar endpoints structure for that:

https://BASE_URL/openai/deployments/DEPLOYMENT_NAME/chat/completions?api-version=API_VERSION

BASE_URL is an internal URL not accessible outside of the company network and it is not azure openai endpoint.

Since our URL is not azure, the SDK logic doesn't add required path segments and our calls have this url in the end:

https://BASE_URL/chat/completions

To make it working we have to hardcode values when building http client, so it makes us not possible to dynamic change deployment name:

private val client = OpenAIOkHttpClientAsync.Companion.builder()
        .baseUrl(endpoint + "/openai/deployments/gpt-4o-mini")
        .credential(AzureApiKeyCredential.create(apiKey))
        .azureServiceVersion(AzureOpenAIServiceVersion.latestStableVersion())
        .queryParams(QueryParams.builder().put("api-version", "2024-10-21").build())
        .build()

We'd like to have possibility to adjust final url of calls when invoke chat completions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions