Skip to content

Commit 6dff466

Browse files
Copilotphrocker
andcommitted
Remove SQL agent as requested - all interactions through APIs only
Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>
1 parent 345a3c6 commit 6dff466

8 files changed

Lines changed: 26 additions & 314 deletions

File tree

python-agent/README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ The Python agent mirrors the Java agent architecture with these key components:
2424

2525
### Agent Framework
2626
- **BaseAgent**: Abstract base class for all agents
27-
- **SQLAgent**: Example implementation for SQL operations
2827

2928
## Configuration
3029

@@ -65,14 +64,8 @@ AGENT_HEARTBEAT_INTERVAL=30
6564

6665
## Usage
6766

68-
### Running the SQL Agent
69-
```bash
70-
# With configuration file
71-
python main.py sql_agent --config config.yaml
72-
73-
# With default configuration (uses environment variables)
74-
python main.py sql_agent
75-
```
67+
### Agent Framework
68+
The Python agent provides a framework for creating custom agents that integrate with the Sentrius platform. All agents interact through APIs using JWT authentication, working with DTOs from the API and the LLM proxy.
7669

7770
### Creating Custom Agents
7871
```python
@@ -84,10 +77,26 @@ class MyCustomAgent(BaseAgent):
8477

8578
def execute_task(self):
8679
# Your custom agent logic here
80+
# Note: All data access is through Sentrius APIs, not direct database connections
8781
self.submit_provenance(
8882
event_type="CUSTOM_TASK",
8983
details={"task": "custom_operation"}
9084
)
85+
86+
def run(self):
87+
# Start the agent lifecycle
88+
self.start()
89+
self.execute_task()
90+
self.stop()
91+
```
92+
93+
### Running Custom Agents
94+
```bash
95+
# With configuration file
96+
python -c "from my_agent import MyCustomAgent; agent = MyCustomAgent('config.yaml'); agent.run()"
97+
98+
# With environment variables
99+
python -c "from my_agent import MyCustomAgent; agent = MyCustomAgent(); agent.run()"
91100
```
92101

93102
## API Operations
@@ -115,7 +124,8 @@ The Python agent supports all the same API operations as the Java agent:
115124
- `PyJWT`: JWT token handling
116125
- `cryptography`: RSA key generation and encryption
117126
- `pyyaml`: YAML configuration parsing
118-
- `langchain`: LLM integration (for SQL agent)
127+
128+
Note: The Python agent accesses data through Sentrius APIs using DTOs and the LLM proxy, not through direct database connections.
119129

120130
## Installation
121131

python-agent/agents/sql_agent/__init__.py

Whitespace-only changes.

python-agent/agents/sql_agent/config.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

python-agent/agents/sql_agent/questions.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

python-agent/agents/sql_agent/sql_agent.py

Lines changed: 0 additions & 143 deletions
This file was deleted.

python-agent/main.py

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import argparse
22
import logging
3-
import os
4-
from agents.sql_agent.sql_agent import SQLAgent
53

64
# Configure logging
75
logging.basicConfig(
@@ -15,40 +13,21 @@ def main():
1513
parser = argparse.ArgumentParser(description="Run selected Sentrius Python agent.")
1614
parser.add_argument(
1715
"agent",
18-
choices=["sql_agent"],
16+
choices=[], # No agents available yet - SQL agent removed per feedback
1917
help="Select the agent to run."
2018
)
2119
parser.add_argument(
2220
"--config",
2321
help="Path to agent configuration file",
2422
default=None
2523
)
26-
parser.add_argument(
27-
"--sql-config",
28-
help="Path to SQL-specific configuration file for SQL agent",
29-
default="agents/sql_agent/config.yaml"
30-
)
3124

3225
args = parser.parse_args()
3326

34-
try:
35-
if args.agent == "sql_agent":
36-
logger.info("Initializing SQL Agent with Sentrius integration...")
37-
38-
# Use SQL-specific config if provided, otherwise fall back to main config
39-
config_path = args.sql_config if os.path.exists(args.sql_config) else args.config
40-
41-
sql_agent = SQLAgent(config_path=config_path)
42-
sql_agent.run()
43-
else:
44-
logger.error("Unknown agent. Exiting.")
45-
return 1
46-
47-
except Exception as e:
48-
logger.error(f"Agent execution failed: {e}")
49-
return 1
50-
51-
return 0
27+
# No agents available currently - SQL agent was removed
28+
logger.error("No agents are currently available. SQL agent was removed as it won't have direct database access.")
29+
logger.info("All interactions are through APIs once JWT is obtained, working via DTOs and LLM proxy.")
30+
return 1
5231

5332

5433
if __name__ == "__main__":

python-agent/requirements.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
argparse
2-
langchain
3-
langchain-community
4-
langchain-experimental
5-
sqlalchemy
6-
openai
72
pyyaml
8-
psycopg2
93
requests>=2.25.0
104
PyJWT>=2.4.0
115
cryptography>=3.4.0

0 commit comments

Comments
 (0)