Skip to main content

A library to help and facilitate the creation of bots and AI assistants

Project description

EasyBot Library

EasyBot is a Python library designed to facilitate the creation of AI-powered bots using OpenAI's API. This library provides a simple interface to integrate various functionalities and create a customizable assistant.

Features

  • Easy integration with OpenAI's API.
  • Customizable bot functions.
  • Simple setup and usage.

Installation

To install the EasyBot library, you can use pip:

pip install easybot-py

Usage

Usage Here is an example of how to use the EasyBot library:

import os
from easy_bot import EasyBot

def sum(a: int, b: int, positive: bool = False):
    """
    Made an operation and returns the result
    @a : int First operand
    @b : int Second operand
    """
    return a + b

def main():
    INSTRUCTION = "You're a Math tutor, you should use the functions"
    token = os.getenv('OPENAI_API_KEY')
    if token is None:
        raise ValueError('Token key is not set in env variables')

    client = EasyBot(token, INSTRUCTION)
    client.add_function(sum)
    client.create_assistant()

    response = client.create_text_completion('What is 24556 + 554322 + 2')
    print(response)

if __name__ == "__main__":
    main()

Here you're using the default model of EasyBot, it's using the OpenAI endpoint to generate the response. It's using by default the gpt-4o-mini model. You can change the model by passing the model name in the create_assistant method.

import os
from easy_bot import EasyBot, OpenAICore

# Your functions here
# ...

def main():
    INSTRUCTION = "You're a Math tutor, you should use the functions"
    token = os.getenv('OPENAI_API_KEY')
    if token is None:
        raise ValueError('Token key is not set in env variables')

    client = EasyBot(token, INSTRUCTION)
    client.add_function(sum)
    client.create_assistant(OpenAICore, model='gpt-4o')

    response = client.create_text_completion('What is 24556 + 554322 + 2')
    print(response)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

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

easybot_py-0.0.4.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

easybot_py-0.0.4-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file easybot_py-0.0.4.tar.gz.

File metadata

  • Download URL: easybot_py-0.0.4.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for easybot_py-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1d3c38083f41f5c52d6203f38545bc5cdc8cc9c05bf0c474d714e4d9afd3d332
MD5 6e1149fd9a60c2279800ae984fe7511e
BLAKE2b-256 8182d15f25b763c0339ef587d0b12a3faef28958e793e1addd8bbd98d0c8cde2

See more details on using hashes here.

File details

Details for the file easybot_py-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: easybot_py-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for easybot_py-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f8711fa444846e7c05e350e3360f154cfd3a8022a666efb506e34c5099d38f13
MD5 5daff206d6c1af35406e4001f9578c23
BLAKE2b-256 0810f61602e4a0ce1c3a231381c36423e3d5fbfa03dcf4e97ed212c45bc39106

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