Module: Legion::Extensions::Llm::AzureFoundry::ProviderDispatchMethods
- Included in:
- Provider
- Defined in:
- lib/legion/extensions/llm/azure_foundry/provider.rb
Overview
Public dispatch methods — chat, stream, embed. count_tokens inherits the base heuristic (Integer estimate, 05 §2) — the operation's support is carried by the SSOT data plane (writer operation evidence + WorkerExecution.require_supported!), not by a per-call artifact.
Canonical boundary (N x N law): the shared lex-llm enforce_canonical_messages! helper runs at every message-operation entry (08 F2, 12/O05 — one shared helper, called at every operation entry). Pipeline dispatch (direct SelectionDispatch, fleet worker rehydration) delivers Canonical::Message objects and nothing else; plain Hashes are the bypass class (the 2026-08-19 incident) — rejected loudly, never silently coerced. The model travels as the Selection-derived String, untouched (08 F3, B4); sampling params travel as Canonical::Params (05 O4).
Instance Method Summary collapse
- #chat(messages, model:, **options) ⇒ Object
- #embed(text:, model:, **options) ⇒ Object
- #stream(messages, model:, **options) ⇒ Object
Instance Method Details
#chat(messages, model:, **options) ⇒ Object
72 73 74 75 76 77 78 |
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 72 def chat(, model:, **) () log.info { "chat request model=#{model} messages=#{.size}" } complete(, tools: .fetch(:tools, {}), model: model, params: canonical_params(), tool_prefs: [:tool_prefs]) end |
#embed(text:, model:, **options) ⇒ Object
88 89 90 91 92 93 94 95 |
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 88 def (text:, model:, **) enforce_model_allowed!(model) log.info { "embed request model=#{model}" } payload = (text, model: model_id(model), dimensions: [:dimensions]) payload[:input_type] = [:input_type] if [:input_type] response = connection.post((model:), payload) (response, model: model_id(model), text:) end |
#stream(messages, model:, **options) ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 80 def stream(, model:, **, &) () log.info { "stream request model=#{model} messages=#{.size}" } complete(, tools: .fetch(:tools, {}), model: model, params: canonical_params(), tool_prefs: [:tool_prefs], &) end |