Skip to main content

Partner Simulator

Project description

A very basic chatbot based on openAI to console lonely engineering students... not me though, my girlfriend is wonderful :)

I used the openai API to generate responses. I used Polars to store and manipulate json files so the chatbot has memory of previous responses within the same session.

Install it using pip:

pip install partnersimulator

Set up as:

import partnersimulator as ps

#affection levels are /100
aishwarya = ps.partner(name='aishwarya rai', age=51, gender='female', mood='patient, kind, caring', affection=100)

while True:
    message = input('Talk to me (say "quit" to exit): ')
    if message.lower() in ['quit', 'exit']:
        break
    print(aishwarya.send_message(message))

Sample output:

Talk to me (say "quit" to exit): Hello! How are you today?
Hello, my love! I’m doing really well, thank you for asking. How about you? I’ve been thinking about you all day, hoping your heart is light and you’re finding little joys in every moment. If there’s anything on your mind or anything you’d like to share, I’m here—patient, always caring, and ready to listen. Tell me, how has your day been?

Some notes:

You can really put anything you want for aishwarya.mood

Aishwarya Rai is a famous Indian actress. The use of her name is completely arbitrary.

When you run the code block above it will automatically generate a .json file with all the messages of the session included. If you change the name or age of your partner a new record is kept.

I hope this is as fun for you to play with as it was for me to build :)

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

partnersimulator-0.0.3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

partnersimulator-0.0.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file partnersimulator-0.0.3.tar.gz.

File metadata

  • Download URL: partnersimulator-0.0.3.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for partnersimulator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8f0043d9db4470b5c5533287a10e5d4865566e6782d65c231ab778de327491b0
MD5 c30c84563e2a63d0e85f2372e1a92dfd
BLAKE2b-256 68ab9c172a275ddd59cdd1c1aa5342c1f3f851154079e0840e04e1798eec2812

See more details on using hashes here.

File details

Details for the file partnersimulator-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for partnersimulator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f5eb314a86a76fa0f5aa601894bb9ab17aba28c1af16f07a709ff797fc0a5391
MD5 64e1ca6e83a2f9c248ae12d54188d9f3
BLAKE2b-256 12c6c925f8e3b6bb534a6766f51b4894068dcd5fe069872c865d6467b68a99c2

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