Passa al contenuto

Models Reference

Complete reference for all models in the AI Workflow Framework.

project.project

Extended project model with AI workflow capabilities.

AI-Specific Fields

Field Type Description
ai_template_id Many2one Reference to ai.project.template
ai_state Selection 'draft', 'running', 'approval_pending', 'paused', 'done', 'failed'
ai_params Json Dictionary of workflow parameters
stage_id Many2one Current workflow stage (ai.project.stage)
ai_artifact_ids One2many Generated artifacts
ai_provider_id Many2one AI provider for this project
ai_started_at Datetime When workflow started
ai_completed_at Datetime When workflow completed

Key Methods

Python
# Start the workflow
project.action_start_workflow()

# Move to next stage
project.action_next_stage()

# Approve current stage
project.action_approve_stage()

# Request changes with feedback
project.action_request_changes(feedback="Please revise...")

# Pause workflow
project.action_pause_workflow()

# Resume workflow
project.action_resume_workflow()

# Get workflow progress (0-100)
progress = project.ai_progress

project.task

Extended task model for AI processing.

AI-Specific Fields

Field Type Description
ai_state Selection 'pending', 'queued', 'processing', 'done', 'failed'
ai_content Text Generated content for this task
ai_error Text Error message if failed
ai_attempts Integer Number of generation attempts
ai_feedback Text User feedback for regeneration
ai_approved Boolean Whether task output was approved

ai.project.template

Defines a workflow type with its stages and configuration.

Fields

Field Type Description
name Char Template display name
code Char Unique identifier code
description Text Template description
stage_ids One2many Workflow stages
default_provider_id Many2one Default AI provider
workflow_class Char Python class implementing workflow logic

ai.project.stage

Defines a single stage in a workflow.

Fields

Field Type Description
name Char Stage display name
sequence Integer Order in workflow (10, 20, 30...)
execution_mode Selection 'ai', 'manual', 'system', 'cli_loop'
ai_template_id Many2one Prompt template for AI mode
requires_approval Boolean Is this an approval gate?
auto_advance Boolean Auto-proceed when complete
is_final Boolean Is this the final stage?

ai.provider

AI service provider configuration.

Fields

Field Type Description
name Char Provider display name
provider_type Selection 'openai', 'azure_openai', 'anthropic', 'local'
api_key Char API authentication key
model Char Model identifier (e.g., 'gpt-4')
api_base Char Custom API endpoint URL
active Boolean Is provider enabled?

ai.artifact

Generated output artifact from AI processing.

Fields

Field Type Description
name Char Artifact name/title
artifact_type Selection Type of artifact (page, chapter, video, etc.)
content Text Text content
content_binary Binary Binary content (files)
project_id Many2one Parent project
task_id Many2one Source task