FAQ

ModuleNotFoundError

If your deployment failed and the logs show ModuleNotFoundError, it is often because you have failed to specify dependences. Below is an example of an error message you might see in this situation.

module not found

To resolve this, specify requirements during packaging.

package(
Metadata(
name="Deploy Successfully!",
image_url=IMAGE_URL,
color="f1a2b3",
description="We've got requirements 🤓.",
input_class=Bot,
),
requirements=["nltk"],
)
Copied!

Getting logs for your deployment

from chai_py import display_logs, get_logs
# You can find existing bot UIDs in the file named _deployment.
bot_uid = ""
display_logs(
get_logs(
bot_uid=bot_uid,
errors=True,
)
)
Copied!

Deployment of function stuck on "initializing"

The function likely failed to deploy. Check that you have followed the deployment guidelines:

  • Required packages are specified in the requirements argument in the package() call.
  • Do not override the __init__() function. Do it in the setup() method.
  • Do not create a main.py file in your bot's root directory.

Deployed a Chat AI and don't know how to chat with it?

  1. Install the Chai app on your iOS or Android device.
  2. Go to the Chai Developer Platform and sign in.
  3. Mouseover your AI's avatar to reveal a QR code. Scan this QR code to chat with your AI! Feel free the share your QR code too!

QR code does not work?

  • Make sure you have the Chai app installed.
  • If you have the Chai app installed but are still having QR code problems: Download a functional QR code reader that allows you to open the URL. We recommend Binary Eye (also on FDroid)

Known problematic apps:

  • Google Lens: Does not open as a URL
  • QR code generators that prepend a http://.

Deployment Constraints

See AI Constraints.

What should the directory structure look like?

The overall directory structure for local development should look something like:

Files with a leading underscore (e.g. _file.txt) are ignored in packaging.

  • root
    • bot
      • bot.py
      • requirements.txt
    • t_room.py: Chatting to the bot in development
    • dist.py: For calls to chai_py.upload_and_deploy("bot/_package.zip")

Where can I get help?

Join us on Discord! We'll be able to help answer any questions you have, or maybe even hop in a voice call to discuss things!