---
title: "Option classes"
manual: "TYPO3 LLM Extension"
version: "main"
permalink: "https://docs.typo3.org/permalink/netresearch/nr-llm:api-options@main"
source: "Api/OptionClasses.rst"
rendered: "2026-09-24T12:49:43+00:00"
---

# Option classes {#api-options}

## ChatOptions {#chatoptions}

-   **class ChatOptions**

    -   *Fully qualified name:* `\Netresearch\NrLlm\Service\Option\ChatOptions`

    Typed options for chat operations.

    -   **static factual()**

        Create options optimized for factual responses (temperature: 0.1).

        -   *returns:* ChatOptions

    -   **static creative()**

        Create options for creative content (temperature: 1.2).

        -   *returns:* ChatOptions

    -   **static balanced()**

        Create balanced options (temperature: 0.7).

        -   *returns:* ChatOptions

    -   **static json()**

        Create options for JSON output format.

        -   *returns:* ChatOptions

    -   **static code()**

        Create options optimized for code generation.

        -   *returns:* ChatOptions

    -   **withTemperature(float $temperature) : self**

        Set temperature (0.0 - 2.0).

    -   **withMaxTokens(int $maxTokens) : self**

        Set maximum output tokens.

    -   **withTopP(float $topP) : self**

        Set nucleus sampling parameter.

    -   **withFrequencyPenalty(float $penalty) : self**

        Set frequency penalty (-2.0 to 2.0).

    -   **withPresencePenalty(float $penalty) : self**

        Set presence penalty (-2.0 to 2.0).

    -   **withSystemPrompt(string $prompt) : self**

        Set system prompt.

    -   **withResponseFormat(string $format) : self**

        Request an output format: `text`, `json` or `markdown`.
        `json` activates the provider's native JSON mode on every
        adapter ([ADR-128](https://docs.typo3.org/permalink/netresearch/nr-llm:adr-128@main)).

    -   **withResponseSchema(array $schema) : self**

        Attach a strict-subset JSON schema ([ADR-126](https://docs.typo3.org/permalink/netresearch/nr-llm:adr-126@main)) the
        provider should enforce natively where it can. Set automatically
        by `completeStructured()`; the local strict validation remains
        authoritative either way.

    -   **withStopSequences(array $sequences) : self**

        Set stop sequences the model must not generate past.

    -   **withProvider(string $provider) : self**

        Set provider (openai, claude, gemini).

    -   **withModel(string $model) : self**

        Set specific model.

    -   **withReasoningEffort(ReasoningEffort $effort) : self**

        Ask a reasoning model for an amount of thinking: one of the
        `ReasoningEffort` cases `None`, `Minimal`, `Low`,
        `Medium`, `High`, `XHigh` and `Max`
        ([ADR-204](https://docs.typo3.org/permalink/netresearch/nr-llm:adr-204@main)). It wins over the coarse `think`
        switch. An effort the model does not allow is moved onto its own
        scale before the request is sent — `None` becomes `Low` on
        GPT-6 Astra — and the applied value is written to the response
        metadata under `nrllm_reasoning_effort`. Only OpenAI's GPT-6
        models have an effort scale today; every other model and provider
        ignores the option and writes no such key.

    -   **toArray() : array**

        Convert to array format.
