- content
A string containing the user's input message.
- Model
A string specifying the GPT model to use (default: "gpt-4o-mini").
The function automatically handles parameter compatibility for newer models (o3, o1, gpt-4o series)
that require max_completion_tokens instead of max_tokens.
- temperature
A numeric value controlling the randomness of the model's output (default: 1).
- max_tokens
A numeric value specifying the maximum number of tokens to generate (default is 50).
- simple
Logical, if TRUE, only the content of the model's message will be returned.
- fromJSON_parsed
Logical, if TRUE, content will be parsed from JSON.
- system_prompt
A string containing the system message to set the context.
If provided, it will be added as the first message in the conversation.
Default is an empty string.
- api_key
A string containing the user's OpenAI API key.
Defaults to the value of the environment variable "OPENAI_API_KEY".