Class: RubyLLM::Configuration
- Inherits:
-
Object
- Object
- RubyLLM::Configuration
- Defined in:
- lib/ruby_llm/configuration.rb
Overview
Global configuration for RubyLLM
Instance Attribute Summary collapse
-
#anthropic_api_key ⇒ Object
Returns the value of attribute anthropic_api_key.
-
#bedrock_api_key ⇒ Object
Returns the value of attribute bedrock_api_key.
-
#bedrock_region ⇒ Object
Returns the value of attribute bedrock_region.
-
#bedrock_secret_key ⇒ Object
Returns the value of attribute bedrock_secret_key.
-
#bedrock_session_token ⇒ Object
Returns the value of attribute bedrock_session_token.
-
#deepseek_api_key ⇒ Object
Returns the value of attribute deepseek_api_key.
-
#default_embedding_model ⇒ Object
Returns the value of attribute default_embedding_model.
-
#default_image_model ⇒ Object
Returns the value of attribute default_image_model.
-
#default_model ⇒ Object
Returns the value of attribute default_model.
-
#default_moderation_model ⇒ Object
Returns the value of attribute default_moderation_model.
-
#default_transcription_model ⇒ Object
Returns the value of attribute default_transcription_model.
-
#gemini_api_base ⇒ Object
Returns the value of attribute gemini_api_base.
-
#gemini_api_key ⇒ Object
Returns the value of attribute gemini_api_key.
-
#gpustack_api_base ⇒ Object
Returns the value of attribute gpustack_api_base.
-
#gpustack_api_key ⇒ Object
Returns the value of attribute gpustack_api_key.
-
#http_proxy ⇒ Object
Returns the value of attribute http_proxy.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#log_stream_debug ⇒ Object
Returns the value of attribute log_stream_debug.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#mistral_api_key ⇒ Object
Returns the value of attribute mistral_api_key.
-
#model_registry_class ⇒ Object
Returns the value of attribute model_registry_class.
-
#model_registry_file ⇒ Object
Returns the value of attribute model_registry_file.
-
#ollama_api_base ⇒ Object
Returns the value of attribute ollama_api_base.
-
#openai_api_base ⇒ Object
Returns the value of attribute openai_api_base.
-
#openai_api_key ⇒ Object
Returns the value of attribute openai_api_key.
-
#openai_organization_id ⇒ Object
Returns the value of attribute openai_organization_id.
-
#openai_project_id ⇒ Object
Returns the value of attribute openai_project_id.
-
#openai_use_system_role ⇒ Object
Returns the value of attribute openai_use_system_role.
-
#openrouter_api_key ⇒ Object
Returns the value of attribute openrouter_api_key.
-
#perplexity_api_key ⇒ Object
Returns the value of attribute perplexity_api_key.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
-
#retry_backoff_factor ⇒ Object
Returns the value of attribute retry_backoff_factor.
-
#retry_interval ⇒ Object
Returns the value of attribute retry_interval.
-
#retry_interval_randomness ⇒ Object
Returns the value of attribute retry_interval_randomness.
-
#use_new_acts_as ⇒ Object
Returns the value of attribute use_new_acts_as.
-
#vertexai_location ⇒ Object
Returns the value of attribute vertexai_location.
-
#vertexai_project_id ⇒ Object
Returns the value of attribute vertexai_project_id.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #instance_variables ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/ruby_llm/configuration.rb', line 51 def initialize @request_timeout = 300 @max_retries = 3 @retry_interval = 0.1 @retry_backoff_factor = 2 @retry_interval_randomness = 0.5 @http_proxy = nil @default_model = 'gpt-4.1-nano' = 'text-embedding-3-small' @default_moderation_model = 'omni-moderation-latest' @default_image_model = 'gpt-image-1' @default_transcription_model = 'whisper-1' @model_registry_file = File.('models.json', __dir__) @model_registry_class = 'Model' @use_new_acts_as = false @log_file = $stdout @log_level = ENV['RUBYLLM_DEBUG'] ? Logger::DEBUG : Logger::INFO @log_stream_debug = ENV['RUBYLLM_STREAM_DEBUG'] == 'true' end |
Instance Attribute Details
#anthropic_api_key ⇒ Object
Returns the value of attribute anthropic_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def anthropic_api_key @anthropic_api_key end |
#bedrock_api_key ⇒ Object
Returns the value of attribute bedrock_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def bedrock_api_key @bedrock_api_key end |
#bedrock_region ⇒ Object
Returns the value of attribute bedrock_region.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def bedrock_region @bedrock_region end |
#bedrock_secret_key ⇒ Object
Returns the value of attribute bedrock_secret_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def bedrock_secret_key @bedrock_secret_key end |
#bedrock_session_token ⇒ Object
Returns the value of attribute bedrock_session_token.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def bedrock_session_token @bedrock_session_token end |
#deepseek_api_key ⇒ Object
Returns the value of attribute deepseek_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def deepseek_api_key @deepseek_api_key end |
#default_embedding_model ⇒ Object
Returns the value of attribute default_embedding_model.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def end |
#default_image_model ⇒ Object
Returns the value of attribute default_image_model.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def default_image_model @default_image_model end |
#default_model ⇒ Object
Returns the value of attribute default_model.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def default_model @default_model end |
#default_moderation_model ⇒ Object
Returns the value of attribute default_moderation_model.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def default_moderation_model @default_moderation_model end |
#default_transcription_model ⇒ Object
Returns the value of attribute default_transcription_model.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def default_transcription_model @default_transcription_model end |
#gemini_api_base ⇒ Object
Returns the value of attribute gemini_api_base.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def gemini_api_base @gemini_api_base end |
#gemini_api_key ⇒ Object
Returns the value of attribute gemini_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def gemini_api_key @gemini_api_key end |
#gpustack_api_base ⇒ Object
Returns the value of attribute gpustack_api_base.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def gpustack_api_base @gpustack_api_base end |
#gpustack_api_key ⇒ Object
Returns the value of attribute gpustack_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def gpustack_api_key @gpustack_api_key end |
#http_proxy ⇒ Object
Returns the value of attribute http_proxy.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def http_proxy @http_proxy end |
#log_file ⇒ Object
Returns the value of attribute log_file.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def log_file @log_file end |
#log_level ⇒ Object
Returns the value of attribute log_level.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def log_level @log_level end |
#log_stream_debug ⇒ Object
Returns the value of attribute log_stream_debug.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def log_stream_debug @log_stream_debug end |
#logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def logger @logger end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def max_retries @max_retries end |
#mistral_api_key ⇒ Object
Returns the value of attribute mistral_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def mistral_api_key @mistral_api_key end |
#model_registry_class ⇒ Object
Returns the value of attribute model_registry_class.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def model_registry_class @model_registry_class end |
#model_registry_file ⇒ Object
Returns the value of attribute model_registry_file.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def model_registry_file @model_registry_file end |
#ollama_api_base ⇒ Object
Returns the value of attribute ollama_api_base.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def ollama_api_base @ollama_api_base end |
#openai_api_base ⇒ Object
Returns the value of attribute openai_api_base.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def openai_api_base @openai_api_base end |
#openai_api_key ⇒ Object
Returns the value of attribute openai_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def openai_api_key @openai_api_key end |
#openai_organization_id ⇒ Object
Returns the value of attribute openai_organization_id.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def openai_organization_id @openai_organization_id end |
#openai_project_id ⇒ Object
Returns the value of attribute openai_project_id.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def openai_project_id @openai_project_id end |
#openai_use_system_role ⇒ Object
Returns the value of attribute openai_use_system_role.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def openai_use_system_role @openai_use_system_role end |
#openrouter_api_key ⇒ Object
Returns the value of attribute openrouter_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def openrouter_api_key @openrouter_api_key end |
#perplexity_api_key ⇒ Object
Returns the value of attribute perplexity_api_key.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def perplexity_api_key @perplexity_api_key end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def request_timeout @request_timeout end |
#retry_backoff_factor ⇒ Object
Returns the value of attribute retry_backoff_factor.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def retry_backoff_factor @retry_backoff_factor end |
#retry_interval ⇒ Object
Returns the value of attribute retry_interval.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def retry_interval @retry_interval end |
#retry_interval_randomness ⇒ Object
Returns the value of attribute retry_interval_randomness.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def retry_interval_randomness @retry_interval_randomness end |
#use_new_acts_as ⇒ Object
Returns the value of attribute use_new_acts_as.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def use_new_acts_as @use_new_acts_as end |
#vertexai_location ⇒ Object
Returns the value of attribute vertexai_location.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def vertexai_location @vertexai_location end |
#vertexai_project_id ⇒ Object
Returns the value of attribute vertexai_project_id.
6 7 8 |
# File 'lib/ruby_llm/configuration.rb', line 6 def vertexai_project_id @vertexai_project_id end |
Instance Method Details
#instance_variables ⇒ Object
74 75 76 |
# File 'lib/ruby_llm/configuration.rb', line 74 def instance_variables super.reject { |ivar| ivar.to_s.match?(/_id|_key|_secret|_token$/) } end |