refactor: remove streaming structured output unused function

Signed-off-by: Stream <Stream_2@qq.com>
This commit is contained in:
Stream
2026-01-30 03:46:41 +08:00
parent 4a7f6597c4
commit 869b43a95b

View File

@ -236,27 +236,6 @@ def _extract_structured_output(llm_result: LLMResult) -> Mapping[str, Any]:
return _parse_structured_output(content)
def _extract_structured_output_from_stream(
result_text: str,
tool_call_args: dict[str, str],
) -> Mapping[str, Any]:
"""
Extract structured output from streaming collected data.
First tries to parse from collected tool call arguments, then falls back to text content.
"""
# Try to parse from tool call arguments first
if tool_call_args:
# Use the first non-empty tool call arguments
for arguments in tool_call_args.values():
if arguments.strip():
return _parse_tool_call_arguments(arguments)
# Fallback to text content parsing
if not result_text:
raise OutputParserError("No tool call arguments and no text content to parse")
return _parse_structured_output(result_text)
def _parse_tool_call_arguments(arguments: str) -> Mapping[str, Any]:
"""Parse JSON from tool call arguments."""
if not arguments: