Shipmaster1/Agent_Browse
0
WebAgentTools
A web-based agent tools interface for interacting with various AI tools and services.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
LangGraph Agent with Tools
This project demonstrates a conversational AI agent built with LangGraph, featuring three integrated tools and a responsive web UI.
Features
- ๐ค LangGraph-powered conversational agent
- ๐ง Three integrated tools:
- Web search (simulated)
- Mathematical calculator
- Image prompt generator
- ๐ฌ Real-time chat interface with WebSocket communication
- ๐จ Clean, responsive UI
- ๐ Ready to deploy on Hugging Face Spaces
How to Run Locally
- Clone this repository
- Install the dependencies:
pip install -r requirements.txt- Create a
.envfile in the root directory with your OpenAI API key:
OPENAI_API_KEY=your_api_key_here- Run the application:
python app.py- Open your browser and navigate to
http://localhost:8000
Project Structure
.
โโโ app.py # Main application file with FastAPI and LangGraph
โโโ index.html # HTML frontend
โโโ static/ # Static assets
โ โโโ styles.css # CSS styling
โ โโโ script.js # JavaScript for WebSocket and UI
โโโ requirements.txt # Python dependencies
โโโ README.md # DocumentationDeploying to Hugging Face Spaces
- Create a new Space on Hugging Face with the Spaces SDK
- Choose the "Dockerfile" option for maximum flexibility
- Push this code to your GitHub repository
- Connect your Hugging Face Space to the GitHub repository
- Add your OpenAI API key as a secret in the Space settings
- Deploy!
How to Use
- Type a message in the input field and press Enter or click Send
- Ask questions that might require:
- Searching for information
- Calculating mathematical expressions
- Generating prompts for image creation
- The agent will automatically select the appropriate tool based on your request
Customization
- Add more tools by creating new tool functions in
app.py - Customize the UI by modifying
index.htmlandstyles.css - Adjust the agent's behavior by editing the system prompt in
app.py
License
MIT
