{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://hai.ai/schemas/node/v1/node.schema.json",
  "title": "Node",
  "description": "A a node in a finite state machine. Stateless, a class to be used to instantiate a node.",
  "type": "object",
  "properties": {
    "nodeID": {
      "type": "string",
      "hai": "base",
      "format": "uuid"
    },
    "programID": {
      "description": "what program it belongs to",
      "type": "string",
      "hai": "base",
      "format": "uuid"
    },
    "programVersion": {
      "description": "what program version created",
      "type": "string",
      "hai": "base",
      "format": "uuid"
    },
    "serviceID": {
      "description": "what service is being used",
      "type": "string",
      "hai": "base",
      "format": "uuid"
    },
    "serviceVersion": {
      "description": "what service version was  first used",
      "type": "string",
      "hai": "base",
      "format": "uuid"
    },
    "completed": {
      "description": "is the task completed",
      "type": "boolean",
      "hai": "base"
    },
    "completedAt": {
      "description": "datetime of completion",
      "format": "date-time",
      "hai": "agent",
      "type": "string"
    },
    "tool": {
      "description": "The chosen tool",
      "$ref": "https://hai.ai/schemas/components/tool/v1/tool.schema.json"
    },
    "preToolPrompt": {
      "description": "prompt to run before tool is run",
      "hai": "agent",
      "type": "string"
    },
    "postToolPrompt": {
      "description": "prompt to run after tool is run",
      "hai": "agent",
      "type": "string"
    },
    "estimatedCost": {
      "description": "estimated cost in dollars ",
      "hai": "agent",
      "type": "integer"
    },
    "estimatedTime": {
      "description": "estimated time in seconds",
      "hai": "agent",
      "type": "integer"
    },
    "cost": {
      "description": "actual cost in dollars ",
      "hai": "agent",
      "type": "integer"
    },
    "time": {
      "description": "actual time in seconds",
      "hai": "agent",
      "type": "integer"
    },
    "runAt": {
      "description": "Run in the future - job queue",
      "format": "date-time",
      "hai": "agent",
      "type": "string"
    },
    "humanEvaluatorRequired": {
      "description": "Human Evaluator is required ",
      "hai": "meta",
      "type": "boolean"
    },
    "completedSuccess": {
      "description": "A binary represenation of if the task completed successfully according to evaluation ",
      "hai": "meta",
      "type": "boolean"
    },
    "completedEvaluation": {
      "description": "A floating scale evaluation of level of success",
      "hai": "meta",
      "type": "integer"
    },
    "completedEvaluationDescription": {
      "description": "A qualitative description of the evaluation.",
      "hai": "meta",
      "type": "string"
    },
    "signature": {
      "description": "signature of planning agent",
      "$ref": "https://hai.ai/schemas/components/signature/v1/signature.schema.json"
    },
    "executingAgent": {
      "description": "agent responsible for executing, implies tools and services",
      "type": "string",
      "hai": "meta",
      "format": "uuid"
    },
    "responsibleAgent": {
      "type": "string",
      "hai": "meta",
      "description": "Agent doing the evaluation, implies tools and services",
      "format": "uuid"
    },
    "LLMType": {
      "type": "string",
      "description": "Which LLM to use when loaded prompts are provided.",
      "hai": "base"
    },
    "datetime": {
      "description": "Date of evaluation",
      "format": "date-time",
      "hai": "agent",
      "type": "string"
    }
  },
  "required": [
    "id",
    "datetime",
    "taskID"
  ],
  "additionalProperties": false
}
