---
name: istari-models
description: >
  Upload, revise, and read Resources on the Istari Digital Platform with SDK 13.x —
  models, artifacts, files, revisions, reading bytes back, the id family, running a
  function. Use when putting a file on the platform, "new version of the model", or
  whenever resource, file, or revision ids are handled.
metadata:
  sdk: istari-digital-client
  sdk-major: "13"
  sdk-range: ">=13.0,<14"
  skill-version: "13.0.0"
  verified-sdk: "13.0.1"
  verified-registry: "demo 11.1.0"
  verified-on: "2026-09-06"
---

# istari-models

A **Resource** has a stable `resource_id` across **revisions**. Models, artifacts, and plain files are all Resources (`resource_type`). Clients from `istari-connect`.

## Upload once, then revise

```python
r = client.resources.create(
    "/abs/path/wing.CATPart", "model",
    display_name="Wing", description="…", version_name="v001",
)
r2 = client.resources.revisions.create(
    r.resource_id, "/abs/path/wing_v2.CATPart", version_name="v002",
)
```

`resource_type` is `"model" | "artifact" | "file"` (case-insensitive). Use `"model"` for anything someone will open from a System tree. A second `create()` of the same file mints a **duplicate** Resource with no shared history; links built from it show nothing selected (`istari-links`).

Metadata strings (`description`, and typically `display_name` / `external_identifier`) cap at **255 characters**. Over-length returns a fast 500 — do not retry; guard with `len(s) <= 255`.

## The id family

| Id                   | Get it from                            | Use it for                                           |
| -------------------- | -------------------------------------- | ---------------------------------------------------- |
| **resource id**      | `r.resource_id`, `tracked.resource_id` | get, revisions, jobs, deep links (`m~<id>`)          |
| **file id**          | `r.file_id`, `tracked.file_id`         | `NewTrackedFile(file_id=…)` in folder commits        |
| **file-revision id** | `rev.id`, `r.file_revision_id`         | `revisions.get`, `branch.commit(add=[rev])`, `?rev=` |

`resources.get(file_id)` may resolve a file id to the Resource. A nonexistent id often raises permission denied rather than not-found.

## Reading back

```python
r = client.resources.get(RID)
r.read_text()  # latest; also .read_bytes(), .read_json()
revs = client.resources.revisions.list(RID).items  # newest first
```

## Running a function

```python
f = integrations.functions.list(input_extension="stl", size=50).items[0]
job = client.jobs.create(
    resource_id=RID,
    function=f.name,
    tool_name=f.tool_name,
    tool_version=f.tool_versions[0].tool_version,
    operating_system=f.operating_systems[0].name,
    parameters={},
)
final = job.poll(timeout=600)  # "Completed" | "Failed" | "Canceled"
```

Discover functions; do not hardcode a name the account cannot execute. If the task is only to _submit_ a job, report the status and stop — do not hunt for a function that goes green unless the person asked.

| Signal                                   | Meaning                                                            |
| ---------------------------------------- | ------------------------------------------------------------------ |
| Instant `InternalServerError` on create  | metadata string over 255 characters                                |
| Permission denied on an id you just made | wrong id family                                                    |
| Nothing selected in the tree             | duplicate Resource, `"file"` type, or not tracked (`istari-links`) |
