Skip to main content

GPT4-powered python interpreter / AI assistant

Project description

Pandora

Pandora is an AI-powered Python console object, resulting from the combination of the latest GPT-4 Turbo model from OpenAI and a built-in interactive Python interpreter. This console allows users to execute Python commands/scripts in real time like a conventional Python console, but also allows to interact in natural language with the assistant and offers rich interactive and multimodal capabilities based on the real-time execution of AI-generated python scripts.

Main Features

  • Implements a custom AI-powered python console using OpenAI GPT4 Turbo model.
  • Usable both as a regular python console and/or an AI assistant.
  • Capable of generating and running scripts autonomously in its own internal interpreter.
  • Can be interacted with using a mix of natural language (markdown and LaTeX support) and python code.
  • Having the whole session in context. Including user prompts/commands, stdout outputs, etc... (up to 128k tokens)
  • Highly customizable input/output redirection and display (including hooks for TTS) for an easy and user friendly integration in any kind of application.
  • Modularity with custom tools passed to the agent and loaded in the internal namespace, provided their usage is precisely described to the AI (including custom modules, classes, functions, APIs).

Powerful set of builtin tools to:

  • facilitate communication with the user,
  • enable AI access to data/file content or module/class/function documentation/inspection,
  • files management (custom work and config folder, memory file, startup script, file upload)
  • access to external data (websearch tool, webpage reading),
  • notify status,
  • generate images via DALL-e 3,
  • persistent memory storage via an external json file.

Can also be used as an AI python function capable of generating scripts autonomously and returning any kind of processed data or python object according to a query in natural language along with some kwargs passed in the call, like so:

primes=pandora("return the list of first n prime numbers greater than m", n=5, m=15)
print(primes) # output: [17,19,23,29,31]

Can use the full range of common python packages in its scripts (provided they are installed and well known to the AI)

Installation

$ pip install pandora-ai

Usage

Using it with default setting is as minimal as:

from pandora_ai import Pandora

pandora=Pandora(openai_api_key=<your_api_key>) 
# The Open API key can be ommited in the constructor if it exists as an environment variable. 

pandora.interact() # enters a loop of interaction with the console-agent

Yet the Pandora class is designed to be highly configurable and easily integrated in any interface or codebase. Please refer to the full documentation or visit the Streamlit web app here to get a sense of how it can be used in a full setup.

License

This project is licensed. Please see the LICENSE file for more details.

Contributions

Contributions are welcome. Please open an issue or a pull request to suggest changes or additions.

Contact

For any questions or support requests, please contact Baptiste Ferrand at the following address: bferrand.maths@gmail.com.

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

pandora_ai-0.0.33.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

pandora_ai-0.0.33-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file pandora_ai-0.0.33.tar.gz.

File metadata

  • Download URL: pandora_ai-0.0.33.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pandora_ai-0.0.33.tar.gz
Algorithm Hash digest
SHA256 0c063200eddd5513418599ccf54747834070e340031c14e24dab80eff6ae9f8c
MD5 bd924354ca2a0f110fe292b55cc4c64a
BLAKE2b-256 628630b557e2ed1faeecf75dde98e336ea50e8f36b6b35f1dcfbfe8de2232960

See more details on using hashes here.

File details

Details for the file pandora_ai-0.0.33-py3-none-any.whl.

File metadata

  • Download URL: pandora_ai-0.0.33-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pandora_ai-0.0.33-py3-none-any.whl
Algorithm Hash digest
SHA256 6e4c068d4a06638c09fa6b603748ecb92a74039cc40b04fe30a231e2260d3835
MD5 8cbbeecd28a3916642cccb782bc7a7b3
BLAKE2b-256 d01436bd1adb1230c42c12930b86d56bb53dd2d0ad1c66fa40d5f4f08b2bfcf3

See more details on using hashes here.

Supported by

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