Benjamin Consolvo
commited on
Commit
·
aa25bb2
1
Parent(s):
78797ac
remove readme backup
Browse files- README_backup.md +0 -166
README_backup.md
DELETED
|
@@ -1,166 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: VacAIgent
|
| 3 |
-
emoji: 🐨
|
| 4 |
-
colorFrom: yellow
|
| 5 |
-
colorTo: purple
|
| 6 |
-
sdk: streamlit
|
| 7 |
-
sdk_version: 1.44.1
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
license: apache-2.0
|
| 11 |
-
short_description: Let AI agents plan your next vacation!
|
| 12 |
-
---
|
| 13 |
-
|
| 14 |
-
# 🏖️ VacAIgent: Streamlit-Integrated AI Crew for Trip Planning
|
| 15 |
-
|
| 16 |
-
_Forked and enhanced from the_ [_crewAI examples repository_](https://github.com/joaomdmoura/crewAI-examples/tree/main/trip_planner)
|
| 17 |
-
|
| 18 |
-

|
| 19 |
-
|
| 20 |
-
## Introduction
|
| 21 |
-
|
| 22 |
-
VacAIgent leverages the CrewAI framework to automate and enhance the trip planning experience, integrating a user-friendly Streamlit interface. This project demonstrates how autonomous AI agents can collaborate and execute complex tasks efficiently, now with an added layer of interactivity and accessibility through Streamlit.
|
| 23 |
-
|
| 24 |
-
**Check out the video below for code walkthrough** 👇
|
| 25 |
-
|
| 26 |
-
<a href="https://youtu.be/nKG_kbQUDDE">
|
| 27 |
-
<img src="https://img.youtube.com/vi/nKG_kbQUDDE/hqdefault.jpg" alt="Watch the video" width="100%">
|
| 28 |
-
</a>
|
| 29 |
-
|
| 30 |
-
(_Trip example originally developed by [@joaomdmoura](https://x.com/joaomdmoura)_)
|
| 31 |
-
|
| 32 |
-
## CrewAI Framework
|
| 33 |
-
|
| 34 |
-
CrewAI simplifies the orchestration of role-playing AI agents. In VacAIgent, these agents collaboratively decide on cities and craft a complete itinerary for your trip based on specified preferences, all accessible via a streamlined Streamlit user interface.
|
| 35 |
-
|
| 36 |
-
## Streamlit Interface
|
| 37 |
-
|
| 38 |
-
The introduction of [Streamlit](https://streamlit.io/) transforms this application into an interactive web app, allowing users to easily input their preferences and receive tailored travel plans.
|
| 39 |
-
|
| 40 |
-
## Running the Application
|
| 41 |
-
|
| 42 |
-
To experience the VacAIgent app:
|
| 43 |
-
|
| 44 |
-
### Pre-Requisites
|
| 45 |
-
1. Install and Configure **git** on your machine
|
| 46 |
-
2. Get the API key from **scrapinagent.com** from scrapinagent [Click Here to Signup](https://scrapingant.com/)
|
| 47 |
-
3. Get the API from **SERPER API** from serper [Click here to Signup]( https://serper.dev/)
|
| 48 |
-
|
| 49 |
-
### Deploy Trip Planner
|
| 50 |
-
|
| 51 |
-
#### Step 1
|
| 52 |
-
```sh
|
| 53 |
-
git clone https://github.com/intel-sandbox/trip_planner_agent
|
| 54 |
-
```
|
| 55 |
-
* *Please make sure git is installed*
|
| 56 |
-
|
| 57 |
-
#### Step 2
|
| 58 |
-
|
| 59 |
-
Insall Dependencies
|
| 60 |
-
```sh
|
| 61 |
-
pip install -r requirements.txt
|
| 62 |
-
```
|
| 63 |
-
#### Step 3
|
| 64 |
-
|
| 65 |
-
```sh
|
| 66 |
-
cd trip_planner_agent
|
| 67 |
-
```
|
| 68 |
-
|
| 69 |
-
create `.streamlit/secrets.toml` file and Update **Credentials**
|
| 70 |
-
you can use secrtes.example file for reference
|
| 71 |
-
|
| 72 |
-
```sh
|
| 73 |
-
SERPER_API_KEY=""
|
| 74 |
-
SCRAPINGANT_API_KEY=""
|
| 75 |
-
OPENAI_API_KEY=""
|
| 76 |
-
MODEL_ID=""
|
| 77 |
-
MODEL_BASE_URL=""
|
| 78 |
-
```
|
| 79 |
-
#### Step 4
|
| 80 |
-
|
| 81 |
-
Run the application
|
| 82 |
-
|
| 83 |
-
```sh
|
| 84 |
-
streamlit run streamlit_app.py
|
| 85 |
-
```
|
| 86 |
-
|
| 87 |
-
Your application should be up and running
|
| 88 |
-
|
| 89 |
-
★ **Disclaimer**: The application uses GPT-4 by default. Ensure you have access to OpenAI's API and be aware of the associated costs.
|
| 90 |
-
|
| 91 |
-
## Details & Explanation
|
| 92 |
-
|
| 93 |
-
- **Streamlit UI**: The Streamlit interface is implemented in `streamlit_app.py`, where users can input their trip details.
|
| 94 |
-
- **Components**:
|
| 95 |
-
- `./trip_tasks.py`: Contains task prompts for the agents.
|
| 96 |
-
- `./trip_agents.py`: Manages the creation of agents.
|
| 97 |
-
- `./tools directory`: Houses tool classes used by agents.
|
| 98 |
-
- `./streamlit_app.py`: The heart of the Streamlit app.
|
| 99 |
-
|
| 100 |
-
## Using GPT 3.5
|
| 101 |
-
|
| 102 |
-
To switch from GPT-4 to GPT-3.5, pass the llm argument in the agent constructor:
|
| 103 |
-
|
| 104 |
-
```python
|
| 105 |
-
from langchain.chat_models import ChatOpenAI
|
| 106 |
-
|
| 107 |
-
llm = ChatOpenAI(model='gpt-3.5-turbo') # Loading gpt-3.5-turbo (see more OpenAI models at https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4)
|
| 108 |
-
|
| 109 |
-
class TripAgents:
|
| 110 |
-
# ... existing methods
|
| 111 |
-
|
| 112 |
-
def local_expert(self):
|
| 113 |
-
return Agent(
|
| 114 |
-
role='Local Expert',
|
| 115 |
-
goal='Provide insights about the selected city',
|
| 116 |
-
tools=[SearchTools.search_internet, BrowserTools.scrape_and_summarize_website],
|
| 117 |
-
llm=llm,
|
| 118 |
-
verbose=True
|
| 119 |
-
)
|
| 120 |
-
|
| 121 |
-
```
|
| 122 |
-
|
| 123 |
-
## Using Local Models with Ollama
|
| 124 |
-
|
| 125 |
-
For enhanced privacy and customization, you can integrate local models like Ollama:
|
| 126 |
-
|
| 127 |
-
### Setting Up Ollama
|
| 128 |
-
|
| 129 |
-
- **Installation**: Follow Ollama's guide for installation.
|
| 130 |
-
- **Configuration**: Customize the model as per your requirements.
|
| 131 |
-
|
| 132 |
-
### Integrating Ollama with CrewAI
|
| 133 |
-
|
| 134 |
-
Pass the Ollama model to agents in the CrewAI framework:
|
| 135 |
-
|
| 136 |
-
```python
|
| 137 |
-
from langchain.llms import Ollama
|
| 138 |
-
|
| 139 |
-
ollama_model = Ollama(model="agent")
|
| 140 |
-
|
| 141 |
-
class TripAgents:
|
| 142 |
-
# ... existing methods
|
| 143 |
-
|
| 144 |
-
def local_expert(self):
|
| 145 |
-
return Agent(
|
| 146 |
-
role='Local Expert',
|
| 147 |
-
tools=[SearchTools.search_internet, BrowserTools.scrape_and_summarize_website],
|
| 148 |
-
llm=ollama_model,
|
| 149 |
-
verbose=True
|
| 150 |
-
)
|
| 151 |
-
|
| 152 |
-
```
|
| 153 |
-
|
| 154 |
-
## Benefits of Local Models
|
| 155 |
-
|
| 156 |
-
- **Privacy**: Process sensitive data in-house.
|
| 157 |
-
- **Customization**: Tailor models to fit specific needs.
|
| 158 |
-
- **Performance**: Potentially faster responses with on-premises models.
|
| 159 |
-
|
| 160 |
-
## License
|
| 161 |
-
|
| 162 |
-
VacAIgent is open-sourced under the MIT License.
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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