# `Foresight.LLM`
[🔗](https://github.com/fosferon/foresight/blob/v0.3.2/lib/foresight/seams/llm.ex#L1)

Seam behaviour for LLM completion.

Implementations supply structured completion (`complete_structured/4`,
`complete_json_schema/4`) and, optionally, native tool-calling
(`complete_with_tools/2` — omit it and the agentic reflect loop falls back to
the fixed structured pipeline). `supports_tool_calling?/1` detects which kind
of backend a module is.

# `complete_json_schema`

```elixir
@callback complete_json_schema(term(), [term()], map(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

# `complete_structured`

```elixir
@callback complete_structured(term(), [term()], module(), keyword()) ::
  {:ok, term()} | {:error, term()}
```

# `complete_with_tools`
*optional* 

```elixir
@callback complete_with_tools(
  [term()],
  keyword()
) :: {:ok, term()} | {:error, term()}
```

Tool-calling send used by the agentic reflect loop: given a message list
and `tools:` in opts, return the raw provider response carrying `tool_calls`.
Optional — providers/fakes that cannot do native tool-calling omit it, and the
reflect path falls back to the fixed structured pipeline.

# `supports_tool_calling?`

```elixir
@spec supports_tool_calling?(module()) :: boolean()
```

Whether `llm` implements native tool-calling (drives the agentic-vs-fixed reflect dispatch).

---

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