gemini.AsyncClient
Async_Client utilities for google gemini model integration and logging utilities.
MaximGeminiAsyncChatSession
Maxim Gemini async chat session.
This class represents a maxim gemini async chat session.
__init__
Initialize a maxim gemini async chat session.
Arguments:
Name | Description |
---|---|
chat | The chat. |
logger | The logger. |
trace_id | The trace id. |
is_local_trace | Whether the trace is local. |
send_message
Send a message to the chat.
Arguments:
Name | Description |
---|---|
message | The message to send. |
generation_name | The name of the generation. |
Returns:
Name | Description |
---|---|
GenerateContentResponse | The response from the chat. |
send_message_stream
Send a message to the chat stream.
Arguments:
Name | Description |
---|---|
message | The message to send. |
generation_name | The name of the generation. |
Returns:
Name | Description |
---|---|
Awaitable[AsyncIterator[GenerateContentResponse]] | The response from the chat. |
__getattr__
Get an attribute from the chat.
Arguments:
Name | Description |
---|---|
name | The name of the attribute. |
Returns:
Name | Description |
---|---|
Any | The attribute. |
__setattr__
Set an attribute on the chat.
Arguments:
Name | Description |
---|---|
name | The name of the attribute. |
value | The value of the attribute. |
end_trace
End the trace.
This method ends the trace if it is local and the trace id is not None.
MaximGeminiAsyncChats
Maxim Gemini async chats.
This class represents a maxim gemini async chats.
__init__
Initialize a maxim gemini async chats.
create
Create a chat session.
Arguments:
Name | Description |
---|---|
model | The model to use. |
config | The config to use. |
history | The history to use. |
trace_id | The trace id. |
Returns:
Name | Description |
---|---|
AsyncChat | The chat session. |
__getattr__
Get an attribute from the chats.
Arguments:
Name | Description |
---|---|
name | The name of the attribute. |
Returns:
Name | Description |
---|---|
Any | The attribute. |
__setattr__
Set an attribute on the chats.
Arguments:
Name | Description |
---|---|
name | The name of the attribute. |
value | The value of the attribute. |
MaximGeminiAsyncModels
Maxim Gemini async models.
This class represents a maxim gemini async models.
__init__
Initialize a maxim gemini async models.
Arguments:
Name | Description |
---|---|
models | The models. |
logger | The logger. |
generate_content_stream
Generate content stream.
Arguments:
Name | Description |
---|---|
model | The model to use. |
contents | The contents to use. |
config | The config to use. |
trace_id | The trace id. |
generation_name | The generation name. |
Returns:
Name | Description |
---|---|
Awaitable[AsyncIterator[GenerateContentResponse]] | The response from the models. |
generate_content
Generate content.
Arguments:
Name | Description |
---|---|
model | The model to use. |
contents | The contents to use. |
config | The config to use. |
trace_id | The trace id. |
generation_name | The generation name. |
Returns:
Name | Description |
---|---|
GenerateContentResponse | The response from the models. |
__getattr__
Get an attribute from the models.
Arguments:
Name | Description |
---|---|
name | The name of the attribute. |
Returns:
Name | Description |
---|---|
Any | The attribute. |
__setattr__
Set an attribute on the models.
Arguments:
Name | Description |
---|---|
name | The name of the attribute. |
value | The value of the attribute. |
MaximGeminiAsyncClient
Maxim Gemini async client.
This class represents a maxim gemini async client.
__init__
Initialize a maxim gemini async client.
Arguments:
Name | Description |
---|---|
client | The client. |
logger | The logger. |
__getattr__
Get an attribute from the client.
Arguments:
Name | Description |
---|---|
name | The name of the attribute. |
Returns:
Name | Description |
---|---|
Any | The attribute. |
__setattr__
Set an attribute on the client.
Arguments:
Name | Description |
---|---|
name | The name of the attribute. |
value | The value of the attribute. |