Module: RubyLLM::Providers::Azure::Chat

Included in:
RubyLLM::Providers::Azure
Defined in:
lib/ruby_llm/providers/azure/chat.rb

Overview

Chat methods of the Azure AI Foundry API integration

Instance Method Summary collapse

Instance Method Details

#completion_urlObject



8
9
10
# File 'lib/ruby_llm/providers/azure/chat.rb', line 8

def completion_url
  'models/chat/completions?api-version=2024-05-01-preview'
end

#format_messages(messages) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/ruby_llm/providers/azure/chat.rb', line 12

def format_messages(messages)
  messages.map do |msg|
    {
      role: format_role(msg.role),
      content: Media.format_content(msg.content),
      tool_calls: format_tool_calls(msg.tool_calls),
      tool_call_id: msg.tool_call_id
    }.compact.merge(format_thinking(msg))
  end
end

#format_role(role) ⇒ Object



23
24
25
# File 'lib/ruby_llm/providers/azure/chat.rb', line 23

def format_role(role)
  role.to_s
end