azure working

This commit is contained in:
lorenzejay
2026-01-29 15:45:16 -08:00
parent 0e84dc1cbb
commit 50660d0dc8

View File

@@ -622,16 +622,6 @@ class AzureCompletion(BaseLLM):
usage = self._extract_azure_token_usage(response)
self._track_token_usage_internal(usage)
if response_model and self.is_openai_model:
content = message.content or ""
return self._validate_and_emit_structured_output(
content=content,
response_model=response_model,
params=params,
from_task=from_task,
from_agent=from_agent,
)
# If there are tool_calls but no available_functions, return the tool_calls
# This allows the caller (e.g., executor) to handle tool execution
if message.tool_calls and not available_functions:
@@ -674,6 +664,15 @@ class AzureCompletion(BaseLLM):
# Apply stop words
content = self._apply_stop_words(content)
if response_model and self.is_openai_model:
return self._validate_and_emit_structured_output(
content=content,
response_model=response_model,
params=params,
from_task=from_task,
from_agent=from_agent,
)
# Emit completion event and return content
self._emit_call_completed_event(
response=content,