Skip to content

Streaming output abnormal in adk web (thinking mode enabled): each token outputs to a separate dialog #4062

@zakahan

Description

@zakahan

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Describe the bug

After enabling the thinking mode and streaming output with adk web, the output is abnormal. The expected behavior is to have streaming output within a single dialog box, but in reality, each token is being output in a separate dialog box, resulting in multiple dialog boxes in the end.
Please refer to the attached images below for details.

To Reproduce

import os
from google.adk import Agent
from google.adk.models import LiteLlm

root_agent = Agent(
    name="agent",
    model=LiteLlm(
        model=f"openai/doubao-seed-1-6-251015",
        api_key=os.getenv("ARK_API_KEY"),
        api_base=os.getenv("ARK_API_BASE"),
    )
)

Execute adk web and enable streaming output

Expected behavior

Under normal circumstances, the content of thought should be output in a single dialog box, rather than each token being output in a separate dialog box.

Screenshots
Image

Image

Desktop (please complete the following information):

  • OS: macOS
  • Python version(python -V): Python 3.11.12
  • ADK version(pip show google-adk): 1.21.0

Model Information:

  • Are you using LiteLLM: Yes
  • Which model is being used: doubao-seed-1-6-251015

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    web[Component] This issue will be transferred to adk-web

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions