mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-14 23:12:37 +00:00
azure working
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user