Chainlit / docs

9 stars 64 forks source link

Fix typo in customisation avatars.mdx #159

Closed LucasMagnum closed 6 days ago

LucasMagnum commented 2 weeks ago

To customise avatars is needed to use _ instead of - when naming the files otherwise they won't be find by server.

    avatar_id = avatar_id.strip().lower().replace(" ", "_")

    avatar_path = os.path.join(APP_ROOT, "public", "avatars", f"{avatar_id}.*")

Example, if your application config name is My Assistant then the avatar should be public/avatars/my_assistant.png.

Server: https://github.com/Chainlit/chainlit/blob/add72385a2b8013e60718b65e2e82eb385a51773/backend/chainlit/server.py#L914

willydouhard commented 6 days ago

Thank you for your contribution! Just merged another PR which fixes this issue