Top Level Namespace
Defined Under Namespace
Modules: Durable
Instance Method Summary collapse
-
#DLLM(provider, **options) ⇒ Durable::Llm::Client
Shorter alias for DurableLlm.
-
#DurableLlm(provider, **options) ⇒ Durable::Llm::Client
Creates a new Durable LLM client with the specified provider and options.
-
#LlmChat(messages, provider: :openai, model: nil, **options) ⇒ Object
Performs a chat completion with minimal setup.
-
#LlmComplete(text, provider: :openai, model: nil, **options) ⇒ String
Performs a quick text completion with minimal setup.
-
#LlmConfigure {|configuration| ... } ⇒ void
Configures Durable LLM with a block.
-
#LlmModels(provider = :openai, **options) ⇒ Array<String>
Lists available models for a provider.
Instance Method Details
#DLLM(provider, **options) ⇒ Durable::Llm::Client
Shorter alias for DurableLlm
34 35 36 |
# File 'lib/durable/llm/convenience.rb', line 34 def DLLM(provider, **) Durable::Llm.new(provider, ) end |
#DurableLlm(provider, **options) ⇒ Durable::Llm::Client
Creates a new Durable LLM client with the specified provider and options.
This is a global convenience function that provides quick access to client creation without requiring the full Durable::Llm module path. It's equivalent to calling Durable::Llm.new(provider, options).
24 25 26 |
# File 'lib/durable/llm/convenience.rb', line 24 def DurableLlm(provider, **) Durable::Llm.new(provider, ) end |
#LlmChat(messages, provider: :openai, model: nil, **options) ⇒ Object
Performs a chat completion with minimal setup
This global convenience function allows for quick chat interactions without explicit client creation.
70 71 72 |
# File 'lib/durable/llm/convenience.rb', line 70 def LlmChat(, provider: :openai, model: nil, **) Durable::Llm.chat(, provider: provider, model: model, **) end |
#LlmComplete(text, provider: :openai, model: nil, **options) ⇒ String
Performs a quick text completion with minimal setup
This global convenience function allows for one-line LLM completions without explicit client creation. Perfect for scripts and REPL usage.
53 54 55 |
# File 'lib/durable/llm/convenience.rb', line 53 def LlmComplete(text, provider: :openai, model: nil, **) Durable::Llm.complete(text, provider: provider, model: model, **) end |
#LlmConfigure {|configuration| ... } ⇒ void
This method returns an undefined value.
Configures Durable LLM with a block
This global convenience function provides easy access to configuration.
98 99 100 |
# File 'lib/durable/llm/convenience.rb', line 98 def LlmConfigure(&block) Durable::Llm.configure(&block) end |