Replace None assignments with stub classes for optional dependencies#61
Draft
Replace None assignments with stub classes for optional dependencies#61
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- VertexAIEmbedder: Raises ImportError with instruction to install neo4j-agent-memory[vertex-ai] - Neo4jMemoryService: Raises ImportError with instruction to install neo4j-agent-memory[google-adk] - Neo4jMemoryMCPServer: Use existing stub class from mcp/server.py (no longer needs try/except) This addresses the poor UX issue where attempting to use unavailable features results in confusing "TypeError: 'NoneType' object is not callable" errors instead of clear ImportError messages with installation instructions. Co-authored-by: johnymontana <1222454+johnymontana@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add stub classes for ADK and Vertex AI integrations
Replace None assignments with stub classes for optional dependencies
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses feedback from #35 to improve error messages when optional Google Cloud dependencies are not installed.
Changes
Before: Conditional imports set classes to
Nonewhen dependencies are missing, causing confusingTypeError: 'NoneType' object is not callableerrors.After: Stub classes raise clear
ImportErrormessages with installation instructions on instantiation.Modified:
src/neo4j_agent_memory/__init__.pyImportErrorwithpip install neo4j-agent-memory[vertex-ai]ImportErrorwithpip install neo4j-agent-memory[google-adk]mcp/server.py(already implements this pattern)Example
Pattern follows existing implementation in
mcp/server.pylines 230-243.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.