datawhalechina/hello-agents · error · ValueError

会议记录过短,请至少提供 20 个字符

Error message

会议记录过短,请至少提供 20 个字符

What it means

This ValueError is raised by the notebook's own validate_transcript() helper when the meeting transcript passed to the agent pipeline is empty or shorter than 20 characters after stripping whitespace. It is a domain-level input guard, not a library error: the agent refuses to summarize content that is too short to be a real meeting record. The 20-character floor is hardcoded in the cell at main.ipynb:362.

Source

Thrown at Co-creation-projects/Henry2513-MeetingActionAgent/main.ipynb:362

   "metadata": {},
   "source": [
    "## 6. 完整分析流程\n",
    "\n",
    "首次审核通过时只调用两次模型;未通过且仍有两次预算时,MinutesAgent 修正一次,再由 ReviewAgent 最终复核。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "225d6a8f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 检查并清理输入的会议文本。\n",
    "def validate_transcript(transcript: str) -> str:\n",
    "    cleaned = transcript.strip()\n",
    "    if len(cleaned) < 20:\n",
    "        raise ValueError(\"会议记录过短,请至少提供 20 个字符\")\n",
    "    return cleaned\n",
    "\n",
    "\n",
    "# 组合审核会议纪要所需的提示词。\n",
    "def make_review_prompt(transcript: str, draft: MeetingResult) -> str:\n",
    "    return (\n",
    "        \"请审核以下会议纪要草稿。\\n\\n\"\n",
    "        f\"【会议原文】\\n{transcript}\\n\\n\"\n",
    "        f\"【纪要草稿】\\n{draft.model_dump_json(indent=2)}\"\n",
    "    )\n",
    "\n",
    "\n",
    "# 执行纪要提取、审核和必要时修正的完整流程。\n",
    "def analyze_meeting(transcript: str) -> tuple[MeetingResult, ReviewResult, int]:\n",
    "    transcript = validate_transcript(transcript)\n",
    "    minutes_agent, review_agent = build_agents()\n",
    "    budget = CallBudget(maximum=4)\n",
    "\n",

View on GitHub (pinned to 606a07d341)

Solutions

  1. Provide a real meeting transcript of at least 20 non-whitespace characters before running the pipeline (e.g. assign transcript = '<pasted meeting notes>' in the preceding cell).
  2. If this fires during automated testing, make the test fixture >= 20 characters or monkeypatch/relax the threshold via a parameter.
  3. If short inputs are legitimate in your flow, refactor validate_transcript(transcript: str, min_len: int = 20) and pass a smaller min_len explicitly instead of editing the constant.
  4. Add an upstream length check at the UI/API boundary so users get a friendly message before the agent cell runs.

Example fix

// before
def validate_transcript(transcript: str) -> str:
    cleaned = transcript.strip()
    if len(cleaned) < 20:
        raise ValueError("会议记录过短,请至少提供 20 个字符")
    return cleaned

// after
def validate_transcript(transcript: str, min_len: int = 20) -> str:
    cleaned = transcript.strip()
    if len(cleaned) < min_len:
        raise ValueError(f"会议记录过短,请至少提供 {min_len} 个字符")
    return cleaned
Defensive patterns

Strategy: validation

Validate before calling

MIN_LEN = 20

def is_valid_transcript(transcript: str) -> bool:
    return isinstance(transcript, str) and len(transcript.strip()) >= MIN_LEN

# before calling the pipeline:
if not is_valid_transcript(transcript):
    raise ValueError(f"transcript too short: need >= {MIN_LEN} chars, got {len(transcript.strip())}")

Type guard

def is_meeting_transcript(value: object) -> TypeGuard[str]:
    return isinstance(value, str) and len(value.strip()) >= 20

Try / catch

try:
    cleaned = validate_transcript(transcript)
except ValueError as e:
    # input error: surface to the user, do not retry
    print(f"输入有误: {e}")
    raise SystemExit(1) from e

Prevention

When it happens

Trigger: Calling validate_transcript(transcript) with an empty string, a whitespace-only string, or a transcript whose stripped length is < 20 (e.g. passing an unpopulated variable, a placeholder like "会议内容", or a UI textarea submitted before the user pasted the meeting notes). The function is invoked before make_review_prompt()/the summarization flow, so any short input reaching the pipeline triggers it.

Common situations: Demo notebooks run top-to-bottom without filling in the sample transcript; a variable named transcript left as '' from an earlier cell; copy-pasting only a title or greeting instead of the full minutes; automated tests feeding fixture strings shorter than 20 chars; trailing-newline-only input from a file read.

Related errors


AI-assisted analysis of datawhalechina/hello-agents@606a07d341 (2026-08-14). Data as JSON: /api/errors/464196e6d19b521c. Report an issue: GitHub.