View module source on GitHub

MaximGeminiChatSession

class MaximGeminiChatSession(Chat)

Maxim Gemini chat session.

This class represents a Maxim wrapped Gemini chat session.

__init__

def __init__(chat: Chat,
             logger: Logger,
             trace_id: Optional[str] = None,
             is_local_trace: Optional[bool] = False)

Initialize a Maxim wrapped Gemini chat session.

Arguments:

NameDescription
chatThe chat.
loggerThe logger.
trace_idThe trace id.
is_local_traceWhether the trace is local.

send_message

@override
def send_message(
        message: Union[list[PartUnionDict], PartUnionDict],
        generation_name: Optional[str] = None) -> GenerateContentResponse

Send a message to the Maxim wrapped Gemini chat session.

Arguments:

NameDescription
messageThe message to send.
generation_nameThe name of the generation.

Returns:

NameDescription
GenerateContentResponseThe response from the Maxim wrapped Gemini chat session.

send_message_stream

@override
def send_message_stream(message: Union[list[PartUnionDict], PartUnionDict],
                        generation_name: Optional[str] = None)

Send a message to the Maxim wrapped Gemini chat session stream.

Arguments:

NameDescription
messageThe message to send.
generation_nameThe name of the generation.

__getattr__

def __getattr__(name: str) -> Any

Get an attribute from the chat session.

Arguments:

NameDescription
nameThe name of the attribute.

Returns:

NameDescription
AnyThe attribute.

__setattr__

def __setattr__(name: str, value: Any) -> None

Set an attribute on the chat session.

Arguments:

NameDescription
nameThe name of the attribute.
valueThe value of the attribute.

end_trace

def end_trace()

End the trace of the chat session.

This method will end the trace of the chat session if the trace id is not None and the trace is local.

MaximGeminiChats

class MaximGeminiChats(Chats)

Maxim Gemini chats.

This class represents a Maxim wrapped Gemini chats.

__init__

def __init__(chats: Chats, logger: Logger)

Initialize a Maxim wrapped Gemini chats.

Arguments:

NameDescription
chatsThe chats.
loggerThe logger.

create

@override
def create(*,
           model: str,
           config: GenerateContentConfigOrDict = None,
           history: Optional[list[Content]] = None,
           trace_id: Optional[str] = None,
           session_id: Optional[str] = None) -> Chat

Create a Maxim wrapped Gemini chat session.

Arguments:

NameDescription
modelThe model to use.
configThe config to use.
historyThe history to use.
trace_idThe trace id.
session_idThe session id.

Returns:

NameDescription
ChatThe Maxim wrapped Gemini chat session.

__getattr__

def __getattr__(name: str) -> Any

Get an attribute from the chats.

Arguments:

NameDescription
nameThe name of the attribute.

Returns:

NameDescription
AnyThe attribute.

__setattr__

def __setattr__(name: str, value: Any) -> None

Set an attribute on the chats.

Arguments:

NameDescription
nameThe name of the attribute.
valueThe value of the attribute.

MaximGeminiModels

class MaximGeminiModels(Models)

Maxim Gemini models.

This class represents a Maxim wrapped Gemini models.

__init__

def __init__(models: Models, logger: Logger)

Initialize a Maxim wrapped Gemini models.

Arguments:

NameDescription
modelsThe models.
loggerThe logger.

generate_content_stream

@override
def generate_content_stream(
    *,
    model: str,
    contents: Union[ContentListUnion, ContentListUnionDict],
    config: Optional[GenerateContentConfigOrDict] = None,
    trace_id: Optional[str] = None,
    generation_name: Optional[str] = None
) -> Iterator[GenerateContentResponse]

Generate content stream.

Arguments:

NameDescription
modelThe model to use.
contentsThe contents to use.
configThe config to use.
trace_idThe trace id.
generation_nameThe generation name.

Returns:

NameDescription
Iterator[GenerateContentResponse]The content stream.

generate_content

@override
def generate_content(
        *,
        model: str,
        contents: Union[ContentListUnion, ContentListUnionDict],
        config: Optional[GenerateContentConfigOrDict] = None,
        trace_id: Optional[str] = None,
        generation_name: Optional[str] = None) -> GenerateContentResponse

Generate content.

Arguments:

NameDescription
modelThe model to use.
contentsThe contents to use.
configThe config to use.
trace_idThe trace id.
generation_nameThe generation name.

Returns:

NameDescription
GenerateContentResponseThe content.

__getattr__

def __getattr__(name: str) -> Any

Get an attribute from the models.

Arguments:

NameDescription
nameThe name of the attribute.

Returns:

NameDescription
AnyThe attribute.

__setattr__

def __setattr__(name: str, value: Any) -> None

Set an attribute on the models.

Arguments:

NameDescription
nameThe name of the attribute.
valueThe value of the attribute.

MaximGeminiClient

class MaximGeminiClient(Client)

Maxim Gemini client.

This class represents a Maxim wrapped Gemini client.

__init__

def __init__(client: Client, logger: Logger)

Initialize a Maxim wrapped Gemini client.

Arguments:

NameDescription
clientThe client.
loggerThe logger.

chats

@property
def chats() -> MaximGeminiChats

Get the Maxim wrapped Gemini chats.

Returns:

NameDescription
[MaximGeminiChats](/sdk/python/references/logger/gemini/client)The Maxim wrapped Gemini chats.

aio

@property
def aio() -> MaximGeminiAsyncClient

Get the Maxim wrapped Gemini async client.

Returns:

NameDescription
[MaximGeminiAsyncClient](/sdk/python/references/logger/gemini/async_client)The Maxim wrapped Gemini async client.

models

@property
def models() -> MaximGeminiModels

Get the Maxim wrapped Gemini models.

Returns:

NameDescription
[MaximGeminiModels](/sdk/python/references/logger/gemini/client)The Maxim wrapped Gemini models.

__getattr__

def __getattr__(name: str) -> Any

Get an attribute from the client.

Arguments:

NameDescription
nameThe name of the attribute.

Returns:

NameDescription
AnyThe attribute.

__setattr__

def __setattr__(name: str, value: Any) -> None

Set an attribute on the client.

Arguments:

NameDescription
nameThe name of the attribute.
valueThe value of the attribute.