Module: LLM::OpenAI::Format
- Included in:
- LLM::OpenAI, Responses
- Defined in:
- lib/llm/providers/openai/format.rb
Instance Method Summary collapse
Instance Method Details
#format(messages, mode) ⇒ Array<Hash>
13 14 15 16 17 18 19 20 21 |
# File 'lib/llm/providers/openai/format.rb', line 13 def format(, mode) .map do if Hash === _1 {role: _1[:role], content: format_content(_1[:content], mode)} else {role: _1.role, content: format_content(_1.content, mode)} end end end |