AiFile ai.file@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- ai
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/ai/file.v1.json
ai.file@1: a person attachment or model-produced artifact stored by Media. The reference is metadata only; file bytes are never embedded in an AI turn.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes |
| |
name | string | yes |
| |
media_type | string | yes |
| |
size | integer | yes |
| |
storage | object | yes |
| |
storage.provider | const | yes |
| |
storage.key | string | yes |
| |
access | object | yes |
| |
access.readers | array of string | yes |
| |
read | one of | yes | ||
role | enum |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: text-attachment
{
"id": "med_file_01",
"name": "notes.txt",
"media_type": "text/plain",
"size": 12,
"storage": {
"provider": "media",
"key": "files/usr_01/med_file_01"
},
"access": {
"readers": [
"usr_01"
]
},
"read": {
"method": "text",
"content": "hello world"
},
"role": "input"
}Rejected: inline-data
{
"id": "med_file_01",
"name": "notes.txt",
"media_type": "text/plain",
"size": 12,
"storage": {
"provider": "media",
"key": "files/usr_01/med_file_01"
},
"access": {
"readers": [
"usr_01"
]
},
"read": {
"method": "text"
},
"bytes": "not allowed"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('ai.file@1', value); // { valid, errors: [{ path, message }] }