> 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, 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 %}

## 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
