Skip to content

feat: add Nexus Gateway integration for expanded model access #662

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 1 commit into from
May 22, 2025

Conversation

cajias
Copy link
Collaborator

@cajias cajias commented May 20, 2025

This commit implements Nexus Gateway integration, allowing the chatbot to connect
to additional AI models through a centralized gateway service. Key additions include:

  1. NexusGatewayClient for authentication and API communication:

    • OAuth token management with caching
    • Secure API request handling
    • Comprehensive error handling
  2. NexusModelProvider implementation:

    • Model discovery through the gateway
    • Transformation of Nexus models to application format
    • Support for both chat and embedding models
  3. Fixed adapter structure issues:

    • Added missing types.py with ModelProvider abstract base class
    • Created direct and nexus provider implementations
    • Fixed import errors with proper directory structure
  4. Added comprehensive test coverage:

    • Unit tests for client authentication and API calls
    • Tests for model transformation logic
    • Error handling test cases

@cajias cajias force-pushed the feature/nexus-integration branch 9 times, most recently from 3b650ea to eb7347c Compare May 21, 2025 11:18
@cajias cajias force-pushed the feature/nexus-integration branch from eb7347c to 6723c83 Compare May 21, 2025 16:15
@cajias cajias requested a review from maryamkhidir May 21, 2025 16:25
This commit implements Nexus Gateway integration, allowing the chatbot to connect
to additional AI models through a centralized gateway service. Key additions include:

1. NexusGatewayClient for authentication and API communication:
   - OAuth token management with caching
   - Secure API request handling
   - Comprehensive error handling

2. NexusModelProvider implementation:
   - Model discovery through the gateway
   - Transformation of Nexus models to application format
   - Support for both chat and embedding models

3. Fixed adapter structure issues:
   - Added missing types.py with ModelProvider abstract base class
   - Created direct and nexus provider implementations
   - Fixed import errors with proper directory structure

4. Added comprehensive test coverage:
   - Unit tests for client authentication and API calls
   - Tests for model transformation logic
   - Error handling test cases
@cajias cajias force-pushed the feature/nexus-integration branch from 6723c83 to f2034c8 Compare May 22, 2025 09:18
else:
gateway_url += "/bedrock"

logger.info("Using Nexus Gateway URL with bedrock prefix")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: should this be called a prefix considering that the /bedrock part is at the end of the URL? I can see that it is the prefix of the path but not really the prefix of the Gateway URL, instead it's rather a postfix in the scope of the URL. Maybe we can rephrase this to "Using the Nexus Gateway URL with the '/bedrock' path".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. Will follow up on the next PR.

@cajias cajias merged commit 98afa18 into main May 22, 2025
6 checks passed
@cajias cajias deleted the feature/nexus-integration branch May 22, 2025 12:11
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.

2 participants