Skip to content

AI Actions

AI actions allow users to utilize models like OpenAI's ChatGPT and Google's Gemini.

Java must be installed on your machine if you want to upload files to the models.

Actions

openai_gpt

Sends a list of commands (prompt) to the specific model you provide.

Parameters:

model_name - String containing the name of the model you want to use.
messages - A list of dictionaries containing the message type, content type, and the actual content. Example.

In cases where the content type is 'System' or 'Human', the 'content_type' will always be 'text'. For the 'Midia' content type, the 'content_type' field represents the file type, and 'content' is the local path of the file on your machine.

api_key - String containing the unique credential used to authenticate and authorize API access to the model.
temperature - Float that controls the randomness or creativity of the generated responses. It affects how the model selects the next words based on the predicted probabilities (default = 0).
file_path - String containing the path to the Word file with the model's responses, if desired (default = None).
file_name - String containing the name of the Word file with the model's responses, if desired (default = "output.docx").

Returns:

chatbot_response - Content with the model's response.
file_path - Full path to the formatted Word file containing the model's response (this return depends on the "file_path" and "file_name" parameters).

Example

messages = [
    {
        "type": "System",
        "content_type": "text",
        "content": "You must analyze and translate all sent messages and all data in the uploaded files to Portuguese.",    
    },
    {
        "type": "Human",
        "content_type": "text",
        "content": "Marvin is here to save you time.",
    },
    {
        "type": "Midia",
        "content_type": "pdf",
        "content": "C://Marvin//hello_world.pdf",
    },
]