Module: RubyLLM::Providers::Perplexity::Chat
- Included in:
- RubyLLM::Providers::Perplexity
- Defined in:
- lib/ruby_llm/providers/perplexity/chat.rb
Overview
Chat formatting for Perplexity provider
Class Method Summary collapse
Class Method Details
.format_messages(messages) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ruby_llm/providers/perplexity/chat.rb', line 14 def () .map do |msg| { role: format_role(msg.role), content: Perplexity::Media.format_content(msg.content), tool_calls: OpenAI::Tools.format_tool_calls(msg.tool_calls), tool_call_id: msg.tool_call_id }.compact.merge(OpenAI::Chat.format_thinking(msg)) end end |
.format_role(role) ⇒ Object
10 11 12 |
# File 'lib/ruby_llm/providers/perplexity/chat.rb', line 10 def format_role(role) role.to_s end |