orkes.services.GoogleGeminiStrategy#

class orkes.services.GoogleGeminiStrategy[source]#

A strategy for interacting with the Google Gemini REST API.

__init__()#

Methods

__init__()

get_headers(api_key)

Returns the headers required for authentication with the Google Gemini API.

get_messages_payload(messages)

Converts an OrkesMessagesSchema into the format expected by the Google Gemini API.

get_tools_payload(tools)

Converts a list of OrkesToolSchema objects into the format expected by the Google Gemini API.

parse_response(response_data)

Parses a response from the Google Gemini API.

parse_stream_chunk(line)

Parses a single chunk of a streaming response from the Google Gemini API.

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

Prepares the full payload for a request to the Google Gemini API.