yipao.LLM.gemini.GoogleGenAi

class yipao.LLM.gemini.GoogleGenAi(model, api_key, temperature=0.1, **cfg)[source]

Class to handle interactions with Google’s generative AI models.

__init__(model, api_key, temperature=0.1, **cfg)[source]

Initialize the class with an optional config parameter.

Parameters:

config (any) – The configuration parameter.

Returns:

None

Methods

__init__(model, api_key[, temperature])

Initialize the class with an optional config parameter.

count_tokens(prompt)

Counts the number of tokens in a prompt.

invoke(prompt)

Submit a prompt to the model for generating a response.

monitor()

Provides the total count of input and output tokens processed.

validate_prompt(prompt)

Validates the prompt to ensure it is not empty.