trait CreatesOpenAiCompatibleClient

Traits

Methods

createClient(string $baseUrl, array $headers = [], array $configuredHeaders = [], int|null $timeout = 60, bool $throw = true)

Create an HTTP client with the provider's request options.

string
httpConnection(Provider $provider)

Select a boot-registered connection without retaining dynamic provider names.

client(Provider $provider, int|null $timeout = null)

Get an HTTP client for the OpenAI-compatible API.

string
baseUrl(Provider $provider)

Get the base URL for the OpenAI-compatible API.

Details

in CreatesClient at line 21
protected PendingRequest createClient(string $baseUrl, array $headers = [], array $configuredHeaders = [], int|null $timeout = 60, bool $throw = true)

Create an HTTP client with the provider's request options.

Parameters

string $baseUrl
array $headers
array $configuredHeaders
int|null $timeout
bool $throw

Return Value

PendingRequest

in CreatesClient at line 43
protected string httpConnection(Provider $provider)

Select a boot-registered connection without retaining dynamic provider names.

Parameters

Provider $provider

Return Value

string

at line 19
protected PendingRequest client(Provider $provider, int|null $timeout = null)

Get an HTTP client for the OpenAI-compatible API.

Parameters

Provider $provider
int|null $timeout

Return Value

PendingRequest

at line 34
protected string baseUrl(Provider $provider)

Get the base URL for the OpenAI-compatible API.

Parameters

Provider $provider

Return Value

string