# `GenAI.Graph.NodeBehaviour`

Behaviour Graph Node Elements must adhere to.

# `description`

```elixir
@callback description(graph_node :: term()) :: {:ok, String.t()} | {:error, any()}
```

# `description`

```elixir
@callback description(graph_node :: term(), default :: any()) ::
  {:ok, String.t()} | {:error, any()}
```

# `handle`

```elixir
@callback handle(graph_node :: term()) ::
  {:ok, GenAI.Types.Graph.node_handle()} | {:error, any()}
```

# `handle`

```elixir
@callback handle(graph_node :: term(), default :: any()) ::
  {:ok, GenAI.Types.Graph.node_handle()} | {:error, any()}
```

# `id`

```elixir
@callback id(graph_node :: term()) :: {:ok, GenAI.Types.Graph.node_id()} | {:error, any()}
```

# `name`

```elixir
@callback name(graph_node :: term()) :: {:ok, String.t()} | {:error, any()}
```

# `name`

```elixir
@callback name(graph_node :: term(), default :: any()) ::
  {:ok, String.t()} | {:error, any()}
```

# `new`

```elixir
@callback new() :: struct()
```

# `new`

```elixir
@callback new(options :: term()) :: struct()
```

# `defnodestruct`
*macro* 

Define the struct of a node with default fields included.

## Example
```elixir
  defnodestruct [
      value: nil,
  ]
```

# `defnodetype`
*macro* 

Define the type of a node with default fields included.

## Example

```elixir
defnodetype [
   internal: boolean,
]
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
