b7f52be4c9
CI / Run CI (push) Has been cancelled
CI / check-backend (push) Has been cancelled
CI / check-frontend (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / e2e-tests (push) Has been cancelled
Copilot Setup Steps / copilot-setup-steps (push) Has been cancelled
16 lines
446 B
Python
16 lines
446 B
Python
import os
|
|
|
|
import chainlit as cl
|
|
|
|
# Get the directory where the script is located
|
|
script_directory = os.path.dirname(os.path.abspath(__file__))
|
|
# Create absolute path to the audio file
|
|
audio_path = os.path.join(script_directory, "../../fixtures/example.mp3")
|
|
|
|
|
|
@cl.on_chat_start
|
|
async def start():
|
|
elements = [cl.Audio(name="example.mp3", path=audio_path)]
|
|
|
|
await cl.Message(content="This message has an audio", elements=elements).send()
|