Repository navigation
refactor: migrate llm providers to ai.common.LLMBase - #719
Conversation
📝 WalkthroughWalkthroughThe PR consolidates LLM provider node implementations by introducing a shared Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No description provided. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ai/src/ai/common/llm_base.py`:
- Around line 29-31: getTokenCounter currently returns the getTokens method
object instead of calling it; update getTokenCounter (decorated with
`@invoke_function`) to call self.IGlobal._chat.getTokens(...) with parentheses and
pass the correct value from the _param argument (e.g., _param.value or the
appropriate field) so the function returns the token count rather than the
method reference.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 46440d14-98b8-4890-a8df-7853605d1f6f
📒 Files selected for processing (21)
docs/README-nodes.mdnodes/src/nodes/accessibility_describe/IInstance.pynodes/src/nodes/llm_anthropic/IInstance.pynodes/src/nodes/llm_base/IInstance.pynodes/src/nodes/llm_base/__init__.pynodes/src/nodes/llm_bedrock/IInstance.pynodes/src/nodes/llm_deepseek/IInstance.pynodes/src/nodes/llm_gemini/IInstance.pynodes/src/nodes/llm_gmi_cloud/IInstance.pynodes/src/nodes/llm_ibm_watson/IInstance.pynodes/src/nodes/llm_mistral/IInstance.pynodes/src/nodes/llm_ollama/IInstance.pynodes/src/nodes/llm_openai/IInstance.pynodes/src/nodes/llm_openai_api/IInstance.pynodes/src/nodes/llm_perplexity/IInstance.pynodes/src/nodes/llm_qwen/IInstance.pynodes/src/nodes/llm_vertex/IInstance.pynodes/src/nodes/llm_vision_mistral/IInstance.pynodes/src/nodes/llm_vision_ollama/IInstance.pynodes/src/nodes/llm_xai/IInstance.pypackages/ai/src/ai/common/llm_base.py
💤 Files with no reviewable changes (2)
- nodes/src/nodes/llm_base/init.py
- nodes/src/nodes/llm_base/IInstance.py
Summary
Migrates LLMBase from nodes/llm_base/ into packages/ai/src/ai/common/llm_base.py as the single canonical base for all LLM providers. Removes the tight coupling where each module depended on a local llm_base.py, standardizing the interface (completion, token counting) on top of ChatBase (connection, retries, error handling).
Type
Testing
./builder testpassesChecklist
Linked Issue
Fixes #
close #720
Summary by CodeRabbit
Release Notes
Refactor
Documentation