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

chat: cw.Chat = cw.Chat(
    model="gpt-4o", 
    api_key="<Your API key here>", 
    rules=cw.chat_weaver_rules["basic"], 
    name="ChatWeaverBot", 
    replies_limit=10, 
    user="User"
    )

prompt: str = "Hi how are you?"
response = chat.get_response(prompt=prompt, user="User")

Requirements

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

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.0.1.tar.gz (7.0 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.0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for chatweaver-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d5443caf3a080fbec6cd1258adc54a4e34fd801fe9c1a07f71e310a3fab65f35
MD5 fcce45fd2d0b956412eec546cec0db1b
BLAKE2b-256 c66cae376b2cd26827bf3988b5bf499497cd5168e391c7475aae62897bf557fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chatweaver-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69331f9a395539128dc845bba11fc3d76aa7303177c1d40a198ab9cf48b601ab
MD5 8663a1fa920127adc93d950353582f51
BLAKE2b-256 ab3b5b39d4a0e39a7328117e2807046e5153676fe600dbda4577843906869119

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