Files
go-sip/contracts/schema/http-task-detail.schema.json
T

458 lines
9.7 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://go-sip.local/contracts/schema/http-task-detail.schema.json",
"title": "GET /internal/v1/dispatcher/task/:task_id response; external SaaS compatibility unverified",
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"resource",
"dispatcher_id",
"tenant_id",
"task_id",
"task_revision",
"status",
"max_concurrent_calls",
"ring_timeout_ms",
"max_call_duration_ms",
"route_policy_id",
"allowed_trunk_ids",
"schedule",
"agent"
],
"properties": {
"resource": {
"const": "task_config"
},
"dispatcher_id": {
"$ref": "./common.schema.json#/$defs/dispatcher_id"
},
"tenant_id": {
"$ref": "./common.schema.json#/$defs/tenant_id"
},
"task_id": {
"$ref": "./common.schema.json#/$defs/task_id"
},
"task_revision": {
"type": "integer",
"minimum": 1
},
"status": {
"$ref": "./common.schema.json#/$defs/task_status"
},
"name": {
"type": "string",
"minLength": 1
},
"max_concurrent_calls": {
"type": "integer",
"minimum": 1
},
"ring_timeout_ms": {
"type": "integer",
"minimum": 1
},
"max_call_duration_ms": {
"type": "integer",
"minimum": 1
},
"route_policy_id": {
"type": "string",
"minLength": 1
},
"allowed_trunk_ids": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"minLength": 1
}
},
"schedule": {
"$ref": "#/$defs/task_schedule"
},
"agent": {
"$ref": "#/$defs/agent"
}
}
},
{
"$ref": "./common.schema.json#/$defs/error"
}
],
"$defs": {
"task_schedule": {
"type": "object",
"additionalProperties": false,
"required": [
"time_zone",
"starts_at",
"ends_at",
"weekly_windows",
"excluded_dates"
],
"properties": {
"time_zone": {
"const": "Asia/Shanghai"
},
"starts_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"ends_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"weekly_windows": {
"$ref": "./common.schema.json#/$defs/weekly_windows"
},
"excluded_dates": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"format": "date"
}
}
}
},
"agent": {
"type": "object",
"additionalProperties": false,
"required": [
"immutable",
"mode",
"asr"
],
"properties": {
"immutable": {
"const": true
},
"mode": {
"enum": [
"asr_only",
"full_ai"
]
},
"asr": {
"$ref": "#/$defs/asr"
},
"llm": {
"$ref": "#/$defs/llm"
},
"tts": {
"$ref": "#/$defs/tts"
},
"prompt": {
"$ref": "#/$defs/prompt"
},
"conversation": {
"$ref": "#/$defs/conversation"
}
},
"allOf": [
{
"if": {
"properties": {
"mode": {
"const": "full_ai"
}
}
},
"then": {
"required": [
"llm",
"tts",
"prompt",
"conversation"
]
}
},
{
"if": {
"properties": {
"mode": {
"const": "asr_only"
}
}
},
"then": {
"not": {
"anyOf": [
{
"required": [
"llm"
]
},
{
"required": [
"tts"
]
},
{
"required": [
"prompt"
]
}
]
}
}
}
]
},
"asr": {
"type": "object",
"additionalProperties": false,
"required": [
"provider_id",
"language",
"input"
],
"properties": {
"provider_id": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"minLength": 1
},
"language": {
"type": "string",
"minLength": 1
},
"interim": {
"type": "boolean"
},
"timeout_ms": {
"type": "integer",
"minimum": 1
},
"input": {
"$ref": "#/$defs/audio_input"
}
}
},
"audio_input": {
"type": "object",
"additionalProperties": false,
"required": [
"encoding",
"sample_rate_hz",
"channels",
"sample_width_bytes"
],
"properties": {
"encoding": {
"const": "pcm_s16le"
},
"sample_rate_hz": {
"type": "integer",
"minimum": 8000
},
"channels": {
"const": 1
},
"sample_width_bytes": {
"const": 2
}
}
},
"llm": {
"type": "object",
"additionalProperties": false,
"required": [
"provider_id",
"model"
],
"properties": {
"provider_id": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"minLength": 1
},
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"max_tokens": {
"type": "integer",
"minimum": 1
},
"timeout_ms": {
"type": "integer",
"minimum": 1
}
}
},
"tts": {
"type": "object",
"additionalProperties": false,
"required": [
"provider_id",
"model",
"voice",
"language_type",
"format"
],
"properties": {
"provider_id": {
"type": "string",
"minLength": 1
},
"model": {
"type": "string",
"minLength": 1
},
"voice": {
"type": "string",
"minLength": 1
},
"language_type": {
"type": "string",
"minLength": 1
},
"speed": {
"type": "number",
"minimum": 0.25,
"maximum": 3
},
"timeout_ms": {
"type": "integer",
"minimum": 1
},
"format": {
"type": "object",
"additionalProperties": false,
"required": [
"encoding",
"sample_rate_hz",
"channels"
],
"properties": {
"encoding": {
"enum": [
"pcm_s16le",
"pcma"
]
},
"sample_rate_hz": {
"type": "integer",
"minimum": 8000
},
"channels": {
"const": 1
}
}
}
}
},
"prompt": {
"type": "object",
"additionalProperties": false,
"required": [
"text",
"allowed_variables"
],
"properties": {
"text": {
"type": "string",
"minLength": 1
},
"allowed_variables": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"minLength": 1
}
},
"max_bytes": {
"type": "integer",
"minimum": 1
}
}
},
"hangup_keyword": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"triggers",
"closingRemark"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"triggers": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
}
},
"closingRemark": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
}
}
},
"conversation": {
"type": "object",
"additionalProperties": false,
"properties": {
"opening": {
"type": "string"
},
"hangup_keywords": {
"type": "array",
"items": {
"$ref": "#/$defs/hangup_keyword"
}
},
"allow_interrupt": {
"type": "boolean"
},
"silence_timeout_ms": {
"type": "integer",
"minimum": 1
},
"max_duration_ms": {
"type": "integer",
"minimum": 1
},
"max_turns": {
"type": "integer",
"minimum": 1
},
"sentence_max_chars": {
"type": "integer",
"minimum": 1
},
"max_pending_audio_chunks": {
"type": "integer",
"minimum": 1
}
}
}
}
}