Jido.Tools.Weather (jido_tools v0.1.0)

View Source

Summary

Functions

Demo function to test both test and real API cases. Usage in IEx: iex> Jido.Tools.Weather.demo()

Callback implementation for Jido.Action.on_after_run/1.

Executes the Action with the given parameters and context.

Validates the input parameters for the Action.

Functions

category()

demo()

Demo function to test both test and real API cases. Usage in IEx: iex> Jido.Tools.Weather.demo()

description()

name()

on_after_run(result)

Callback implementation for Jido.Action.on_after_run/1.

on_after_validate_params(params)

Callback implementation for Jido.Action.on_after_validate_params/1.

on_before_validate_params(params)

Callback implementation for Jido.Action.on_before_validate_params/1.

on_error(failed_params, error, context, opts)

Callback implementation for Jido.Action.on_error/4.

run(params, context)

@spec run(map(), map()) :: {:ok, map()} | {:error, any()}

Executes the Action with the given parameters and context.

The run/2 function must be implemented in the module using Jido.Action.

schema()

tags()

to_json()

to_tool()

validate_params(params)

@spec validate_params(map()) :: {:ok, map()} | {:error, String.t()}

Validates the input parameters for the Action.

Examples

iex> defmodule ExampleAction do
...>   use Jido.Action,
...>     name: "example_action",
...>     schema: [
...>       input: [type: :string, required: true]
...>     ]
...> end
...> ExampleAction.validate_params(%{input: "test"})
{:ok, %{input: "test"}}

iex> ExampleAction.validate_params(%{})
{:error, "Invalid parameters for Action: Required key :input not found"}

vsn()