{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "FileVector.schema.json", "title": "FileVector", "description": "One source's embeddings of a file's content (`FileVector/get`), id `/`. Read by every reader of the file; a content change lapses them.", "type": "object", "properties": { "id": { "$ref": "Common.schema.json#/$defs/Id" }, "nodeId": { "$ref": "Common.schema.json#/$defs/Id" }, "source": { "$ref": "Common.schema.json#/$defs/SourceId" }, "blobId": { "description": "The file's content.", "$ref": "Common.schema.json#/$defs/Id" }, "updated": { "description": "Their latest write.", "$ref": "Common.schema.json#/$defs/UTCDate" }, "vectors": { "type": "array", "minItems": 1, "maxItems": 4, "items": { "$ref": "#/$defs/Entry" } } }, "required": ["id", "nodeId", "source", "blobId", "updated", "vectors"], "additionalProperties": false, "$defs": { "Entry": { "type": "object", "properties": { "model": { "type": "string", "description": "The model and its version, 1–100 characters.", "minLength": 1, "maxLength": 100, "pattern": "\\S" }, "kind": { "anyOf": [ { "enum": ["image", "text"], "description": "What was embedded." }, { "type": "null" } ] }, "vector": { "type": "string", "allOf": [ { "$ref": "Common.schema.json#/$defs/Vector" } ], "minLength": 342, "maxLength": 10924, "description": "64–2048 dimensions: the decoded bytes are a multiple of 4, and their number divided by 4 is between 64 and 2048. The length bounds are those of base64 of 256 to 8192 bytes." } }, "required": ["model", "kind", "vector"], "additionalProperties": false }, "Update": { "type": "object", "properties": { "blobId": { "description": "The file's content as this credential read it, else `contentChanged`.", "$ref": "Common.schema.json#/$defs/Id" }, "vectors": { "type": "array", "maxItems": 4, "items": { "type": "object", "properties": { "model": { "type": "string", "description": "The model and its version, 1–100 characters.", "minLength": 1, "maxLength": 100, "pattern": "\\S" }, "kind": { "enum": ["image", "text"], "description": "What was embedded." }, "vector": { "type": "string", "allOf": [ { "$ref": "Common.schema.json#/$defs/Vector" } ], "minLength": 342, "maxLength": 10924, "description": "64–2048 dimensions: the decoded bytes are a multiple of 4, and their number divided by 4 is between 64 and 2048. The length bounds are those of base64 of 256 to 8192 bytes." } }, "required": ["model", "kind", "vector"], "additionalProperties": false }, "description": "At most 4, replacing the caller's own vectors of the node." } }, "required": ["blobId", "vectors"], "additionalProperties": false, "description": "An update of `FileVector/set`, keyed by the node id." } } }