Class: RubyLLM::Providers::Azure::ChatCompletions

Inherits:
RubyLLM::Protocols::ChatCompletions show all
Includes:
Audio, Chat, Embeddings, Images, Media, Models, Videos
Defined in:
lib/ruby_llm/providers/azure/chat_completions.rb,
lib/ruby_llm/providers/azure/chat_completions/batches.rb

Overview

Azure's dialect of the Chat Completions API. Endpoints depend on how the configured api_base is shaped (deployment, resource, or openai/v1).

Defined Under Namespace

Modules: Batches

Constant Summary

Constants included from Videos

Videos::API_VERSION

Instance Attribute Summary

Attributes inherited from RubyLLM::Protocol

#config, #connection, #model, #provider

Instance Method Summary collapse

Methods included from Audio

#speech_url, #transcription_url

Methods included from Images

#images_url, #json_image_references?, #render_edit_payload

Methods included from Videos

#download_video, #parse_video_job, #parse_video_job_status, #render_video_payload, #video_job_url, #video_url

Methods included from Models

#azure_inference_retired?, #azure_modalities, #azure_model, #models_url, #parse_list_models_response

Methods included from Media

format_content, format_image

Methods included from Embeddings

embedding_url, render_embedding_payload

Methods included from Chat

#completion_url, #format_content, #format_role

Methods inherited from RubyLLM::Protocol

abstract, #animate_later, #apply_compaction, #apply_compaction_headers, #apply_end_user, #cache_content, #compact, #complete, #count_tokens, #delete_cache, #embed, #extend_cache, #find_cache, #initialize, #list_models, #moderate, #ocr, #paint, #parse_error, #parse_image_responses, #post_image, #post_video, #preprocess_message, #raise_transcription_streaming_unsupported, #refresh_video_job, #render, #render_embedding, #render_transcription_options, #render_video_extension_payload, #rerank, #server_tool_aliases, #speak, #stream_speech, #stream_speech_response, #stream_transcription, #supports_embedding_media?, #tokenize, #tool_approval_response, #transcribe, #video_extension_attachment, #video_extension_url, #video_request_url

Methods included from RubyLLM::Protocol::BinaryStreaming

#stream_binary

Methods included from RubyLLM::Protocol::Streaming

build_on_data_handler, build_stream_error_response, error_chunk?, failed_http_status, faraday_1?, handle_data, handle_error_chunk, handle_error_event, handle_failed_response, handle_json_error_chunk, handle_sse, handle_stream, json_error_payload?, parse_error_from_json, parse_streaming_error, process_stream_chunk, raise_stream_error, stream_events, stream_response, stream_state

Constructor Details

This class inherits a constructor from RubyLLM::Protocol

Instance Method Details

#azure_endpoint(kind) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ruby_llm/providers/azure/chat_completions.rb', line 17

def azure_endpoint(kind)
  parts = azure_base_parts

  case kind
  when :chat
    chat_endpoint(parts)
  when :embeddings
    embeddings_endpoint(parts)
  when :models
    models_endpoint(parts)
  else
    raise ArgumentError, "Unknown Azure endpoint kind: #{kind.inspect}"
  end
end