[docs] Polish react_agent doc: imports, runnable-example link, tool prerequisite, prompt & output-schema clarifications#802
Merged
Conversation
…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.
f67dd67 to
45602e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):react_agent_example.py/ReActAgentExample.java) and a consolidated imports block, so every symbol used in the snippets is resolvable.tools=[...]must be registered on theAgentsExecutionEnvironmentfirst (withadd_resource/addResourceexamples), linking to the Tool Use registration guide.{input};Row→ field names;dict/Map→ keys;BaseModel/Pojo → object fields).BaseModel(Python) / Pojo class (Java) /RowTypeInfo(both), sinceBaseModelis Python-only.Tests
Documentation-only change; no runtime impact. Verified manually:
ReActAgent.start_actionin Python and Java,Prompt.format_messages,find_first_system_message).{{< ref >}}targets resolve.API
No public API changes.
Documentation
doc-neededdoc-not-neededdoc-includedCloses #778