OpenAI icon indicating copy to clipboard operation
OpenAI copied to clipboard

feat: Add configurable endpoint option

Open udostm opened this issue 6 months ago • 2 comments

What

This PR adds fully customizable endpoint support. Instead of "just" adding basePath you can now pass a fully configured endpoint URL.

Why

Internal/hosted OpenAI Instances sometimes use different paths to host the OpenAI endpoint. Previous versions of the framework only allowed for changing scheme, host and port. As changing the basePath is a common requirement (and also supported by frameworks in other languages) this PR adds fully customisable endpoint support - incl. the basePath.

Affected Areas

  • Introduced a new initializer that accepts a fully configured endpoint: URL.
  • The existing initializer (accepting host, port, and scheme) remains available and now also configures the endpoint.
  • Converted the previously stored host, port, and scheme properties to computed properties based on the endpoint to maintain API compatibility.

udostm avatar Aug 01 '24 07:08 udostm