GithubHelp home page GithubHelp logo

dudu-bot's Introduction

Dudu - The Conversational Discord Bot

Dudu is a delightful bear bot on Discord, powered by OpenAI's GPT-3.5 Turbo. It's designed to have meaningful, mood-based conversations and suggest activities.

Key Features

  • Powered by OpenAI: Utilizes GPT-3.5 Turbo for natural conversations.
  • Mood-based Interactions: Dudu's responses vary based on its current mood.
  • Memory Feature: Remembers past interactions for context-aware conversations.
  • Dynamic Activities: Suggests activities based on mood, time, and past actions.

How Dudu Learns to Talk:

Setting the Stage with OpenAI

  • API Interaction: The code utilizes OpenAI's ChatCompletion API to create a conversation with the model. Each conversation is structured as a series of messages, alternating between the roles of "system", "user", and "assistant".
  • System's Role: Provides high-level directives to set the behavior of the model. For Dudu, instructions ensure that the bot behaves like a lovely bear named "肚肚".
  • User's Role: Simulates the user guiding the model through the desired outputs, such as suggesting activities for Dudu based on its current mood and time of day.
  • Temperature: Determines the randomness of the model's output. A higher value (e.g., 0.9) produces more random outputs, while a lower value makes it more deterministic.

Ensuring Dudu Remembers

  • Activity Logging: Includes an activity_log that records Dudu's recent activities to avoid repetition in suggestions.
  • Historical Conversations: Feeds the model with the last 10 interactions to provide context, ensuring coherent and context-aware conversations.
  • Mood and Location Context: Informs the model about Dudu's current mood, mood score, and location, generating responses in line with Dudu's current state.

Underlying Logic for Conversation

  • Activity Generation: The generate_activity function suggests an activity for Dudu based on its mood, recent activities, and the time.
  • Sending Messages: The send_message function simulates conversations, generating responses based on historical conversations, Dudu's mood, location, and recent activities.

Setup

  1. Dependencies: Ensure required libraries are installed.
  2. API Key: Set the OpenAI API key in the OPENAI_API_KEY constant.
  3. Run: Execute the main.py script to bring Dudu to life on Discord.

Special Note

Built with love for my girlfriend. ❤️

dudu-bot's People

Contributors

wwq010917 avatar

Stargazers

Xinan Rahman avatar

Watchers

 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.