Skip to content

docs: fix inconsistent FinalAnswerTool import in unit1 tutorial#679

Open
octo-patch wants to merge 1 commit into
huggingface:mainfrom
octo-patch:fix/issue-579-tutorial-import-inconsistency
Open

docs: fix inconsistent FinalAnswerTool import in unit1 tutorial#679
octo-patch wants to merge 1 commit into
huggingface:mainfrom
octo-patch:fix/issue-579-tutorial-import-inconsistency

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #579

Problem

The partial import snippet at the top of the Unit 1 tutorial page showed FinalAnswerTool imported directly from smolagents:

from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool, InferenceClientModel, load_tool, tool

However, the actual Space template stores FinalAnswerTool in a local tools/ directory and imports it as from tools.final_answer import FinalAnswerTool. The complete app.py section later in the same tutorial file already showed this correctly — only the initial partial snippet was inconsistent.

Solution

Update the partial import snippet to match the complete app.py and the actual Space template structure:

  • Remove FinalAnswerTool from the smolagents import
  • Add from tools.final_answer import FinalAnswerTool as a separate import line

Testing

Visual review — both import blocks in tutorial.mdx now match the real Space template structure.

…huggingface#579)

The partial import snippet showed FinalAnswerTool imported from smolagents,
but the actual Space template and the complete app.py section in the same
file import it from tools.final_answer. Update the partial snippet to be
consistent with the real template structure.

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue in the code provided in unit1 tutorial

1 participant