Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/completions/endpoints/open_ai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def prepare_payload(prompt, model_params, dialect)

if @streaming_mode
payload[:stream] = true
payload[:stream_options] = { include_usage: true }

# Usage is not available in Azure yet.
# We'll fallback to guess this using the tokenizer.
payload[:stream_options] = { include_usage: true } if model_uri.host.exclude?("azure")
end

payload[:tools] = dialect.tools if dialect.tools.present?
Expand Down