Skip to content

JSON Output Example

Prompty can return responses in JSON format.

Refer to the basic_json_output.prompty file for more examples.

YAML
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
---
name: JSON Output Example
description: A prompt that returns responses in JSON format
authors:
  - example_author
model:
  api: chat
  configuration:
    azure_deployment: gpt-35-turbo
sample:
  question: What is the weather like today?
---
system:
You are a helpful assistant.
Return the response in JSON format.
user:
{{question}}