Continue only with the selected mode and use its exact parameter shape:
Python SDK mode
options supports sources. Each source may be a local file or directory path, a
remote URL, a Resource URI, or an advanced source dictionary. The SDK uploads local
paths automatically.
task = client.rule_compile(
instruction="Compile the supplied policy into durable Rules.",
options={
"sources": [
"/local/path/policy.md",
"https://example.org/policy.md",
"viking://resources/team-policy",
]
},
)
task_id = task["task_id"]
Poll with client.get_task(task_id) and read saved content with
client.read_raw(uri).
HTTP mode
HTTP has no options wrapper. Put instruction and sources directly in the JSON
body. Use resource_uri for an existing Resource, path for a remote text source,
or temp_file_id returned by POST /api/v1/resources/temp_upload for local content.
{
"instruction": "Compile the supplied policy into durable Rules.",
"sources": [
{"resource_uri": "viking://resources/team-policy"},
{"path": "https://example.org/policy.md"},
{"temp_file_id": "tmp_xxx", "source_name": "policy.md"}
]
}
Submit this body to POST /api/v1/rules/compile. Never send a client-local path to
that endpoint. Poll GET /api/v1/tasks/{task_id} and read saved content through
GET /api/v1/content/read?uri=...&raw=true.
Save the returned task_id; acceptance does not mean compilation has completed.