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:
Lorenze Jay
2025-03-12 14:56:47 -07:00
parent 902c330113
commit 80c31fb55b

View File

@@ -22,8 +22,8 @@ def create_llm(
A BaseLLM instance if successful, or None if something fails.
"""
# 1) If llm_value is already a BaseLLM object, return it directly
if isinstance(llm_value, LLM):
# 1) If llm_value is already a BaseLLM or LLM object, return it directly
if isinstance(llm_value, LLM) or isinstance(llm_value, BaseLLM):
return llm_value
# 2) If llm_value is a string (model name)