mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-16 08:24:45 +00:00
FIX: include_usage is not available in the Azure API. (#648)
Follow-up #618
This commit is contained in:
parent
b487de933d
commit
bd1490a536
@ -107,7 +107,10 @@ module DiscourseAi
|
||||
|
||||
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?
|
||||
|
Loading…
x
Reference in New Issue
Block a user