{"info":{"title":"Lens API","version":"1.0.0","description":"Ask questions, manage sources, and read reporting data in your Lens workspace. Authenticate with a scoped Lens API key."},"tags":[{"name":"Sources","description":"Required permission: `sources:manage`."},{"name":"Source groups","description":"Required permission: `sources:manage`."},{"name":"Reporting","description":"Required permission: `reporting:read`."}],"servers":[{"url":"https://api.lens.thoughtindustries.com"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"A scoped Lens API key with the access required by the endpoint."}}},"openapi":"3.1.1","paths":{"/v1/ask":{"post":{"operationId":"ask","description":"Required permission: `knowledge:query`.","tags":["Ask"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000,"description":"Natural-language question to answer from the scoped knowledge layer."},"sessionId":{"type":"string","format":"uuid","description":"Session ID returned by a previous response, for conversational follow-ups."}},"required":["question"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"text":{"type":"string","description":"Matched knowledge layer excerpt used to ground the answer."},"url":{"type":"string","description":"Canonical source URL when available."}},"required":["title","text"]}},"sessionId":{"type":"string","format":"uuid","description":"Pass this value on a follow-up request to preserve context."}},"required":["answer","sources","sessionId"]}}}}}}},"/v1/sources":{"get":{"operationId":"listSources","tags":["Sources"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"type":{"enum":["file_upload","web_crawl","zendesk","thought_industries","notion","gdrive","s3","youtube"],"type":"string"},"name":{"type":"string"},"config":{},"status":{"enum":["active","syncing","error","deleting"],"type":"string"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"skippedDocuments":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","companyId","type","name","status","errorMessage","lastSyncedAt","createdAt","updatedAt"]}}}}}}},"post":{"operationId":"createSource","tags":["Sources"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"type":{"const":"web_crawl"},"name":{"type":"string","minLength":1},"config":{"type":"object","properties":{"url":{"type":"string","minLength":1},"maxPages":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxDepth":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["url","maxPages","maxDepth"]}},"required":["type","name","config"]},{"type":"object","properties":{"type":{"const":"zendesk"},"name":{"type":"string","minLength":1},"config":{"type":"object","properties":{"subdomain":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"apiToken":{"type":"string","minLength":1},"enabledCategories":{"type":"array","items":{"type":"string"}},"syncCursors":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["subdomain","email","apiToken","enabledCategories"]}},"required":["type","name","config"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"type":{"enum":["file_upload","web_crawl","zendesk","thought_industries","notion","gdrive","s3","youtube"],"type":"string"},"name":{"type":"string"},"config":{},"status":{"enum":["active","syncing","error","deleting"],"type":"string"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"skippedDocuments":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","companyId","type","name","status","errorMessage","lastSyncedAt","createdAt","updatedAt"]}}}}}}},"/v1/sources/{id}":{"get":{"operationId":"getSource","tags":["Sources"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"type":{"enum":["file_upload","web_crawl","zendesk","thought_industries","notion","gdrive","s3","youtube"],"type":"string"},"name":{"type":"string"},"config":{},"status":{"enum":["active","syncing","error","deleting"],"type":"string"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"skippedDocuments":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","companyId","type","name","status","errorMessage","lastSyncedAt","createdAt","updatedAt"]}}}}}},"patch":{"operationId":"updateSource","description":"Send the source `type` and the `data` to change. `type` must match the source; omitted fields keep their current value.","tags":["Sources"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"type":{"const":"web_crawl"},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"maxPages":{"type":"integer","minimum":1,"maximum":500},"maxDepth":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false}},"required":["type","data"],"title":"Web crawl"},{"type":"object","properties":{"type":{"const":"zendesk"},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabledCategories":{"type":"array","minItems":1,"items":{"enum":["kb","community"],"type":"string"}},"apiToken":{"type":"string","minLength":1}},"additionalProperties":false}},"required":["type","data"],"title":"Zendesk"}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"type":{"enum":["file_upload","web_crawl","zendesk","thought_industries","notion","gdrive","s3","youtube"],"type":"string"},"name":{"type":"string"},"config":{},"status":{"enum":["active","syncing","error","deleting"],"type":"string"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"skippedDocuments":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","companyId","type","name","status","errorMessage","lastSyncedAt","createdAt","updatedAt"]}}}}}},"delete":{"operationId":"deleteSource","tags":["Sources"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/v1/sources/{id}/sync":{"post":{"operationId":"syncSource","description":"Starts a sync in the background.","tags":["Sources"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/v1/sources/{id}/documents":{"get":{"operationId":"listSourceDocuments","tags":["Sources"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sourceId":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["pending","processing","indexed","failed"],"type":"string"}},"required":["id","title","url","status"]}}},"required":["sourceId","documents"]}}}}}}},"/v1/sources/{id}/documents/{documentId}":{"get":{"operationId":"getSourceDocument","tags":["Sources"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"mimeType":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["pending","processing","indexed","failed"],"type":"string"}},"required":["id","title","mimeType","content","sourceUrl","status"]}}}}}}},"/v1/source-groups":{"get":{"operationId":"listSourceGroups","tags":["Source groups"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"allSources":{"type":"boolean"},"selections":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"source"},"sourceId":{"type":"string","format":"uuid"}},"required":["type","sourceId"]},{"type":"object","properties":{"type":{"const":"document"},"sourceId":{"type":"string","format":"uuid"},"documentId":{"type":"string","format":"uuid"},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","documentId","path"]},{"type":"object","properties":{"type":{"const":"folder"},"sourceId":{"type":"string","format":"uuid"},"path":{"type":"array","minItems":1,"items":{"type":"string"}}},"required":["type","sourceId","path"]}]}},"id":{"type":"string","format":"uuid"},"companyId":{"type":"string","format":"uuid"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["allSources","selections","id","companyId","name","createdAt","updatedAt"]}}}}}}},"post":{"operationId":"createSourceGroup","tags":["Source groups"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"allSources":{"type":"boolean"},"selections":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"source"},"sourceId":{"type":"string","format":"uuid"}},"required":["type","sourceId"]},{"type":"object","properties":{"type":{"const":"document"},"sourceId":{"type":"string","format":"uuid"},"documentId":{"type":"string","format":"uuid"},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","documentId","path"]},{"type":"object","properties":{"type":{"const":"folder"},"sourceId":{"type":"string","format":"uuid"},"path":{"type":"array","minItems":1,"items":{"type":"string"}}},"required":["type","sourceId","path"]}]}},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["allSources","selections","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"allSources":{"type":"boolean"},"selections":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"source"},"sourceId":{"type":"string","format":"uuid"}},"required":["type","sourceId"]},{"type":"object","properties":{"type":{"const":"document"},"sourceId":{"type":"string","format":"uuid"},"documentId":{"type":"string","format":"uuid"},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","documentId","path"]},{"type":"object","properties":{"type":{"const":"folder"},"sourceId":{"type":"string","format":"uuid"},"path":{"type":"array","minItems":1,"items":{"type":"string"}}},"required":["type","sourceId","path"]}]}},"id":{"type":"string","format":"uuid"},"companyId":{"type":"string","format":"uuid"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["allSources","selections","id","companyId","name","createdAt","updatedAt"]}}}}}}},"/v1/source-groups/{id}":{"patch":{"operationId":"updateSourceGroup","tags":["Source groups"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"allSources":{"type":"boolean"},"selections":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"source"},"sourceId":{"type":"string","format":"uuid"}},"required":["type","sourceId"]},{"type":"object","properties":{"type":{"const":"document"},"sourceId":{"type":"string","format":"uuid"},"documentId":{"type":"string","format":"uuid"},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","documentId","path"]},{"type":"object","properties":{"type":{"const":"folder"},"sourceId":{"type":"string","format":"uuid"},"path":{"type":"array","minItems":1,"items":{"type":"string"}}},"required":["type","sourceId","path"]}]}},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["allSources","selections","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"allSources":{"type":"boolean"},"selections":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"source"},"sourceId":{"type":"string","format":"uuid"}},"required":["type","sourceId"]},{"type":"object","properties":{"type":{"const":"document"},"sourceId":{"type":"string","format":"uuid"},"documentId":{"type":"string","format":"uuid"},"path":{"type":"array","items":{"type":"string"}}},"required":["type","sourceId","documentId","path"]},{"type":"object","properties":{"type":{"const":"folder"},"sourceId":{"type":"string","format":"uuid"},"path":{"type":"array","minItems":1,"items":{"type":"string"}}},"required":["type","sourceId","path"]}]}},"id":{"type":"string","format":"uuid"},"companyId":{"type":"string","format":"uuid"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["allSources","selections","id","companyId","name","createdAt","updatedAt"]}}}}}},"delete":{"operationId":"deleteSourceGroup","tags":["Source groups"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/v1/reporting":{"get":{"operationId":"listReporting","tags":["Reporting"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"allowEmptyValue":true,"allowReserved":true},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"allowEmptyValue":true,"allowReserved":true},{"name":"startDate","in":"query","schema":{"type":"string","format":"date-time"},"allowEmptyValue":true,"allowReserved":true},{"name":"endDate","in":"query","schema":{"type":"string","format":"date-time"},"allowEmptyValue":true,"allowReserved":true},{"name":"channels","in":"query","schema":{"type":"array","minItems":1,"items":{"enum":["widget","mcp","api"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"widgetIds","in":"query","schema":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"apiKeyIds","in":"query","schema":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"sortBy","in":"query","schema":{"enum":["createdAt","processingTimeMs","timeToFirstTokenMs"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDirection","in":"query","schema":{"enum":["asc","desc"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"answer":{"type":"string"},"sourceHits":{"type":"array","items":{"type":"string"}},"origin":{"anyOf":[{"type":"string"},{"type":"null"}]},"processingTimeMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"widgetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"apiKeyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"apiKeyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"anyOf":[{"enum":["widget","mcp","api"],"type":"string"},{"type":"null"}]},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"anyOf":[{"enum":["answer","summary"],"type":"string"},{"type":"null"}]},"isPreview":{"type":"boolean"},"pageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"selectedText":{"anyOf":[{"type":"string"},{"type":"null"}]},"surroundingContext":{"anyOf":[{"type":"string"},{"type":"null"}]},"sources":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"title":{"type":"string"},"headingPath":{"type":"string"},"score":{"type":"number"},"text":{"type":"string"},"contentUrl":{"type":"string"}},"required":["source","title"]}},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"output":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"ms":{"type":"number"},"error":{"type":"string"}},"required":["name"]}},"finishReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"retrievalMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"generationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"timeToFirstTokenMs":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","question","answer","sourceHits","origin","processingTimeMs","createdAt"]}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avgTimeToFirstTokenMs":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["items","total","avgTimeToFirstTokenMs"]}}}}}}},"/v1/reporting/discussions":{"get":{"operationId":"listReportingDiscussions","tags":["Reporting"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"allowEmptyValue":true,"allowReserved":true},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"allowEmptyValue":true,"allowReserved":true},{"name":"startDate","in":"query","schema":{"type":"string","format":"date-time"},"allowEmptyValue":true,"allowReserved":true},{"name":"endDate","in":"query","schema":{"type":"string","format":"date-time"},"allowEmptyValue":true,"allowReserved":true},{"name":"channels","in":"query","schema":{"type":"array","minItems":1,"items":{"enum":["widget","mcp","api"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"widgetIds","in":"query","schema":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"apiKeyIds","in":"query","schema":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"question":{"type":"string"},"mode":{"anyOf":[{"enum":["answer","summary"],"type":"string"},{"type":"null"}]},"selectedText":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"anyOf":[{"enum":["widget","mcp","api"],"type":"string"},{"type":"null"}]},"widgetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"apiKeyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"apiKeyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"origin":{"anyOf":[{"type":"string"},{"type":"null"}]},"pageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"turnCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"startedAt":{"type":"string","format":"date-time"},"lastActivityAt":{"type":"string","format":"date-time"}},"required":["id","sessionId","question","mode","selectedText","channel","widgetId","apiKeyId","apiKeyName","origin","pageUrl","turnCount","errorCount","startedAt","lastActivityAt"]}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalQueries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avgTimeToFirstTokenMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"avgSourcesPerAnswer":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["items","total","totalQueries","avgTimeToFirstTokenMs","avgSourcesPerAnswer"]}}}}}}},"/v1/reporting/discussions/{id}":{"get":{"operationId":"getReportingDiscussion","tags":["Reporting"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"turns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"answer":{"type":"string"},"sourceHits":{"type":"array","items":{"type":"string"}},"origin":{"anyOf":[{"type":"string"},{"type":"null"}]},"processingTimeMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"widgetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"apiKeyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"apiKeyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"anyOf":[{"enum":["widget","mcp","api"],"type":"string"},{"type":"null"}]},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"anyOf":[{"enum":["answer","summary"],"type":"string"},{"type":"null"}]},"isPreview":{"type":"boolean"},"pageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"selectedText":{"anyOf":[{"type":"string"},{"type":"null"}]},"surroundingContext":{"anyOf":[{"type":"string"},{"type":"null"}]},"sources":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"title":{"type":"string"},"headingPath":{"type":"string"},"score":{"type":"number"},"text":{"type":"string"},"contentUrl":{"type":"string"}},"required":["source","title"]}},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"output":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"ms":{"type":"number"},"error":{"type":"string"}},"required":["name"]}},"finishReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"retrievalMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"generationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"timeToFirstTokenMs":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","question","answer","sourceHits","origin","processingTimeMs","createdAt"]}}},"required":["turns"]}}}}}}}}}