Skip to main content

SDK for Charisma.ai

Project description

Charisma.ai SDK for Python

pip install charisma-sdk

Usage

from charisma_sdk.playthrough import Playthrough
from charisma_sdk.api import (
    create_playthrough_token,
    create_conversation,
    set_memory,
    set_mood,
)

story_id = 1

token = create_playthrough_token({"story_id": story_id})
conversation_id = create_conversation(token)

set_memory(token, "my_memory_recall", "the value to save!")
set_mood(token, "My Character Name", {"happiness": 15})

playthrough = Playthrough(token)
playthrough.on("message", lambda message: print("Received a message:", message))
playthrough.connect()

# Some time later...
playthrough.start({"conversationId": conversation_id})
# Some time later...
playthrough.reply({"conversationId": conversation_id, "text": "This is my message to send to Charisma."})

Questions?

Get in touch with us at hello@charisma.ai and we'll be happy to help you out!

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

charisma_sdk-0.2.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

charisma_sdk-0.2.0-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file charisma_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: charisma_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for charisma_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 922901f4985ed0751e2db980cac8faf8b4168553050e331cdc946bbba33c3cd4
MD5 6bcdfd10c2f9671c23ecc932fd99d327
BLAKE2b-256 cb4ca733f1579c9b802b43b66cfb17d8ad10f6338ed051d0b074b4d5be14d876

See more details on using hashes here.

File details

Details for the file charisma_sdk-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: charisma_sdk-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for charisma_sdk-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 22fa2c23c26ecfcaca2da00f39d87b0bb4c0cbb5a122733c31d10c59544f8cf4
MD5 1bb22bbf17d407716ab0c57f2a7b1ce0
BLAKE2b-256 8e084ebf24409f6e93505006360fc3c98da2537f4dcedc808c046749ff9e84bb

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