Class: OmniAI::OpenAI::Chat

Inherits:
Chat
  • Object
show all
Defined in:
lib/omniai/openai/chat.rb

Overview

An OpenAI chat implementation.

Usage:

completion = OmniAI::OpenAI::Chat.process!(client: client) do |prompt|
  prompt.system('You are an expert in the field of AI.')
  prompt.user('What are the biggest risks of AI?')
end
completion.choice.message.content # '...'

Defined Under Namespace

Modules: Model

Constant Summary collapse

JSON_RESPONSE_FORMAT =
{ type: 'json_object' }.freeze
DEFAULT_MODEL =
Model::GPT_4O