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.4.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.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: partnersimulator-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 a14cc693f92854da8b0ddb2598d1df566f2cf786f40583899868140f5258f7ce
MD5 959298c6e510d1499ac34596c87e92ca
BLAKE2b-256 c21abd27142bbc379fc676a0d838058094f3d97ad7e00dfce2b1f785da39c023

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for partnersimulator-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9c5681edef661da5b1db271a2cd74df2e4467b9087374474c608e4b3907ace81
MD5 d156a66b3a00ba5629f62cc358fcfb27
BLAKE2b-256 288381de3043451b3d358878fa34d3bb44a167d07147339c64639d522007e40d

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