Skip to main content

A simple (for the moment) package that allows you to implement the back-end of a ai chat-bot with openai models in python.

Project description

ChatWeaver

ChatWeaver is a Python library that simplifies the implementation of chatbots powered by OpenAI models. Designed with developers in mind, it provides powerful features and an intuitive interface to enhance the development of conversational AI.


Features

  • Chat History Management: Easily track and manage conversation context.
  • Message Templates: Automatically remember and include previous messages in prompts.
  • File Integration: Add images and PDF files to your prompts seamlessly.
  • Custom Model Support: Compatible with various OpenAI models.
  • Extensibility: Flexible architecture for scalable chatbot solutions.

Installation

Install ChatWeaver using pip:

pip install chatweaver

Quick Start

Here’s how you can get started with ChatWeaver:

import chatweaver as cw

model = cw.Model(
    model="gpt-4o", 
    api_key="<Your OpenAI API key here>"
    )

bot = cw.Bot(
    rules=cw.chat_weaver_rules["basic"], 
    name="AiBot", 
    cw_model=model
    )

chat = cw.Chat(
    replies_limit=10, 
    user="Diego", 
    cw_bot=bot
    )

prompt = "Hi how are you?"
print(chat.get_response(prompt=prompt))

Requirements

  • Python 3.8 or above.
  • OpenAI Python library (openai).

Whats new in 0.1.0?

  • Implemented a new method for creating chats while ensuring backward compatibility with the existing system.
  • Enhanced the Bot's capabilities by enabling it to remember the user's name along with its own.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatweaver-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chatweaver-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file chatweaver-0.1.0.tar.gz.

File metadata

  • Download URL: chatweaver-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for chatweaver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e883d8540bc61e2daf7e57497a9e9b92f5f870350260733fb538d5702b394bc4
MD5 af098f1b36c83f3877f7b98b55406591
BLAKE2b-256 4989898e86029940c35e90e3048f0c49c59e758ea9fab21915b219c7c267b8e1

See more details on using hashes here.

File details

Details for the file chatweaver-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chatweaver-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for chatweaver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 461a06dddb0ef84207875682c36e54f2685d508d73c44c26265d1058aa4d5d39
MD5 c9664b2e0337e443860e6a278503ff9f
BLAKE2b-256 5da84ed64cdba6685136fbfe9baa68fb8bc2db2ef6f62fa1f67a23c0b095af25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page