CopiloHero is a dynamic tool aggregator that utilizes Cloudflare's AI Function Calling to provide various functionalities like GitHub user info retrieval, stock analysis, and web scraping. It leverages multiple APIs and web scraping tools to fetch real-time information, offering a robust integration with Cloudflare’s Function Calling capabilities.
- Cloudflare AI Integration: Dynamically call functions using Cloudflare's AI model with tool descriptions.
- GitHub User Info: Fetch public details of GitHub users.
- Stock Analysis: Retrieve real-time stock data, company profiles, and analyst recommendations.
- Web Scraping: Extract visible text and metadata from webpages.
- Product Hunt Leaderboard: Get the latest trending products on Product Hunt.
- Web Search: Perform Google search and retrieve top results.
- Python 3.8+
- ChromeDriver installed for Selenium usage.
-
Clone the Repository:
git clone https://github.com/gladsonchala/copilohero.git cd copilohero
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables:
- Copy the
.env.sample
to.env
:cp .env.sample .env
- Update the
.env
file with your CloudflareACCOUNT_ID
andAPI_TOKEN
.
- Copy the
ACCOUNT_ID=your_account_id_here
API_TOKEN=your_api_token_here
MODEL_NAME=@hf/nousresearch/hermes-2-pro-mistral-7b
-
Run the Main Script:
python main.py
-
Example Query:
- Retrieve GitHub user info:
user_query = "Get information about the GitHub user 'octocat'."
- Retrieve GitHub user info:
-
Cloudflare API Integration:
- The application utilizes Cloudflare’s Function Calling to dynamically choose tools based on the user query. This ensures a seamless and context-aware response.
- GitHub User Info: Fetch GitHub user details.
- Stock Info: Get current stock prices and company profiles.
- Web Search: Perform Google searches and fetch results.
- Web Scraping: Extract text from a given URL.
- Product Hunt: Retrieve trending products from Product Hunt’s daily leaderboard.
Feel free to fork this project, open issues, and submit PRs. Contributions are welcome!
This project is licensed under the MIT License. See the LICENSE
file for details.
For any inquiries, please contact: gladsonchala@gmail.com