feat(tools): add lkr tools agents commands for multi-engine Gemini Enterprise agent management - #50
Conversation
…terprise agent management
There was a problem hiding this comment.
Code Review
This pull request introduces a new set of CLI tools and SDK methods for managing Looker Conversational Analytics (CA) agents with Gemini Enterprise. It adds the lkr tools agents command group with subcommands to publish, delete, and list agents, supported by new endpoints in ExtendedLooker40SDK and tracked via Looker Artifacts. Additionally, it updates documentation, pre-commit hooks, and adds comprehensive tests. The review feedback highlights several robustness improvements in lkr/tools/agents.py, specifically handling potential AttributeErrors when parsing API responses or metadata, and wrapping SDK calls in try...except blocks to prevent unhandled exceptions from crashing the CLI. All review comments are valid and should be addressed to ensure the stability of the CLI.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new agents command group under lkr tools to manage Looker Conversational Analytics (CA) and Gemini Enterprise agents, including commands for publishing, deleting, and listing agents. It also adds corresponding extended SDK methods, CLI documentation, and comprehensive unit tests. The feedback highlights a potential AttributeError in lkr/tools/agents.py when retrieving nested dictionary keys if a parent key is explicitly set to None, and suggests using pydash.get to safely resolve the path.
Summary
ExtendedLooker40SDKGemini Enterprise Agent Methods:GeminiEnterpriseAgentRequestwith numeric validation onge_gcp_project_number(ensuring a numeric GCP project number is passed and stored as astr).publish_agent,get_published_agent,update_published_agent,unpublish_agent,validate_gemini_enterprise_metadata, andget_gemini_enablement.lkr tools agentsCLI (publish,list,delete):lkr tools agents publish: Publishes a Looker Conversational Analytics (CA) agent to the default or a secondary Gemini Enterprise app (--project-number,--location,--engine-id,--validate), records publication state in Looker's Artifact Store (lkr-dev-cli-tools-agents), and catches"Failed to register agent with GE"to fetchai_ge_service_account_emailand instruct the user to assign a Gemini Enterprise user license in Gemini Enterprise > Manage Users.lkr tools agents list: Merges and deduplicates records across Looker Artifacts, live Discovery Engine A2A agent cards (when--gcp-tokenis provided), and Looker's singleton configuration, reconciling UI deletions back to Looker Artifacts by default (--update-artifact / --no-update-artifact).lkr tools agents delete: Unpublishes agents from the default Looker-configured Gemini Enterprise app or deletes them directly from secondary Discovery Engine apps and updates the Looker Artifact Store.uv tool install/uv tool upgradeandlkr tools agentsinREADME.mdand regeneratedlkr.md.tests/test_agents_tools.pyandtests/test_extended_sdk_methods.py.