> For the complete documentation index, see [llms.txt](https://gilad-rubin.gitbook.io/hypster/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gilad-rubin.gitbook.io/hypster/in-depth/hp-call-types/text-and-multi-text.md).

# Textual Types

Use `hp.text()` for one string and `hp.multi_text()` for a list of strings.

## Signatures

{% code overflow="wrap" %}

```python
hp.text(default, *, name, multiline=False, allow_none=False)
hp.multi_text(default, *, name, allow_none=False)
```

{% endcode %}

## Single Text Values

{% code overflow="wrap" %}

```python
from hypster import HP, instantiate

def llm_config(hp: HP):
    return {
        "model_name": hp.text("gpt-5.5-mini", name="model_name"),
        "system_prompt": hp.text("Answer concisely.", name="system_prompt"),
    }

cfg = instantiate(
    llm_config,
    values={"system_prompt": "Answer with citations."},
)

assert cfg["system_prompt"] == "Answer with citations."
```

{% endcode %}

## Multiline Text

`multiline=True` records `{"multiline": True}` in the parameter's metadata, so schema consumers (such as the interactive UI) render a textarea instead of a single-line input. The value itself is an ordinary string either way:

{% code overflow="wrap" %}

```python
from hypster import HP, explore

def prompt_config(hp: HP):
    return hp.text("You are a helpful assistant.", name="system_prompt", multiline=True)

schema = explore(prompt_config, return_schema=True)
assert schema.parameters[0].metadata == {"multiline": True}
```

{% endcode %}

## Nullable Text

Use `allow_none=True` when `None` is an intentional text value:

{% code overflow="wrap" %}

```python
def config(hp: HP):
    return hp.text(None, name="system_prompt", allow_none=True)

assert instantiate(config) is None
```

{% endcode %}

## Multiple Text Values

{% code overflow="wrap" %}

```python
def generation_config(hp: HP):
    return {
        "stop_sequences": hp.multi_text(["###", "END"], name="stop_sequences"),
        "columns": hp.multi_text(["title", "body"], name="columns"),
    }

cfg = instantiate(
    generation_config,
    values={"stop_sequences": ["STOP", "DONE"]},
)

assert cfg["stop_sequences"] == ["STOP", "DONE"]
```

{% endcode %}

Nullable elements are not supported for `multi_text`; use `multi_select(..., allow_none=True)` for nullable categorical lists.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gilad-rubin.gitbook.io/hypster/in-depth/hp-call-types/text-and-multi-text.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
