Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert PREFIX of fastapi server. #1939

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shkangomelet
Copy link

After the changes introduced in this pull request, issue #1904 occurred, leading to a rollback of the changes.

I tested running the following script locally using the command:

chainlit run demo.py -w --root-path /app

demo.py

import chainlit as cl


@cl.step(type="tool")
async def tool():
    # Fake tool
    await cl.sleep(2)
    return "Response from the tool!"


@cl.on_message  # this function will be called every time a user inputs a message in the UI
async def main(message: cl.Message):
    """
    This function is called every time a user inputs a message in the UI.
    It sends back an intermediate response from the tool, followed by the final answer.

    Args:
        message: The user's message.

    Returns:
        None.
    """


    # Call the tool
    tool_res = await tool()

    await cl.Message(content=tool_res).send()

The script runs without any issues in this setup. However, I have not yet investigated any potential side effects. I would appreciate it if you could review this further.

Added a `PREFIX` variable sourced from the `CHAINLIT_ROOT_PATH` environment variable. This prefix is applied to socket.io and API routes, enabling customizable root paths for deployment flexibility.
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. backend Pertains to the Python backend. labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Pertains to the Python backend. size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant