Skip to content

VS Code: respect and format structured JSON outputs #370

@sethjuarez

Description

@sethjuarez

Summary

When running a .prompty file from the VS Code extension, structured JSON outputs should be respected and displayed/formatted as JSON.

Scenario

A prompt can declare structured outputs:

outputs:
  - name: answer
    kind: string
  - name: rememberedPreferences
    kind: array
  - name: staleContextWarning
    kind: string
  - name: nextAction
    kind: string

The model is expected to return structured JSON matching the declared output schema.

Expected behavior

The VS Code extension should:

  1. respect the declared outputs schema during execution,
  2. treat the result as JSON/structured output when the runtime returns JSON,
  3. pretty-print or otherwise format the response as JSON in the result/trace view.

Actual behavior

The extension output appears to display the result as plain text rather than respecting and formatting the JSON output shape.

Why it matters

Structured output is a core Prompty scenario. For authoring/debugging, the VS Code extension should make it obvious when a prompt produced valid JSON and should present that output in a readable, schema-oriented way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensionRelated to the Prompty VS Code Extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions