orkes.services.OpenAIStyleStrategy#

class orkes.services.OpenAIStyleStrategy[source]#

A strategy for interacting with LLM providers that follow the OpenAI API format.

This includes providers like OpenAI, vLLM, DeepSeek, and other compatible APIs.

__init__()#

Methods

__init__()

get_headers(api_key)

Returns the headers required for authentication with an OpenAI-style API.

get_messages_payload(messages)

Converts an OrkesMessagesSchema into the format expected by an OpenAI-style API.

get_tools_payload(tools)

Converts a list of OrkesToolSchema objects into the format expected by an OpenAI-style API.

parse_response(response_data)

Parses a response from an OpenAI-style API.

parse_stream_chunk(line)

Parses a single chunk of a streaming response from an OpenAI-style API.

prepare_payload(model, messages, stream, ...)

Prepares the full payload for a request to an OpenAI-style API.