Skip to content

feat: Add support for LlamaCloud EU region #38

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nick-galluzzo
Copy link
Collaborator

This PR adds support for LlamaCloud's regional API endpoints, allowing users to configure their preferred region (North America or Europe) while maintaining full backward compatibility.

Changes

  • New: src/notebookllama/utils.py - Centralized utility functions for LlamaCloud client creation with regional support
  • New: Regional configuration via LLAMACLOUD_REGION environment variable
  • Updated: All LlamaCloud client instantiation to use new utility functions
  • Added: Error handling with custom LlamaCloudConfigError
  • Added: Unit tests covering regional support scenarios
  • Updated: Documentation in README and .env.example

Configuration

  • North America (default): No configuration needed - works exactly as before
  • Europe: Set LLAMACLOUD_REGION="eu" in your .env file

Backward Compatibility

  • 100% backward compatible - existing code requires no changes
  • Default behavior unchanged - North America region by default
  • Optional feature - users can opt into regional configuration

This addresses the regional support issue discussed in #32

…lity

- Fix AsyncLlamaCloud initialization to use 'token' parameter instead of 'api_key'
- Resolve async event loop conflicts in create_llama_cloud_index.py
- Fix relative import issues by converting to absolute imports with proper sys.path handling
- Centralize regional support logic in utils.py with dedicated client creation functions
- Eliminate DRY violations by removing duplicated base_url handling across files
- Improve maintainability with consistent parameter handling and import patterns
- Add proper error handling for async operations within existing event loops
- Ensure create_llamacloud_index is never passes `None` for `api_key` and `pipeline_id`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant