{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/speakeroo-app/json-schema/speakeroo-app-analyze-transcript-response-schema.json",
  "title": "AnalyzeTranscriptResponse",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/speakeroo-app-openapi.json#/components/schemas/AnalyzeTranscriptResponse",
  "type": "object",
  "properties": {
    "callToAction": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "required": [
        "text",
        "url"
      ],
      "additionalProperties": false
    },
    "coaching": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "deliveryMoments": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "excerpt": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "sentiment": {
                    "type": "string",
                    "enum": [
                      "strength",
                      "improvement"
                    ]
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "emphasis",
                      "effective_pause",
                      "missed_pause",
                      "rush",
                      "slow_deliberate",
                      "flat_spot",
                      "vocal_contrast",
                      "energy_build",
                      "warmth",
                      "tension"
                    ]
                  }
                },
                "required": [
                  "description",
                  "excerpt",
                  "label",
                  "sentiment",
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "feedback": {
              "type": "object",
              "properties": {
                "delivery": {
                  "type": "string"
                },
                "rhetoric": {
                  "type": "string"
                },
                "weakWords": {
                  "type": "string"
                }
              },
              "required": [
                "delivery",
                "rhetoric",
                "weakWords"
              ],
              "additionalProperties": false
            },
            "rhetoricalDevices": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "device": {
                    "type": "string",
                    "enum": [
                      "rhetorical_question",
                      "anaphora",
                      "epistrophe",
                      "epizeuxis",
                      "triad",
                      "antithesis",
                      "climax",
                      "metaphor",
                      "simile",
                      "hyperbole",
                      "personification",
                      "alliteration"
                    ]
                  },
                  "effect": {
                    "type": "string"
                  },
                  "excerpt": {
                    "type": "string"
                  }
                },
                "required": [
                  "device",
                  "effect",
                  "excerpt"
                ],
                "additionalProperties": false
              }
            },
            "weakWords": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string",
                    "enum": [
                      "hedging",
                      "minimizer",
                      "permission_seeking",
                      "apologetic",
                      "excessive_qualifier"
                    ]
                  },
                  "count": {
                    "type": "number",
                    "description": "How many times it was said"
                  },
                  "suggestion": {
                    "type": "string",
                    "description": "A firmer way to say it; empty means drop the word"
                  },
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "category",
                  "count",
                  "suggestion",
                  "text"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "deliveryMoments",
            "feedback",
            "rhetoricalDevices",
            "weakWords"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Weak and filler words, rhetorical devices and delivery/rhetoric feedback"
    },
    "context": {
      "type": "string"
    },
    "issues": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "excerpt": {
                "type": "string"
              },
              "explanation": {
                "type": "string"
              },
              "fix": {
                "type": "string",
                "description": "The corrected wording; empty when the fix is to drop it"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "excerpt",
              "explanation",
              "fix",
              "type"
            ],
            "additionalProperties": false
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Word-level grammar, vocabulary and filler issues with the excerpt and a fix"
    },
    "language": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "areas": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "area": {
                    "type": "string",
                    "enum": [
                      "pacing",
                      "coherence",
                      "vocabulary",
                      "grammar",
                      "pronunciation",
                      "engagement",
                      "accuracy"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "recommendation": {
                    "type": "string"
                  },
                  "score": {
                    "type": "number",
                    "description": "1-10"
                  },
                  "strands": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "evidence": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "score": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "evidence",
                        "name",
                        "score"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "area",
                  "description",
                  "examples",
                  "recommendation",
                  "score",
                  "strands"
                ],
                "additionalProperties": false
              }
            },
            "summary": {
              "type": "object",
              "properties": {
                "improvements": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "strengths": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "improvements",
                "strengths"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "areas",
            "summary"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Grammar, vocabulary and coherence scores on the Speakeroo rubric"
    },
    "unavailable": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Parts that could not be produced this time; the rest of the result stands"
    },
    "wordCount": {
      "type": "number"
    }
  },
  "required": [
    "callToAction",
    "coaching",
    "issues",
    "language",
    "unavailable",
    "wordCount"
  ],
  "additionalProperties": false
}