- Add detailed docstrings to AgentNode, BasicRecursionFilterNode, and DocumentChunkRecursionFilterNode for clarity and documentation. - Improve input validation and error handling in agent nodes. - Update .gitignore to cover more environment, config, and IDE files. - Refactor LiteLLMCustomEndpointProvider for custom API endpoints. - Add conditional imports and dummy functions for LightRAG when unavailable. - Update config.yaml to use environment variables for API keys and clarify usage. - Refine requirements.txt to avoid heavy LightRAG dependencies. - Add tests/__init__.py with test suite metadata; remove redundant test files. - Fix CustomDict import and model config handling in litellmnodes.py. - Improve chunk processing and recursion filter logic in agent nodes. - Update utils/__init__.py to include env_config.
25 lines
928 B
Python
Executable File
25 lines
928 B
Python
Executable File
# for support of being installed by ComfyUI-Manager
|
|
import sys
|
|
import os.path
|
|
import subprocess
|
|
|
|
custom_nodes_path = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
def build_pip_install_cmds(args):
|
|
if "python_embeded" in sys.executable or "python_embedded" in sys.executable:
|
|
return [sys.executable, '-s', '-m', 'pip', 'install'] + args
|
|
else:
|
|
return [sys.executable, '-m', 'pip', 'install'] + args
|
|
|
|
|
|
def ensure_package():
|
|
cmds = build_pip_install_cmds(['-r', 'requirements.txt'])
|
|
subprocess.run(cmds, cwd=custom_nodes_path)
|
|
|
|
|
|
# ensure_package() #no longer needed
|
|
# here we will remind the user that their keys should be in the env vars and not saved to the graph
|
|
print("ComfyUI_LiteLLM: Please ensure that your keys are stored in environment variables and do not save to the graph.")
|
|
print("ComfyUI_LiteLLM: You can at your discretion put them in the config.yaml file, but it is not recommended.")
|