# Asking for something

> The three kinds of request and what each one works on.

Every request starts with the same key, <kbd>Mod</kbd>+<kbd>.</kbd>. What you get depends on what's selected:

| Where you are | Request | What the agent does |
|---|---|---|
| At the cursor, nothing selected | **Completion** | Writes something there. |
| Text selected | **Request** | Does what you type in the box with the selected text: rewrite it, shorten it, answer a question about it. The instruction is optional. |
| One image selected | **Image** | Changes the picture the way you describe. The instruction is required. |

*[Picture: A blinking dot at the cursor: a completion waits to be picked up]* A completion at the cursor, waiting.
*[Picture: The request box under selected text, with an instruction]* A request on selected text, with its instruction.
*[Picture: A selected image with the key's hint in its corner]* A selected image: the key asks for a change to the picture.

The request is saved in the page as a marker (an HTML comment), so it's still there after a reload or a restart. Each
request gets its own agent. Up to three run at a time per page, and the rest wait in line.

## What can come back

- A **suggestion**: text at the cursor, a replacement for the selection, or text after it. It can also suggest changes
  to other parts of the page. Those are shown with it and applied with it.
- An **answer**, if you asked a question about the text. It stays on the request ("Answered") and nothing goes in the
  page.
- A **decline**, with the agent's reason, if it can't or shouldn't do it.

*[Picture: An Answered chip in place of a suggestion]*
*[Picture: A Declined chip with the agent's reason]*

For an image, the suggestion is a new picture in place of the old one:

*[Picture: The old image dimmed, the new one suggested beside it]*

## How a request is doing

The pill in the margin next to a request shows its state:

| Pill | Means |
|---|---|
| Clock | Waiting in line, or waiting for you to stop typing. |
| Agent icon | An agent is working on it. |
| Check, "Done" | Finished. The agent stays around for a few minutes in case you want to chat or ask again. |
| Moon | The agent is asleep. It wakes up, with its conversation, when you need it. |
| Bubble | You're chatting with its agent. |

If a run fails, it's retried. After three failures in a row, the request is declined. The
[agent panel's log](https://solipsist.sh/docs/reference/agent-panel/#the-log) says why each run failed.

## Turning agents off

The switch in the [agent panel](https://solipsist.sh/docs/reference/agent-panel/) turns a page's agents off. Your requests stay in the page and start when you turn the
agents back on.

Source: https://solipsist.sh/docs/guides/requests/
