Git Product home page Git Product logo

perplexitychat's Introduction

PerplexityChat Model Wrapper for Langchain

Overview

The pplx.py module acts as a wrapper for handling perplexity chat model in Langchain projects.

Requirements

Install the required packages listed in requirements.txt:

pip install -r requirements.txt

Configuration

  1. Add the following import in your main Langchain application:

    from pplx import PerplexityChat
  2. Update your config.json to include any specific settings required for the pplx module.

  3. In your main Langchain application, initialize the PerplexityChat class and use it as per your needs.

Usage

Here's a simple example using pplx.py in a Langchain application:

from langchain.agents import initialize_agent, AgentType, load_tools from langchain.callbacks import get_openai_callback from pplx import PerplexityChat

Instance of the PerplexityChatAI class

chat_perplexity_ai = PerplexityChat(model_name="mistral-7b-instruct", temperature=0.7, verbose=True)

Load the tools

tools = load_tools(["serpapi"], llm=chat_perplexity_ai)

Initialize the agent

agent = initialize_agent(tools, chat_perplexity_ai, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True, handle_parsing_errors=True )

Run the agent

chat_answer = agent.run('Qual a cor do cavalo branco de Napoleão?') print('Answer: ', chat_answer)

For more details, refer to the comments and documentation within the pplx.py module itself.

Troubleshooting

For any issues, refer to the logs or debug the pplx.py module directly.

perplexitychat's People

Contributors

igormedeiros avatar rd3222 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.