> For the complete documentation index, see [llms.txt](https://docs.nrnagents.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nrnagents.ai/getting-started/inference.md).

# Inference

In order to actually use the model in game, we need to perform inference. This means that we give the model a state matrix, and have it output an action.

For most use cases, it is appropriate to use the "select action" method. This will create a mapping which can then be used, via the action space conversion mention in [this section](/getting-started/action-space.md), to execute the action in-game.&#x20;

Alternatively, we allow game studios to access the "raw output", which is the probabilities of taking each of the actions in that state. The NRN Agents SDK comes with a **Probabilistic Agent Wrapper** that handles the distribution, but if game studios want more flexibility in building a custom wrapper, they are able to do this as well.

{% tabs %}
{% tab title="Javascript" %}

```javascript
// Sample from the distribution to select an action
const action = agent.selectAction(state);

// Get the probability distribution over actions
const probabilities = agent.getProbabilities(state);
```

{% endtab %}

{% tab title="C# - Unity" %}

```csharp
// Sample from the distribution to select an action
Dictionary<string, bool> action = Agent.SelectAction(state);

// Sample from the distribution to select an action
Dictionary<string, Matrix> probabilities = Agent.GetProbabilities(state);
```

{% endtab %}
{% endtabs %}
