> For the complete documentation index, see [llms.txt](https://docs.eyepop.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eyepop.ai/platform/abilities/user-defined-vlm-tasks/response-schema.md). Agents can also search and read this documentation through its [MCP server](https://docs.eyepop.ai/~gitbook/mcp).

# Free-form prompt with a response schema

Ask a vision-language ability in your own words and get its answer as JSON of the shape you define

A response schema makes the model answer with a JSON object of the shape you define, and the parsed object comes back in `details`. Use it when you want several answers at once, each with a type. The example runs on a street photo, 810 x 1080, of a blue electric minibus with four people walking past it. The output was captured from production.

This ability counts the people and names the vehicles, created with the Python SDK. It leaves out `model`, so it runs on `qwen3`:

```python
from openapi_pydantic import Schema
from eyepop import EyePopSdk
from eyepop.data.types.vlm import VlmAbilityCreate, VlmAbilityGroupCreate

account_uuid = "<account-uuid>"
namespace = "<your-namespace>"

alias = f"{namespace}.describe.street-summary"
ability = VlmAbilityCreate(
    name=alias,
    description="Counts the people and names the vehicles in a street scene",
    text_prompt="Count the people in the image and name each kind of vehicle you can see.",
    response_schema=Schema.model_validate({
        "type": "object",
        "properties": {
            "people": {"type": "integer"},
            "vehicles": {"type": "array", "items": {"type": "string"}},
        },
        "required": ["people", "vehicles"],
        "additionalProperties": False,
    }),
)

with EyePopSdk.dataEndpoint(account_id=account_uuid) as endpoint:
    group = endpoint.create_vlm_ability_group(VlmAbilityGroupCreate(
        name=alias, description=ability.description, default_alias_name=alias,
    ))
    created = endpoint.create_vlm_ability(create=ability, vlm_ability_group_uuid=group.uuid)
    endpoint.publish_vlm_ability(vlm_ability_uuid=created.uuid, alias_name=alias)
```

Run it the same way:

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

```json
{
  "components": [
    { "type": "inference", "ability": "<your-namespace>.describe.street-summary:latest" }
  ]
}
```

{% endtab %}

{% tab title="Python" %}

```python
from eyepop import EyePopSdk
from eyepop.worker.worker_types import InferenceComponent, Pop

pop = Pop(components=[
    InferenceComponent(ability="<your-namespace>.describe.street-summary:latest"),
])

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    result = endpoint.upload("street.jpg").predict()

for answer in result.get("details", []):
    print(answer)
```

{% endtab %}

{% tab title="Node" %}

```typescript
import { EyePop, PopComponentType } from '@eyepop.ai/eyepop'

const endpoint = await EyePop.workerEndpoint({
    pop: {
        components: [
            {
                type: PopComponentType.INFERENCE,
                ability: '<your-namespace>.describe.street-summary:latest',
            },
        ],
    },
}).connect()

try {
    const results = await endpoint.process({ source: { path: 'street.jpg' } })
    for await (const result of results) {
        for (const answer of result.details ?? []) {
            console.log(answer)
        }
    }
} finally {
    await endpoint.disconnect()
}
```

{% endtab %}
{% endtabs %}

```
{'people': 4, 'vehicles': ['bus']}
```

```json
"details": [{ "people": 4, "vehicles": ["bus"] }]
```

<figure><img src="https://1072321683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDoCvfjveqiJFmk0cnXCp%2Fuploads%2Fgit-blob-c23762a160519b617a3531e8756d34cb72e15447%2Fabilities-schema.jpg?alt=media" alt="The street photo with the answer below it: details, people 4, vehicles bus" width="400"><figcaption><p>The answer comes back as JSON of the shape the schema defines.</p></figcaption></figure>

`gemini_4_argon` and `gpt_6_astra` answer a response schema too: add `model=VlmModel.gemini_4_argon` (import `VlmModel` from `eyepop.data.types`), or `model: 'gemini_4_argon'` in Node. An answer from them that does not match the schema is a failed call, and it is billed; see [Choosing a model](https://docs.eyepop.ai/platform/abilities/user-defined-vlm-tasks.md#choosing-a-model).

See [Details](https://docs.eyepop.ai/platform/response-format/predictions/raw-and-details.md#details) for where `details` appears, and [Example: Make and Model Insights from Car Drive-Bys](https://docs.eyepop.ai/platform/temporal-context/example-car-make-and-model.md) for a schema in a complete application.

### Next steps

* [User defined VLM tasks](https://docs.eyepop.ai/platform/abilities/user-defined-vlm-tasks.md) — the three ways to ask, and the fields of an ability
* [Raw Output and Details](https://docs.eyepop.ai/platform/response-format/predictions/raw-and-details.md#details) — where `details` appears

Questions about building a Pop? Reach us at <help@eyepop.ai>.


---

# 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://docs.eyepop.ai/platform/abilities/user-defined-vlm-tasks/response-schema.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.
