``` ██████╗ ██████╗ ██╗ ██╗███████╗██████╗ ██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ ██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ ██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` # class Chat (Details) > namespace: **VDM\Joomla\Openai** > extends: **Api** ```uml @startuml class Chat #Gold { + create(string $model, array $messages, ...) : ?object } note right of Chat::create Create a chat completion with the OpenAI API. API Ref: https://platform.openai.com/docs/api-reference/chat/create Each item in the array is an object with the following: - role (string) Required The role of the author of this message. One of system, user, or assistant. - content (string) Required The contents of the message. - name (string) Optional The name of the author of this message. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters. since: 3.2.0 return: ?object arguments: string $model array $messages ?int $maxTokens = null ?float $temperature = null ?float $topP = null ?int $n = null ?bool $stream = null mixed|null $stop = null ?float $presencePenalty = null ?float $frequencyPenalty = null ?array $logitBias = null ?string $user = null end note @enduml ``` --- ``` ██╗ ██████╗██████╗ ██║██╔════╝██╔══██╗ ██║██║ ██████╔╝ ██ ██║██║ ██╔══██╗ ╚█████╔╝╚██████╗██████╔╝ ╚════╝ ╚═════╝╚═════╝ ``` > Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)