API Agent is an interactive web application that allows users to query APIs through natural language. It translates user questions into API calls, fetches real-time data, and presents the results in a user-friendly format.
- Natural Language Interface: Ask questions in plain English to interact with APIs
- Multiple API Support: Connect to GitHub, StackOverflow, Jira, and more
- Real-time Data: Access up-to-date information from various platforms
- Code Generation: Automatically generates and executes JavaScript code for API calls
- Result Validation: Verifies that the results answer the original question
- Dark/Light Mode: Supports theme switching for comfortable viewing
- Token Management: Securely store API tokens for authenticated requests
- Enter your question in the input field (e.g., "What are the trending Python repositories this week?")
- Click "Submit" to process your request
- View the step-by-step process:
- Developer analysis of required API endpoints
- Generated code to fetch the data
- Results from the API call
- Validation of the results
- What are the most starred JavaScript repositories on GitHub?
- What are the most recent questions about React on StackOverflow?
- Who are the top contributors to the TensorFlow repository?
- What are the trending Python repositories this week?
- What are the most upvoted JavaScript questions on StackOverflow?
- Modern web browser (Chrome, Firefox, Safari, Edge)
- API tokens (optional, but recommended for higher rate limits):
- Clone this repository
- Open
index.html
in your browser - Log in to LLM Foundry when prompted
- (Optional) Add your API tokens in the "API Tokens" section
The application can be deployed to any static web hosting service:
- Upload all files to your web server
- Ensure CORS is properly configured for API requests
- Set up proper authentication for the LLM Foundry service
API Agent uses a client-side architecture with the following components:
- Frontend: HTML, CSS (Bootstrap), and JavaScript
- LLM Integration: Connects to LLM Foundry for natural language processing
- API Connector: Dynamically generates and executes JavaScript to call external APIs
- Result Renderer: Formats and displays results using lit-html and marked
- Bootstrap 5.3.3 - UI framework
- lit-html 3 - HTML templating library
- asyncLLM 2 - Streaming LLM responses
- marked 13 - Markdown parsing
- highlight.js 11 - Syntax highlighting