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.5.tar.gz (3.4 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.5-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: partnersimulator-0.0.5.tar.gz
  • Upload date:
  • Size: 3.4 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.5.tar.gz
Algorithm Hash digest
SHA256 aa68a3ff88188aae14ebaf950d4abfc76d81b5573683f755d2f619c9767a62e6
MD5 e6d4d3c5fab09be9947427c386c82d52
BLAKE2b-256 802ef3a33f64af32bb3974d0af919e2b9026d723a06699db8cae614f40705f0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for partnersimulator-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 39ffe9d3f559ed32260f1d0b3ddd10aa015b7de50e36b09856a2c8a1fbd047d0
MD5 8c67d6cd287b7e13e4520265fd7276d7
BLAKE2b-256 f49bcee0b09fa632198a3636b33f7c311b40404419615e4158c61c66117e3699

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