Downloads · 30 days
0
ArjunSoniK/llama_search_agent
llama_search_agent is a machine learning model from ArjunSoniK. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Aug 7, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py4.5 KB · 68%
From the Hugging Face model README
This repository contains a FastAPI application that leverages LangChain to initialize various tools and an LLM (Language Learning Model) for handling user inputs. The application is designed to handle multiple types of queries using integrated tools such as SerpAPI, Wikipedia, DuckDuckGo, ArXiv, PubMed, and more.
Clone the repository:
git clone https://github.com/yourusername/your-repo-name.git cd your-repo-name
Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use venv\Scripts\activate
Install the required packages:
pip install -r requirements.txt
Create a .env file in the root directory of the project and add the necessary API keys:
GROQ_API_KEY=your_groq_api_key
SERPAPI_API_KEY=your_serpapi_api_key
Endpoint to handle search queries using the initialized agent.
Request Body:
{
"input": "your query here"
}
Response:
{
"result": "search result"
}
Ensure you have set up the virtual environment and installed the dependencies as shown above.
Run the FastAPI application:
uvicorn main:app --reload
The application will be available at http://127.0.0.1:8000
You can test the API using the base URL: https://llamachat-ipea.onrender.com/