Skip to content

chore(examples): improve llama-index calling apis example #33

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
merged 2 commits into from
May 9, 2025

Conversation

cristiandouce
Copy link
Contributor

This pull request introduces significant enhancements to the examples/calling-apis/llama-index-examples project, focusing on integrating federated authentication, improving agent functionality, and restructuring the codebase for better modularity and maintainability. The most important changes include the addition of federated connection tools, the introduction of an asynchronous agent with memory capabilities, and a comprehensive overhaul of the authentication and routing logic.

Federated Authentication and Authorization:

  • Added auth0-server-python integration to manage federated connections for Google Calendar, Slack, and GitHub, enabling scoped access to user data. (examples/calling-apis/llama-index-examples/pyproject.toml, examples/calling-apis/llama-index-examples/src/auth0/auth.py, examples/calling-apis/llama-index-examples/src/auth0/auth0_ai.py) [1] [2] [3]
  • Introduced auth0 routes for login, logout, and callback functionality, replacing the previous authlib-based implementation. (examples/calling-apis/llama-index-examples/src/auth0/routes.py, examples/calling-apis/llama-index-examples/src/app/app.py) [1] [2]

Agent and Memory Enhancements:

  • Created a new get_agent function using OpenAIAgent with integrated tools for Slack, GitHub, and Google Calendar, as well as asynchronous memory management via ChatMemoryBuffer. (examples/calling-apis/llama-index-examples/src/agents/agent.py, examples/calling-apis/llama-index-examples/src/agents/memory.py) [1] [2]
  • Added tools for listing Slack channels, GitHub repositories, and checking user calendar availability, leveraging federated connections for seamless data access. (examples/calling-apis/llama-index-examples/src/agents/tools/list_channels.py, examples/calling-apis/llama-index-examples/src/agents/tools/list_repositories.py, examples/calling-apis/llama-index-examples/src/agents/tools/check_user_calendar.py) [1] [2] [3]

Codebase Restructuring:

  • Refactored the application structure to separate authentication, agent logic, and tools into distinct modules for better maintainability. (examples/calling-apis/llama-index-examples/src/app/app.py, examples/calling-apis/llama-index-examples/src/auth0/) [1] [2]
  • Renamed and reorganized files to align with the new modular structure, such as moving tools into the agents directory. (examples/calling-apis/llama-index-examples/src/agents/tools/check_user_calendar.py)

Asynchronous Application Improvements:

  • Updated the start.py script to use asyncio.run and converted the WSGI app to ASGI using WsgiToAsgi, enabling asynchronous server operation. (examples/calling-apis/llama-index-examples/scripts/start.py)

Development Environment Updates:

  • Modified .vscode/settings.json to update python.analysis.extraPaths for better IDE support with the new project structure. (.vscode/settings.json)

@cristiandouce cristiandouce merged commit 074eba2 into main May 9, 2025
1 check passed
@cristiandouce cristiandouce deleted the improve-llamaindex-example-apis branch May 14, 2025 20:03
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.

3 participants