| import json | |
| import requests | |
| # Load agent configuration | |
| with open("tunnel_farming_agent.json", "r") as f: | |
| agent_config = json.load(f) | |
| # Example API call to the agent | |
| def query_agent(query): | |
| url = "https://your-n8n-instance.com/webhook/invoke-tunnel-farming-agent" | |
| payload = { | |
| "query": query, | |
| "user_id": "example_user", | |
| "session_id": "example_session" | |
| } | |
| response = requests.post(url, json=payload) | |
| return response.json() | |
| # Example usage | |
| response = query_agent("What is the current soil moisture level?") | |
| print(response) |