Download example_usage.py from persadian/tunnel_farming_agent: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/persadian/tunnel_farming_agent/resolve/main/example_usage.py
- Command line
-
hf download hf://persadian/tunnel_farming_agent/example_usage.py
-
curl -L -o example_usage.py https://huggingface.co/persadian/tunnel_farming_agent/resolve/main/example_usage.py
568 Bytes
| 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) |