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

State of release candidate #607

Closed
fabian-peschke opened this issue Dec 19, 2023 · 8 comments
Closed

State of release candidate #607

fabian-peschke opened this issue Dec 19, 2023 · 8 comments

Comments

@fabian-peschke
Copy link

When using 1.0.0rc2 there are the following issues:

  • TaskList not working ("An error occured" on the side where the tasklist should be)
  • Avatar has no affect
  • Messages as child of message not showing (create a new message with parent_id)

No bugs in terminal.
Are these bugs known or has the implementation changed?

@fabian-peschke
Copy link
Author

Found Message now takes id instead of parent_id and is working as expected now in rc2

@willydouhard
Copy link
Collaborator

TaskList and Avatar should work correctly, can you share a snippet of code to reproduce? Message no longer have children, instead a new Step concept has been introduced.

@willydouhard
Copy link
Collaborator

Opened #608 to fix the task list and avatars

@fabian-peschke
Copy link
Author

This is the code the worked before v1 release for the avatar (now with metadata):

@cl.on_chat_start
async def start():
    user = user_session.get("user")

    user_data = user.metadata
    user_image = user_data["image"]
    if user_image:
        user_image = base64.b64decode(user_image.split(',')[1])
    else:
        user_image = b" "

    await cl.Avatar(
        name=user.identifier,
        content=user_image
    ).send()

    current_path = os.path.dirname(os.path.abspath(__file__))

    await cl.Avatar(
        name="XX",
        path=f"{current_path}/assets/XX.jpeg"
    ).send()

This is how the tasklist worked before:

@cl.on_message
async def main(message: cl.Message):
    import asyncio

    msg = cl.Message(content="Init", author="XX")
    await msg.send()
    
    task_list = cl.TaskList(name="Steps")
    elements = []
    actions = []
    status = "Running..."
    task_list.status = status

    task = cl.Task(title="SOME NAME", status=cl.TaskStatus.READY)
    await task_list.add_task(task)
    await task_list.send()

    await asyncio.sleep(5)
    msg.content = "Done"
    await msg.send()

    task_list.status = "done"
    await task_list.send()

@fabian-peschke
Copy link
Author

If its not possible to append a message to a message how can I give the step a language? Like "python" or something like this?

@willydouhard
Copy link
Collaborator

Here are the pre release docs

@fabian-peschke
Copy link
Author

Okay this helped me on figuring out the cl.step part like so:

@cl.step
async def handle_debug_info(debug: dict):
    current_step = cl.context.current_step
    current_step.language = "python"
    return "def some_python(x: int)"

Why isn't a syntax like this not possible?:

@cl.step(language="python")
async def handle_debug_info(debug: dict):
    return "def some_python(x: int)"

@willydouhard
Copy link
Collaborator

I think I did not want to overload the decorator with all the step field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants