Class: I18nContextGenerator::LLM::OpenAICompatible

Inherits:
OpenAI
  • Object
show all
Defined in:
lib/i18n_context_generator/llm/openai_compatible.rb

Overview

Explicit OpenAI Responses-compatible endpoint support. A separate credential variable prevents local or third-party endpoints from ever receiving the official OpenAI credential by accident.

Constant Summary collapse

DEFAULT_MODEL =
nil

Constants inherited from OpenAI

I18nContextGenerator::LLM::OpenAI::API_URL

Constants inherited from Client

Client::CONFIDENCE_LEVELS, Client::DEFAULT_MAX_PROMPT_CHARS, Client::MAX_AMBIGUITY_REASON_LENGTH, Client::MAX_DESCRIPTION_LENGTH, Client::MAX_OUTPUT_TOKENS, Client::MAX_TRANSLATION_LENGTH, Client::MIN_MAX_PROMPT_CHARS, Client::RESPONSE_FIELDS, Client::RESPONSE_SCHEMA, Client::SYSTEM_PROMPT, Client::TONES, Client::UI_ELEMENTS

Constants included from RequestPolicy

RequestPolicy::MAX_RETRIES, RequestPolicy::MAX_RETRY_DELAY, RequestPolicy::RETRYABLE_STATUS_CODES, RequestPolicy::TRANSIENT_NETWORK_ERRORS

Instance Method Summary collapse

Methods inherited from OpenAI

#generate_context

Methods inherited from Client

default_model_for, for, #generate_context, provider_class, #resolved_model, #validate_supplemental_context!

Constructor Details

#initialize(endpoint:) ⇒ OpenAICompatible

Returns a new instance of OpenAICompatible.



11
12
13
14
15
16
17
# File 'lib/i18n_context_generator/llm/openai_compatible.rb', line 11

def initialize(endpoint:)
  super(
    api_url: endpoint,
    api_key: ENV.fetch('OPENAI_COMPATIBLE_API_KEY', nil),
    require_api_key: false
  )
end