Open Floor Protocol   ›   Protocol   ›   Schemas   ›   Dialog Event Object

Dialog Event Object

You can find the current and all previous versions of this schema also in our GitHub repository.

Full Schema

{
  "$id": "https://github.com/open-voice-interoperability/docs/tree/main/schemas/conversation-envelope/1.0.2/dialog-event-schema.json",
  "$schema": "https://openvoicenetwork.org/schema",
  "description": "A representation of a 'language event’ that is to say any information associated with a phrase, utterance or part of an utterance.",
  "type": "object",
  "required":  ["id" , "speakerUri", "span", "features" ],
  "properties": {
    "id": {
      "type": "string"
    },
    "previousId": {
      "type": "string"
    },
    "speakerUri": {
      "type": "string"
    },
    "span": { "$ref": "#/$defs/span" },
    "features": {
      "type": "object",
      "patternProperties": {
        ".*": { "$ref": "#/$defs/features" }
      }
    }
  },
  "$defs": {
    "features": {
      "type": "object",
      "required":  ["mimeType" , "tokens" ],
      "properties": {
        "encoding": {
          "type": "string",
          "description": "The text encoding of the token values"
        },
        "mimeType": {
          "type": "string",
          "description": "The mimeType of the token values"
        },
        "lang": {
          "type": "string",
          "description": "The language of the token values"
        },
        "tokenSchema": {
          "type": "string",
          "description": "A schema restricting the token values"
        },
        "tokens" : {
          "type": "array",
          "items":  { 
              "$ref": "#/$defs/token" 
          },
        "alternates": {
          "type": "array", 
          "items": {
            "type": "array",
              "items": {
                "type": "object",
                "$ref": "#/$defs/token" 
              }
            }
          }
        }
      }
    },
    "token": {
      "type": "object",
      "anyOf": [
        { "required": ["value"] },
        { "required": ["valueUrl"] }
      ],
      "properties": {
          "value": {
            "type": ["number","string","object","array","boolean"]
          },
          "valueUrl": {
            "$ref": "#/$defs/url"
          },          
          "confidence": {
            "type": "number"
          },
          "span": { "$ref": "#/$defs/span" },
          "links" : {
              "type": "array",
              "items":  { 
                "$ref": "#/$defs/jsonpath" 
              }
          }
      }
    },
    "url": {
      "type": "string",
      "description": "Any valid URL"
    },
    "jsonpath": {
      "type": "string",
      "description": "an expression in JSON Path syntax"
    },
    "span": {
      "anyOf": [
        { "required": ["startTime"] },
        { "required": ["startOffset"] }
      ],
      "properties": {
        "startTime": { 
            "$ref": "#/$defs/isoTime" 
        },
        "endTime": { 
            "$ref": "#/$defs/isoTime" 
        },
        "startOffset": {
            "$ref": "#/$defs/isoDuration" 
        },
        "endOffset": {
            "$ref": "#/$defs/isoDuration" 
        }
      }
    },
    "isoTime": {        
      "description": "A string in ISO 8601 absolute format."
    },
    "isoDuration": {        
      "description": "A string in ISO 8601 duration format."
    }
  }
}

Usage Examples

Audio and Text

{
    "id": "user-utterance-30",
    "speakerUri": "tag:userproxy.com,2025:aexb0067",
    "previousId": "user-utterance-28",
    "span": {
      "startTime": "2022-12-20 15:59:01.246500+00:00",
      "endOffset": "PT0.1045"
    },

    "features": {
      "my-audio-feature": {
        "mimeType": "audio/wav",
        "tokens": [
          {
            "valueUrl": "http://localhost/xyz1234.wav"
          }            
        ]
      },


      "my-text-token-feature": {
        "mimeType": "text/plain",
        "lang": "en",
        "encoding": "UTF-8",
        "tokenSchema": "",
        "tokens": [
          {"value": "what"},
          {"value": "is"},
          {"value": "the"},
          {"value": "weather"},
          {"value": "forecast"},
          {"value": "for"},
          {"value": "tomorrow"}
        ],
        "span": {
          "startTime": "PT0.0210",
          "endOffset": "PT0.1045"
        }
      }
    }
  }
{
    "id": "user-utterance-30",
    "speakerUri": "tag:userproxy.com,2025:aexb0067",
    "previousId": "user-utterance-28",
    "span": {
        "startTime": "2022-12-20 15:59:01.246500+00:00",
        "endOffset": "PT0.1045"
    },


    "features": {


      "my-text-feature": {
        "mimeType": "text/plain",
        "lang": "en",
        "encoding": "UTF-8",
        "tokens": [
          {
            "value": "what is the weather forecast for tomorrow",
            "confidence": 0.99
          }  
        ]
      },

      "my-semantic-feature": {
        "mimeType": "text/x.my-semantic-mimeType",
        "tokens": [
          {
            "value": {
              "name": "intent",
              "label": "WeatherForecast"
            },
            "links": ["$.my-text-feature.tokens[0].value"],
            "confidence": 1.0
          },
          {
            "value": {
              "name": "date",
              "label": "02-14-2023"
            },
            "links": [ "$.my-text-feature.tokens[0].value.substring(34,41)" ],
            "confidence": 0.87
          }
        ]
      }
    }
  }