orkes.services.UniversalLLMClient#

class orkes.services.UniversalLLMClient(config, provider)[source]#

A universal client for interacting with various LLM providers.

This client uses a strategy pattern to support different LLM providers, allowing for a consistent interface regardless of the underlying provider. It handles both synchronous and asynchronous requests, as well as streaming responses.

Parameters:
config#

The configuration for the LLM connection.

Type:

LLMConfig

provider#

The strategy for the specific LLM provider.

Type:

LLMProviderStrategy

session_headers#

The headers to use for the session.

Type:

Dict[str, str]

__init__(config, provider)[source]#

Initializes the UniversalLLMClient.

Parameters:
  • config (LLMConfig) – The configuration for the LLM connection.

  • provider (LLMProviderStrategy) – The strategy for the specific LLM provider.

Methods

__init__(config, provider)

Initializes the UniversalLLMClient.

health_check([endpoint])

Performs a health check on the LLM provider.

send_message(messages[, endpoint, tools, ...])

Sends a synchronous request to the LLM provider.

stream_message(messages[, endpoint, tools, ...])

Sends an asynchronous request to the LLM provider and streams the response.