Skip to content

[BUG] Tool use not showing in the correct place #75

@jiapingzeng

Description

@jiapingzeng

What is the bug?

When I ask question that requires tool use, the tool use is shown at the end of the text message instead of its proper place as shown in screenshot.

Image

This occurs because we are missing TEXT_MESSAGE_END and TEXT_MESSAGE_START around the tool use. The text before and after should also have been two different message IDs. The correct events should have been:


data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"<first message id>","delta":" you."}

data: {"type":"TEXT_MESSAGE_END", ...}

data: {"type":"TOOL_CALL_START","toolCallId":"tooluse_UF9lEV6uqHrS0ZBlQr9KVg","toolCallName":"ListIndexTool","parentMessageId":"<first message id>"}

data: {"type":"TOOL_CALL_ARGS","toolCallId":"tooluse_UF9lEV6uqHrS0ZBlQr9KVg","delta":"{\"include_detail\": true}"}

data: {"type":"TOOL_CALL_END","toolCallId":"tooluse_UF9lEV6uqHrS0ZBlQr9KVg"}

data: {"type":"TOOL_CALL_RESULT","messageId":"<first message id>","toolCallId":"tooluse_UF9lEV6uqHrS0ZBlQr9KVg","content":"..."}

data: {"type":"TEXT_MESSAGE_END", ...}

data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"<second message id>","delta":"Here"}

How can one reproduce the bug?

Steps to reproduce the behavior.

What is the expected behavior?

A clear and concise description of what you expected to happen.

What is your host/environment?

Operating system, version.

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions