|
<< Click to Display Table of Contents >> Navigation: »No topics above this level« IOA / NOA - AI Condition Framework |
The IOA (If OpenAI) and NOA (Not OpenAI) commands provide a comprehensive AI condition framework for checking states in AI operations, MemoryTools, MCP-Server, and task management.
IOA.Subcommand|Parameters
NOA.Subcommand|Parameters
IOA.|$$VAR
IOA.|$$VAR|$$SEARCH
IOA evaluates a condition related to AI operations, memory state, MCP tools, or job status. If the condition is true, the next command is executed. If false, execution skips to the matching JNO (Jump if Not) label.
NOA is the inverse - it executes the next command if the condition is FALSE.
Check the state of MemoryTools storage.
•IOA.MEM.Exists|$$KEY - Returns true if memory key exists
•IOA.MEM.Contains|$$KEY|$$SEARCH - True if memory value contains search string
•IOA.MEM.Empty|$$KEY - True if memory key exists but is empty
•IOA.MEM.Size|$$KEY|>1000 - Compare memory value size (supports >, <, >=, <=, =)
Check properties of AI responses.
•IOA.AI.HasToolCall - True if AI response includes tool calls
•IOA.AI.HasFunction|FunctionName - True if specific function was called
•IOA.AI.ContentContains|$$SEARCH - True if response content contains text
•IOA.AI.FinishReason|stop - True if finish reason matches (stop/length/content_filter)
Check MCP-Server tool and feature states.
•IOA.MCP.ToolExists|ToolName - True if MCP tool is registered
•IOA.MCP.ToolEnabled|ToolName - True if MCP tool is enabled
•IOA.MCP.HasResult|$$JOBID - True if async job has completed result
•IOA.MCP.QueueEmpty - True if MCP command queue is empty
•IOA.MCP.FeatureOn|FeatureName - True if MCP feature is enabled
Check status of asynchronous jobs and tasks.
•IOA.JOB.Exists|$$JOBID - True if job exists
•IOA.JOB.Completed|$$JOBID - True if job completed successfully
•IOA.JOB.Failed|$$JOBID - True if job failed
•IOA.JOB.Running|$$JOBID - True if job is still running
Subcommand: The condition to check (e.g., MEM.Exists, AI.HasToolCall)
Parameters: Varies by subcommand:
•$$KEY - Memory key name (for MEM. conditions)
•$$SEARCH - String to search for
•ToolName - MCP tool name (e.g., MemoryTools::Store)
•$$JOBID - Job/task identifier
•FeatureName - MCP feature name (e.g., MemoryTools)
The condition result is returned via the internal IX register. Use with JNO (Jump if Not) to branch based on the condition.
' Check if last_result exists in memory
IOA.MEM.Exists|last_result
JNO.NoResult
' Process existing result...
MEM.RCL|last_result|$$VALUE
:NoResult
' Check if AI wants to call a tool
IOA.AI.HasToolCall
JNO.NoTool
' Process tool call...
AIG.DoToolCall
GT.End
:NoTool
' Handle direct response...
:End
' Only run if MemoryTools enabled
IOA.MCP.ToolEnabled|MemoryTools::Store
JNO.SkipStore
MCP.Exec|MemoryTools::Store|myKey|myValue
:SkipStore
' Check if background job completed
IOA.JOB.Completed|$$JOBID
JNO.NotReady
MCP.CheckResult|$$JOBID|$$RESULT
:NotReady
' Job still running, do other work...
' Only process if last response doesn't contain "error"
NOA.MEM.Contains|last_response|error
JNO.HasError
' Process successful response...
GT.End
:HasError
' Handle error...
:End
' Original IOA behavior - check if variable contains string
IOA.|$$AIResponse|error
JNO.NoError
' Handle error case...
:NoError
Most subcommands support short aliases for faster typing:
MEM. aliases:
•Exists → Ex, E
•Contains → Co, C
•Empty → Em
•Size → Sz, S
AI. aliases:
•HasToolCall → Htc, Ht
•HasFunction → Hf, Hasfunc
•ContentContains → Cc, Contains
•FinishReason → Fr, Finish
MCP. aliases:
•ToolExists → Te, ToolsExist
•ToolEnabled → Ten, ToolEn
•HasResult → Hr, Result
•QueueEmpty → Qe, QEmpty
•FeatureOn → Fo, Feature
JOB. aliases:
•Exists → Ex, E
•Completed → Co, Complete, Done
•Failed → Fa, Fail, Error
•Running → Ru, Run, Active
•JNO - Jump if Not (conditional branch)
•MCP.Memory - MemoryTools operations
•AIG - Google Gemini AI commands
•AIC - OpenAI commands
•MCP - MCP-Server commands
•IEF - If Exists File
•IER - If Exists Directory
•MEM - Memory commands overview