Giter Club home page Giter Club logo

trip_planner_agent's Introduction

๐Ÿ–๏ธ VacAIgent: Streamlit-Integrated AI Crew for Trip Planning

Forked and enhanced from the crewAI examples repository

Beach Vacation Scene ~ generated by GPT-4V

Introduction

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.

Check out the video below for code walkthrough ๐Ÿ‘‡

Watch the video

(Trip example originally developed by @joaomdmoura)

CrewAI Framework

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.

Streamlit Interface

The introduction of Streamlit transforms this application into an interactive web app, allowing users to easily input their preferences and receive tailored travel plans.

Running the Application

To experience the VacAIgent app:

  • Configure Environment: Set up the environment variables for Browseless, Serper, and OpenAI. Use the secrets.example as a guide to add your keys then move that file (secrets.toml) to .streamlit/secrets.toml.

  • Install Dependencies: Execute pip install -r requirements.txt in your terminal.

  • Launch the App: Run streamlit run streamlit_app.py to start the Streamlit interface.

โ˜… Disclaimer: The application uses GPT-4 by default. Ensure you have access to OpenAI's API and be aware of the associated costs.

Details & Explanation

  • Streamlit UI: The Streamlit interface is implemented in streamlit_app.py, where users can input their trip details.
  • Components:
    • ./trip_tasks.py: Contains task prompts for the agents.
    • ./trip_agents.py: Manages the creation of agents.
    • ./tools directory: Houses tool classes used by agents.
    • ./streamlit_app.py: The heart of the Streamlit app.

Using GPT 3.5

To switch from GPT-4 to GPT-3.5, pass the llm argument in the agent constructor:

from langchain.chat_models import ChatOpenAI

llm = ChatOpenAI(model='gpt-3.5') # Loading GPT-3.5

class TripAgents:
    # ... existing methods

    def local_expert(self):
        return Agent(
            role='Local Expert',
            goal='Provide insights about the selected city',
            tools=[SearchTools.search_internet, BrowserTools.scrape_and_summarize_website],
            llm=llm,
            verbose=True
        )

Using Local Models with Ollama

For enhanced privacy and customization, you can integrate local models like Ollama:

Setting Up Ollama

  • Installation: Follow Ollama's guide for installation.
  • Configuration: Customize the model as per your requirements.

Integrating Ollama with CrewAI

Pass the Ollama model to agents in the CrewAI framework:

from langchain.llms import Ollama

ollama_model = Ollama(model="agent")

class TripAgents:
    # ... existing methods

    def local_expert(self):
        return Agent(
            role='Local Expert',
            tools=[SearchTools.search_internet, BrowserTools.scrape_and_summarize_website],
            llm=ollama_model,
            verbose=True
        )

Benefits of Local Models

  • Privacy: Process sensitive data in-house.
  • Customization: Tailor models to fit specific needs.
  • Performance: Potentially faster responses with on-premises models.

License

VacAIgent is open-sourced under the MIT License.

trip_planner_agent's People

Contributors

tonykipkemboi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.