-
Notifications
You must be signed in to change notification settings - Fork 1
fix: add Colab logging and make catalog initialization use defaults #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
- Added Colab-specific logging that uses sys.stdout instead of stderr - Changed agentc.Catalog() to use no parameters (will use .env or defaults) - This prevents connection errors when AGENT_CATALOG_* vars are not set 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Fixed critical Colab connection issues across all 3 agent notebooks:
1. Connection String Protocol:
- Added automatic couchbases:// protocol prepending to connection strings
- Capella API returns hostname only, missing protocol prefix
- Prevents UnAmbiguousTimeoutException during cluster connection
2. Environment Variable Preservation:
- Added CB_CONN_STRING, CB_USERNAME, CB_PASSWORD, CB_BUCKET to .env file
- Prevents dotenv.load_dotenv(override=True) from wiping CB_* vars
- Ensures database credentials persist across notebook cells
3. Standardized .agentcignore:
- Synchronized .agentcignore across all agents to minimal set
- Added wget commands to download .agentcignore in hotel and landmark notebooks
4. Updated Agent Catalog wheels:
- Upgraded from v0.2.5a2 to v0.2.5a3 in hotel and landmark notebooks
- Ensures consistent version across all agents
Changes applied to:
- flight_search_agent_langraph/flight_search_agent_tutorial.{ipynb,json}
- hotel_search_agent_langchain/hotel_search_agent_tutorial.{ipynb,json}
- hotel_search_agent_langchain/.agentcignore
- landmark_search_agent_llamaindex/landmark_search_agent_tutorial.{ipynb,json}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
…tion failure
Fixed "No embeddings service could be initialized" error by adding CAPELLA_API_*
variables to .env file across all notebooks.
Root Cause:
- Infrastructure setup cells set CAPELLA_API_* env vars (endpoint, keys, models)
- Later cells call dotenv.load_dotenv(override=True)
- This wiped CAPELLA_API_* vars because they weren't in .env file
- AI service initialization failed without credentials
Changes:
- Added 7 CAPELLA_API_* variables to .env file write section:
* CAPELLA_API_ENDPOINT
* CAPELLA_API_EMBEDDING_ENDPOINT
* CAPELLA_API_LLM_ENDPOINT
* CAPELLA_API_EMBEDDINGS_KEY
* CAPELLA_API_LLM_KEY
* CAPELLA_API_EMBEDDING_MODEL
* CAPELLA_API_LLM_MODEL
This ensures AI service credentials persist across notebook cells.
Updated notebooks:
- flight_search_agent_langraph/flight_search_agent_tutorial.{ipynb,json}
- hotel_search_agent_langchain/hotel_search_agent_tutorial.{ipynb,json}
- landmark_search_agent_llamaindex/landmark_search_agent_tutorial.{ipynb,json}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Introduced a new section in the tutorial notebooks to allow users to configure optional API keys for OpenAI and Arize Phoenix. This includes prompts for entering API keys and appending them to the .env file for persistent access. The changes enhance the observability and fallback capabilities of the agents.
Updated notebooks:
- flight_search_agent_langraph/flight_search_agent_tutorial.{ipynb,json}
- hotel_search_agent_langchain/hotel_search_agent_tutorial.{ipynb,json}
- landmark_search_agent_llamaindex/landmark_search_agent_tutorial.{ipynb,json}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Fixed two critical issues in all three agent notebooks:
1. Input Blocking in Colab:
- Replaced input() with getpass.getpass() for sensitive inputs
- Added try/except fallback for environments where getpass doesn't work
- Users can now press Enter to skip optional configuration
- Prevents notebook from hanging on input prompts in Colab
2. Empty CAPELLA_API_ENDPOINT Variables:
- Changed from os.environ['KEY'] to os.environ.get('KEY', '') when writing to .env
- Prevents KeyError if variables aren't set during infrastructure setup
- Safely handles missing variables with empty string defaults
- Ensures .env file is always writable even with partial configuration
Changes to Optional API Keys Cell:
- Added getpass import
- Wrapped input calls in try/except blocks
- Improved user messaging ("Press Enter to skip...")
- Better fallback messages ("will use Capella AI only", "observability disabled")
Updated notebooks:
- flight_search_agent_langraph/flight_search_agent_tutorial.{ipynb,json}
- hotel_search_agent_langchain/hotel_search_agent_tutorial.{ipynb,json}
- landmark_search_agent_llamaindex/landmark_search_agent_tutorial.{ipynb,json}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
…onse
Fixed empty CAPELLA_API_ENDPOINT issue that was causing "Request URL is missing protocol" errors.
Root Cause:
The Capella AI API returns the connectionString nested inside a 'model' object:
```
{
"model": {
"connectionString": "https://...",
...
}
}
```
Previous code was trying to access embedding_details.get('connectionString')
which returned None because connectionString is inside the nested 'model' object.
Solution:
- Extract the 'model' object first: embedding_details.get('model', {})
- Then get connectionString from the nested object: model_info.get('connectionString', '')
- This properly populates CAPELLA_API_ENDPOINT and CAPELLA_API_EMBEDDING_ENDPOINT
Now the embeddings service will work correctly with proper endpoint URLs.
Updated: flight_search_agent_langraph/flight_search_agent_tutorial.{ipynb,json}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
- Converted the flight_search_agent_tutorial from JSON format to IPython Notebook format. - Added execution counts and outputs for various code cells to enhance interactivity and user experience. - Updated output IDs for consistency and improved logging of resource downloads. - Removed the outdated JSON file associated with the tutorial. This update improves the usability of the tutorial by providing a more interactive experience for users.
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.
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]