-
Notifications
You must be signed in to change notification settings - Fork 1
Create comprehensive Python agent with full Sentrius API integration #52
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
Conversation
|
Great stuff. Can we remove the SQL agent? You may notice that all interactions are through APIs ( once a jwt is obtained ), meaning that the python agent won't have access to the database directly -- only via DTOs from the API and the LLM proxy. |
Co-authored-by: phrocker <[email protected]>
SQL agent removed per your feedback. The Python agent framework now focuses on API-based interactions using DTOs and the LLM proxy, without direct database access. All SQL-related dependencies and examples have been cleaned up. (commit 6dff466) |
| parser = argparse.ArgumentParser(description="Run selected agent.") | ||
| parser = argparse.ArgumentParser(description="Run selected Sentrius Python agent.") | ||
| parser.add_argument( | ||
| "agent", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. In the java side we have the application.properties that defines a link to a yaml file that can be used for the context of defining what an agent does. If you look in src and under resources you'll see chat-helper.yaml and chat-helper.properties. Can we do something similar here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented a properties-based configuration system similar to the Java side. The Python agent now uses application.properties that references YAML files for agent definitions, just like the Java agent's approach with chat-helper.yaml and chat-helper.properties.
Key features added:
application.propertieswith environment variable substitution (${VARIABLE:default})- Agent-specific YAML files (chat-helper.yaml, data-analyst.yaml, terminal-helper.yaml)
- ConfigManager that loads both properties and referenced YAML files
- Test mode for development without external services
Usage: python main.py chat-helper --config application.properties (commit 5941b76)
Co-authored-by: phrocker <[email protected]>
This PR implements a complete Python agent framework that provides equivalent functionality to the existing Java agent, enabling full integration with the Sentrius platform APIs.
Overview
The Python agent now supports all the same operations as the Java agent:
Key Components Added
Core Services
KeycloakService: Handles JWT validation, token retrieval, and Keycloak integrationAgentClientService: Manages all API communication (registration, heartbeat, provenance submission)EphemeralKeyGen: RSA key generation and cryptographic operationsSentriusAgent: Main orchestration framework coordinating all servicesAgent Framework
BaseAgent: Abstract base class with full Sentrius integrationSQLAgent: Example implementation with provenance tracking and LLM supportAPI Endpoints Supported
POST /api/v1/agent/register- Agent registrationPOST /api/v1/agent/heartbeat- Status monitoringPOST /api/v1/agent/provenance/submit- Event submissionUsage Examples
Basic Agent Execution
Custom Agent Development
Configuration
Testing
Compatibility
The Python agent is fully compatible with the existing Java infrastructure:
Files Added/Modified
python-agent/services/- Core service implementationspython-agent/tests/- Comprehensive test suitepython-agent/README.md- Documentation and usage guidepython-agent/agents/base.py- Integration frameworkpython-agent/agents/sql_agent/sql_agent.py- Updated with Sentrius integrationpython-agent/requirements.txt- Added necessary dependenciesFixes #51.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.