Skip to content

[docs] Polish react_agent doc: imports, runnable-example link, tool prerequisite, prompt & output-schema clarifications#802

Merged
wenjin272 merged 1 commit into
apache:mainfrom
wzhero1:778-polish-react-agent-doc
Jun 8, 2026
Merged

[docs] Polish react_agent doc: imports, runnable-example link, tool prerequisite, prompt & output-schema clarifications#802
wenjin272 merged 1 commit into
apache:mainfrom
wzhero1:778-polish-react-agent-doc

Conversation

@wzhero1
Copy link
Copy Markdown
Collaborator

@wzhero1 wzhero1 commented Jun 8, 2026

Linked issue: #778

Purpose of change

Doc-quality follow-ups for docs/content/docs/development/react_agent.md, found during react_agent doc verification (#741):

  • Overview: add the missing trailing period.
  • Self-contained snippets: add a top-of-page pointer to the runnable example (ReAct Agent Quickstart + react_agent_example.py / ReActAgentExample.java) and a consolidated imports block, so every symbol used in the snippets is resolvable.
  • Tool prerequisite: note that tools referenced in tools=[...] must be registered on the AgentsExecutionEnvironment first (with add_resource / addResource examples), linking to the Tool Use registration guide.
  • Prompt structure: reword the hard "must contain two messages" rule into a recommended pattern; the SYSTEM message is optional and the schema instruction is prepended automatically when it is absent.
  • Placeholder substitution: document how USER-message placeholder names are derived from the input element (primitive → {input}; Row → field names; dict/Map → keys; BaseModel/Pojo → object fields).
  • Output schema: clarify as BaseModel (Python) / Pojo class (Java) / RowTypeInfo (both), since BaseModel is Python-only.

Tests

Documentation-only change; no runtime impact. Verified manually:

  • All six issue claims checked against source (ReActAgent.start_action in Python and Java, Prompt.format_messages, find_first_system_message).
  • Python imports in the new imports block were run-checked in the venv; Java imports were harvested from the actual example/source files.
  • Hugo shortcodes are balanced (tabs/tab/hint), all tab-group ids are unique, and both {{< ref >}} targets resolve.

API

No public API changes.

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

Closes #778

@github-actions github-actions Bot added doc-included Your PR already contains the necessary documentation updates. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue. labels Jun 8, 2026
…rerequisite, prompt and output-schema clarifications

Doc-quality follow-ups from react_agent doc verification (apache#741):

- Overview: add the missing trailing period (line 27).
- Add a top-of-page runnable-example pointer (ReAct Agent Quickstart +
  the react_agent_example.py / ReActAgentExample.java sources) and a
  consolidated imports block, so the page's snippets are self-contained.
- Note that tools referenced in `tools=[...]` must be registered on the
  AgentsExecutionEnvironment before the agent runs, with add_resource /
  addResource examples and a link to the Tool Use registration guide.
- Reword the prompt structure from a hard "must contain two messages"
  rule into a recommended pattern; the SYSTEM message is optional and the
  schema instruction is prepended automatically when it is absent.
- Document how USER-message placeholder names are derived from the input
  element (primitive -> {input}; Row -> field names; dict/Map -> keys;
  BaseModel/Pojo -> object fields).
- Clarify the output schema as BaseModel (Python) / Pojo class (Java) /
  RowTypeInfo (both), since BaseModel is Python-only.
@wzhero1 wzhero1 force-pushed the 778-polish-react-agent-doc branch from f67dd67 to 45602e7 Compare June 8, 2026 07:27
@wzhero1 wzhero1 marked this pull request as ready for review June 8, 2026 08:27
@wzhero1 wzhero1 requested a review from wenjin272 June 8, 2026 08:27
Copy link
Copy Markdown
Contributor

@wenjin272 wenjin272 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenjin272 wenjin272 merged commit 9eadd0d into apache:main Jun 8, 2026
17 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-included Your PR already contains the necessary documentation updates. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tech Debt] Polish react_agent doc: imports, runnable-example link, tool prerequisite, prompt and output-schema clarifications

2 participants