# network.sharedcomputer.chat.defs

> Published by [sharedcomputer.network](https://lexicon.garden/identity/did:plc:n4mzxx6z4ehnswc7znswtfr2)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:n4mzxx6z4ehnswc7znswtfr2/network.sharedcomputer.chat.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:n4mzxx6z4ehnswc7znswtfr2/network.sharedcomputer.chat.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:n4mzxx6z4ehnswc7znswtfr2/network.sharedcomputer.chat.defs/examples)

## Definitions

### `network.sharedcomputer.chat.defs#effort`

**Type**: `string`

The model's reasoning effort.

**Known Values**:
- `none`
- `low`
- `medium`
- `high`
- `max`

### `network.sharedcomputer.chat.defs#encryptedContent`

**Type**: `object`

A sealed plainContent, or the sealed fields of the enclosing record. All user content is sealed, metadata stays in the clear.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `blobs` | `array` | No | Encrypted blobs referenced inside the ciphertext, listed so the PDS keeps them. |
| `ciphertext` | `bytes` | Yes |  |
| `keyId` | `string` | Yes |  |
| `nonce` | `bytes` | Yes |  |
| `scheme` | `string` | Yes |  |

### `network.sharedcomputer.chat.defs#extractedText`

**Type**: `object`

Cache for text pulled from a file.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `method` | `string` | Yes |  |
| `text` | `blob` | Yes |  |

### `network.sharedcomputer.chat.defs#filePart`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `extracted` | `ref` → `#extractedText` | No |  |
| `file` | `blob` | Yes |  |
| `name` | `string` | No |  |

### `network.sharedcomputer.chat.defs#generationRequest`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `attempt` | `integer` | No | The reply is written as '{messageKey}.r{attempt}'. Increase by 1 to ask for a regeneration. |
| `effort` | `ref` → `#effort` | No |  |
| `model` | `ref` → `#modelRef` | No | Model used in generating the response. If empty falls back to previous response model, then the user's default. |
| `tools` | `array` | No | Ids for the tools the assistant may use for this turn. |

### `network.sharedcomputer.chat.defs#imagePart`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `alt` | `string` | No |  |
| `image` | `blob` | Yes |  |

### `network.sharedcomputer.chat.defs#modelRef`

**Type**: `object`

The model being used. API keys are stored in the app database.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes |  |
| `provider` | `string` | Yes |  |

### `network.sharedcomputer.chat.defs#plainContent`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `parts` | `array` | Yes |  |

### `network.sharedcomputer.chat.defs#providerData`

**Type**: `string`

JSON-encoded provider options for this part, such as reasoning signatures. Sent back unchanged when continuing with the same provider.

**Constraints**: maxLength: 100000

### `network.sharedcomputer.chat.defs#reasoningPart`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `providerData` | `ref` → `#providerData` | No |  |
| `text` | `string` | No |  |

### `network.sharedcomputer.chat.defs#sourcePart`

**Type**: `object`

URL source cited by the assistant.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `title` | `string` | No |  |
| `url` | `string` (uri) | Yes |  |

### `network.sharedcomputer.chat.defs#textPart`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `providerData` | `ref` → `#providerData` | No |  |
| `text` | `string` | Yes |  |

### `network.sharedcomputer.chat.defs#toolCallPart`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `callId` | `string` | Yes |  |
| `input` | `string` | Yes | JSON-encoded arguments. |
| `providerData` | `ref` → `#providerData` | No |  |
| `tool` | `string` | Yes |  |

### `network.sharedcomputer.chat.defs#toolResultPart`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `callId` | `string` | Yes |  |
| `isError` | `boolean` | No |  |
| `output` | `string` | Yes | Tool output as text or JSON-encoded data. |
| `outputBlob` | `blob` | No | Used when the output is too long for the output record. Output will contain a summary in that case. |

### `network.sharedcomputer.chat.defs#usage`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `inputTokens` | `integer` | No |  |
| `outputTokens` | `integer` | No |  |
| `reasoningTokens` | `integer` | No |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "effort": {
      "description": "The model's reasoning effort.",
      "knownValues": [
        "none",
        "low",
        "medium",
        "high",
        "max"
      ],
      "type": "string"
    },
    "encryptedContent": {
      "description": "A sealed plainContent, or the sealed fields of the enclosing record. All user content is sealed, metadata stays in the clear.",
      "properties": {
        "blobs": {
          "description": "Encrypted blobs referenced inside the ciphertext, listed so the PDS keeps them.",
          "items": {
            "type": "blob"
          },
          "maxLength": 100,
          "type": "array"
        },
        "ciphertext": {
          "maxLength": 1000000,
          "type": "bytes"
        },
        "keyId": {
          "maxLength": 128,
          "type": "string"
        },
        "nonce": {
          "maxLength": 64,
          "type": "bytes"
        },
        "scheme": {
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "scheme",
        "keyId",
        "nonce",
        "ciphertext"
      ],
      "type": "object"
    },
    "extractedText": {
      "description": "Cache for text pulled from a file.",
      "properties": {
        "method": {
          "knownValues": [
            "text",
            "ocr"
          ],
          "type": "string"
        },
        "text": {
          "accept": [
            "text/plain"
          ],
          "maxSize": 20000000,
          "type": "blob"
        }
      },
      "required": [
        "text",
        "method"
      ],
      "type": "object"
    },
    "filePart": {
      "properties": {
        "extracted": {
          "ref": "#extractedText",
          "type": "ref"
        },
        "file": {
          "accept": [
            "*/*"
          ],
          "maxSize": 50000000,
          "type": "blob"
        },
        "name": {
          "maxLength": 1024,
          "type": "string"
        }
      },
      "required": [
        "file"
      ],
      "type": "object"
    },
    "generationRequest": {
      "properties": {
        "attempt": {
          "default": 0,
          "description": "The reply is written as '{messageKey}.r{attempt}'. Increase by 1 to ask for a regeneration.",
          "maximum": 1000,
          "minimum": 0,
          "type": "integer"
        },
        "effort": {
          "ref": "#effort",
          "type": "ref"
        },
        "model": {
          "description": "Model used in generating the response. If empty falls back to previous response model, then the user's default.",
          "ref": "#modelRef",
          "type": "ref"
        },
        "tools": {
          "description": "Ids for the tools the assistant may use for this turn.",
          "items": {
            "maxLength": 128,
            "type": "string"
          },
          "maxLength": 64,
          "type": "array"
        }
      },
      "type": "object"
    },
    "imagePart": {
      "properties": {
        "alt": {
          "maxGraphemes": 1000,
          "maxLength": 10000,
          "type": "string"
        },
        "image": {
          "accept": [
            "image/png",
            "image/jpeg",
            "image/webp",
            "image/gif"
          ],
          "maxSize": 20000000,
          "type": "blob"
        }
      },
      "required": [
        "image"
      ],
      "type": "object"
    },
    "modelRef": {
      "description": "The model being used. API keys are stored in the app database.",
      "properties": {
        "id": {
          "maxLength": 256,
          "type": "string"
        },
        "provider": {
          "knownValues": [
            "anthropic",
            "openai",
            "google",
            "openrouter",
            "cocore"
          ],
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "provider",
        "id"
      ],
      "type": "object"
    },
    "plainContent": {
      "properties": {
        "parts": {
          "items": {
            "refs": [
              "#textPart",
              "#reasoningPart",
              "#imagePart",
              "#filePart",
              "#toolCallPart",
              "#toolResultPart",
              "#sourcePart"
            ],
            "type": "union"
          },
          "maxLength": 1000,
          "type": "array"
        }
      },
      "required": [
        "parts"
      ],
      "type": "object"
    },
    "providerData": {
      "description": "JSON-encoded provider options for this part, such as reasoning signatures. Sent back unchanged when continuing with the same provider.",
      "maxLength": 100000,
      "type": "string"
    },
    "reasoningPart": {
      "properties": {
        "providerData": {
          "ref": "#providerData",
          "type": "ref"
        },
        "text": {
          "maxLength": 500000,
          "type": "string"
        }
      },
      "type": "object"
    },
    "sourcePart": {
      "description": "URL source cited by the assistant.",
      "properties": {
        "title": {
          "maxGraphemes": 300,
          "maxLength": 3000,
          "type": "string"
        },
        "url": {
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "url"
      ],
      "type": "object"
    },
    "textPart": {
      "properties": {
        "providerData": {
          "ref": "#providerData",
          "type": "ref"
        },
        "text": {
          "maxLength": 500000,
          "type": "string"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    },
    "toolCallPart": {
      "properties": {
        "callId": {
          "maxLength": 256,
          "type": "string"
        },
        "input": {
          "description": "JSON-encoded arguments.",
          "maxLength": 200000,
          "type": "string"
        },
        "providerData": {
          "ref": "#providerData",
          "type": "ref"
        },
        "tool": {
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "callId",
        "tool",
        "input"
      ],
      "type": "object"
    },
    "toolResultPart": {
      "properties": {
        "callId": {
          "maxLength": 256,
          "type": "string"
        },
        "isError": {
          "default": false,
          "type": "boolean"
        },
        "output": {
          "description": "Tool output as text or JSON-encoded data.",
          "maxLength": 500000,
          "type": "string"
        },
        "outputBlob": {
          "accept": [
            "*/*"
          ],
          "description": "Used when the output is too long for the output record. Output will contain a summary in that case.",
          "maxSize": 50000000,
          "type": "blob"
        }
      },
      "required": [
        "callId",
        "output"
      ],
      "type": "object"
    },
    "usage": {
      "properties": {
        "inputTokens": {
          "minimum": 0,
          "type": "integer"
        },
        "outputTokens": {
          "minimum": 0,
          "type": "integer"
        },
        "reasoningTokens": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "id": "network.sharedcomputer.chat.defs",
  "lexicon": 1
}
```
