mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Enhance create_llm function to support BaseLLM type
- Update the create_llm function to accept both LLM and BaseLLM instances - Ensure compatibility with existing LLM handling logic
This commit is contained in:
@@ -22,8 +22,8 @@ def create_llm(
|
|||||||
A BaseLLM instance if successful, or None if something fails.
|
A BaseLLM instance if successful, or None if something fails.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# 1) If llm_value is already a BaseLLM object, return it directly
|
# 1) If llm_value is already a BaseLLM or LLM object, return it directly
|
||||||
if isinstance(llm_value, LLM):
|
if isinstance(llm_value, LLM) or isinstance(llm_value, BaseLLM):
|
||||||
return llm_value
|
return llm_value
|
||||||
|
|
||||||
# 2) If llm_value is a string (model name)
|
# 2) If llm_value is a string (model name)
|
||||||
|
|||||||
Reference in New Issue
Block a user