mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
refactor(langchain): clean redundancy ifelse. (#37448)
Signed-off-by: zhanluxianshen <yanggangtony@163.com>
This commit is contained in:
@@ -867,11 +867,8 @@ def create_agent(
|
||||
initial_response_format: ToolStrategy[Any] | ProviderStrategy[Any] | AutoStrategy[Any] | None
|
||||
if response_format is None:
|
||||
initial_response_format = None
|
||||
elif isinstance(response_format, (ToolStrategy, ProviderStrategy)):
|
||||
# Preserve explicitly requested strategies
|
||||
initial_response_format = response_format
|
||||
elif isinstance(response_format, AutoStrategy):
|
||||
# AutoStrategy provided - preserve it for later auto-detection
|
||||
elif isinstance(response_format, (ToolStrategy, ProviderStrategy, AutoStrategy)):
|
||||
# Explicit Tool/Provider strategy, or AutoStrategy for later capability detection
|
||||
initial_response_format = response_format
|
||||
else:
|
||||
# Raw schema - wrap in AutoStrategy to enable auto-detection
|
||||
|
||||
Reference in New Issue
Block a user