AI Processors
AI processors define the prompts that NetOrca uses to automate service operations. Each processor is linked to a service, an LLM model, and an action type — together they determine when the processor runs and what it does.
Processors use the /external/{context}/ai_processors/ endpoint.
Accessed via client.ai_processors.
Action types
action_type |
When it runs |
|---|---|
config |
Generates service configuration from a consumer's declaration |
verify |
Verifies a generated configuration before it is applied |
execution |
Executes an action on a deployed service item |
change_instance_validator |
Validates a change instance before it is applied |
optimiser |
Optimises a service configuration |
Model properties
| Property | Type | Description |
|---|---|---|
id |
int |
Processor ID |
name |
str |
Processor name |
action_type |
str |
One of the action types above |
prompt |
str |
The LLM prompt text |
service_id |
int |
Associated service ID |
llm_model_id |
int |
Associated LLM model ID |
active |
bool |
Whether the processor is active |
response_schema |
dict |
JSON Schema for structured LLM output |
is_validator |
bool |
True if action_type == "change_instance_validator" |
created |
datetime |
Creation timestamp |
modified |
datetime |
Last modified timestamp |
extra_data properties
These are accessed directly on the model and reflect the extra_data settings object returned by the API.
| Property | Type | Default | Description |
|---|---|---|---|
extra_data |
dict |
{} |
Raw extra_data dict |
include_change_instance |
bool |
False |
Include the last change instance in the payload |
enable_pack_context |
bool |
False |
Enable vector document (pack_context) in the payload |
include_previous_declaration |
bool |
False |
Include the previous declaration for the service item |
include_previous_pipeline_data |
list |
[] |
Action types to include from previous pipeline in retrigger mode (config, verify, execution) |
include_service_config |
bool |
False |
Include the latest service config JSON in the payload |
enable_generative_ui |
bool |
False |
Enable generative UI catalog for this processor |
generative_ui_schema |
dict |
None |
Per-processor generative UI schema |
schedule_enabled |
bool |
False |
Whether scheduled execution is enabled |
schedule_crontab |
str |
None |
Cron expression for scheduled execution (5-part format, e.g. '0 */6 * * *') |
allow_auto_approval |
bool |
False |
Allow automatic approval of change instances |
allow_auto_rejection |
bool |
False |
Allow automatic rejection of change instances |
send_service_info |
bool |
False |
Include service info in the payload |
send_existing_service_items |
bool |
False |
Include existing service items in the payload |
Methods
list(**filters)
Returns a lazy generator of all AI processors. Pagination is handled automatically.
Filters:
| Filter | Type | Description |
|---|---|---|
service_id |
int |
Filter by service |
llm_model_id |
int |
Filter by LLM model |
action_type |
str |
Filter by action type |
active |
bool |
Filter by active status |
ordering |
str |
Sort field — prefix with - for descending |
# All processors
for processor in client.ai_processors.list():
print(processor.name, processor.action_type, processor.active)
# Config processors only
for processor in client.ai_processors.list(action_type="config"):
print(processor.name, processor.service_id)
# Active processors for a service
for processor in client.ai_processors.list(service_id=45, active=True):
print(processor.name)
filter(**filters)
Same as list() but returns all results as a list. Accepts the same filters.
# All execution processors
processors = client.ai_processors.filter(action_type="execution")
print(f"{len(processors)} execution processors")
# Active config processors for a service
processors = client.ai_processors.filter(service_id=45, action_type="config", active=True)
get(id)
Retrieves a single processor by ID.
processor = client.ai_processors.get(1)
print(processor.id)
print(processor.name)
print(processor.action_type)
print(processor.prompt)
print(processor.active)
print(processor.service_id)
print(processor.created)
print(processor.modified)
create(data)
Creates a new AI processor and links it to a service. The processor is inactive by default unless you pass "active": True.
| Field | Type | Required | Description |
|---|---|---|---|
name |
str |
yes | Unique processor name |
service |
int |
yes | Service ID to link to |
llm_model |
int |
yes | LLM model ID to use |
action_type |
str |
yes | Action type (see table above) |
prompt |
str |
yes | The prompt text |
response_schema |
dict |
no | JSON Schema for structured LLM output |
extra_data |
dict |
no | Extra settings (see extra_data properties table) |
active |
bool |
no | Enable immediately (default: False) |
# Config processor
processor = client.ai_processors.create({
"name": "database-service_config",
"service": 45,
"llm_model": 1,
"action_type": "config",
"prompt": "Given the following consumer request, generate a valid database configuration...",
"active": True
})
print(processor.id)
# Change instance validator
processor = client.ai_processors.create({
"name": "database-service_validator",
"service": 45,
"llm_model": 1,
"action_type": "change_instance_validator",
"prompt": "Validate whether the proposed change is safe to apply...",
"extra_data": {
"include_change_instance": True,
"include_previous_declaration": True,
"allow_auto_approval": True,
"allow_auto_rejection": False
},
"active": True
})
print(processor.is_validator) # True
# Processor with a structured response schema
processor = client.ai_processors.create({
"name": "database-service_config",
"service": 45,
"llm_model": 1,
"action_type": "config",
"prompt": "Generate a database configuration from the consumer request.",
"response_schema": {
"type": "object",
"properties": {
"host": {"type": "string"},
"port": {"type": "integer"},
"database": {"type": "string"}
},
"required": ["host", "port", "database"]
},
"active": True
})
update(id, data, partial=True)
Updates a processor. Every update creates a history entry (see get_history()). Defaults to PATCH.
| Parameter | Type | Description |
|---|---|---|
id |
int |
Processor ID |
data |
dict |
Fields to update |
partial |
bool |
True (default) = PATCH, False = PUT |
# Update the prompt text
client.ai_processors.update(1, {
"prompt": "Updated prompt with improved instructions..."
})
# Deactivate a processor
client.ai_processors.update(1, {"active": False})
# Reactivate it
client.ai_processors.update(1, {"active": True})
delete(id)
Permanently deletes a processor.
get_history(processor_id)
Returns the full version history of a processor — every prompt update, activation change, and other modification. Useful for auditing what prompt was active at any point in time.
| Parameter | Type | Description |
|---|---|---|
processor_id |
int |
Processor ID |
History entry change types: + (added), ~ (modified), - (removed).
by_service(service_id)
Returns all processors linked to a specific service as a list. Shortcut for filter(service_id=service_id).
processors = client.ai_processors.by_service(service_id=45)
for p in processors:
print(p.name, p.action_type)
get_active()
Returns all processors where active=True as a list. Shortcut for filter(active=True).