Skip to content

Docs: ai-agent-with-tools tutorial references unavailable Weather tool modules #117

@ortegacmanuel

Description

@ortegacmanuel

Problem

The AI Agent with Tools livebook tutorial references Jido.Tools.Weather.* modules as if they ship with the jido or jido_ai hex packages:

  • Jido.Tools.Weather.Geocode
  • Jido.Tools.Weather.LocationToGrid
  • Jido.Tools.Weather.Forecast
  • Jido.Tools.Weather.CurrentConditions

The docs state: "Jido ships weather tools that wrap the free NWS (National Weather Service) API."

However, these modules were removed from jido_action and currently only exist as fallback/example code in jido_ai's examples/lib/compat/weather_tools_fallback.ex. Since examples/ is excluded from hex packages, users following the tutorial get UndefinedFunctionError when trying to use them.

Additional issue found

Even after copying the tools into a project, the LLM agent crashes because the tool schemas use {:in, [:detailed, :summary]} (atom enums), but LLM tool calls send string values ("summary"). The schema validation rejects them with Jido.Action.Error.InvalidInputError, which then crashes the ReAct loop because that error struct doesn't implement Jason.Encoder.

Suggested fixes

  1. Update the livebook to either:
    • Point users to copy the weather tools from jido_ai/examples/lib/compat/weather_tools_fallback.ex, or
    • Include the tool definitions inline in the tutorial, or
    • Note that users need {:jido_ai, github: "agentjido/jido_ai"} (git dep, not hex) and must compile the examples path
  2. Fix the enum schemas in the example tools to accept strings (since LLMs always send JSON string values, not Elixir atoms)
  3. Consider publishing the weather tools in a hex package (e.g. jido_action or a new jido_tools package)

Steps to reproduce

  1. Follow the tutorial at https://jido.run/docs/learn/ai-agent-with-tools
  2. Add {:jido, "~> 2.1"} and {:jido_ai, "~> 2.0"} to mix.exs
  3. Run Jido.Tools.Weather.Geocode.run(%{location: "Denver, CO"}, %{}) in iex
  4. Get UndefinedFunctionError

Environment

  • jido 2.2.0
  • jido_ai 2.1.0
  • jido_action 2.2.0
  • Elixir 1.18.1 / OTP 27

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions