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