objectiveai-sdk 2.0.7

ObjectiveAI SDK, definitions, and utilities
Documentation
{
  "title": "functions.VectorCompletionTaskExpression",
  "description": "Expression for a task that runs a vector completion (pre-compilation).",
  "type": "object",
  "properties": {
    "map": {
      "description": "Expression that evaluates to the number of mapped task instances.\nEach instance receives `map` as an integer index (0-based).",
      "anyOf": [
        {
          "$ref": "functions.expression.Expression"
        },
        {
          "type": "null"
        }
      ],
      "omitempty": true
    },
    "messages": {
      "description": "Expression for the conversation messages (the prompt).\nReceives: `input`, `map` (if mapped).\n\nA value that can be either a literal or an expression.\n\nThis allows Function definitions to mix static values with dynamic\nexpressions. During compilation, expressions are evaluated while\nliteral values pass through unchanged.\n\n# Example\n\nLiteral value:\n```json\n\"hello world\"\n```\n\nJMESPath expression:\n```json\n{\"$jmespath\": \"input.greeting\"}\n```\n\nStarlark expression:\n```json\n{\"$starlark\": \"input['greeting']\"}\n```",
      "anyOf": [
        {
          "title": "Expression",
          "description": "An expression (JMESPath or Starlark) to evaluate.",
          "$ref": "functions.expression.Expression"
        },
        {
          "title": "Value",
          "description": "A literal value.",
          "type": "array",
          "items": {
            "description": "A value that can be either a literal or an expression.\n\nThis allows Function definitions to mix static values with dynamic\nexpressions. During compilation, expressions are evaluated while\nliteral values pass through unchanged.\n\n# Example\n\nLiteral value:\n```json\n\"hello world\"\n```\n\nJMESPath expression:\n```json\n{\"$jmespath\": \"input.greeting\"}\n```\n\nStarlark expression:\n```json\n{\"$starlark\": \"input['greeting']\"}\n```",
            "anyOf": [
              {
                "title": "Expression",
                "description": "An expression (JMESPath or Starlark) to evaluate.",
                "$ref": "functions.expression.Expression"
              },
              {
                "title": "Value",
                "description": "A literal value.",
                "$ref": "agent.completions.message.MessageExpression"
              }
            ]
          }
        }
      ]
    },
    "output": {
      "description": "Expression to transform the task result into a valid function output.\n\nReceives `output` as the task's raw result (typically `Vector(scores)`).\n\nThe expression must return a `TaskOutputOwned` that is valid for the parent function's type:\n- For scalar functions: must return `Scalar(value)` where value is in [0, 1]\n- For vector functions: must return `Vector(values)` where values sum to ~1 and match the expected length\n\nThe function's final output is computed as a weighted average of all task outputs using\nprofile weights. If a function has only one task, that task's output becomes the function's\noutput directly.",
      "$ref": "functions.expression.Expression"
    },
    "responses": {
      "description": "Expression for the possible responses the LLMs can vote for.\nReceives: `input`, `map` (if mapped).\n\nA value that can be either a literal or an expression.\n\nThis allows Function definitions to mix static values with dynamic\nexpressions. During compilation, expressions are evaluated while\nliteral values pass through unchanged.\n\n# Example\n\nLiteral value:\n```json\n\"hello world\"\n```\n\nJMESPath expression:\n```json\n{\"$jmespath\": \"input.greeting\"}\n```\n\nStarlark expression:\n```json\n{\"$starlark\": \"input['greeting']\"}\n```",
      "anyOf": [
        {
          "title": "Expression",
          "description": "An expression (JMESPath or Starlark) to evaluate.",
          "$ref": "functions.expression.Expression"
        },
        {
          "title": "Value",
          "description": "A literal value.",
          "type": "array",
          "items": {
            "description": "A value that can be either a literal or an expression.\n\nThis allows Function definitions to mix static values with dynamic\nexpressions. During compilation, expressions are evaluated while\nliteral values pass through unchanged.\n\n# Example\n\nLiteral value:\n```json\n\"hello world\"\n```\n\nJMESPath expression:\n```json\n{\"$jmespath\": \"input.greeting\"}\n```\n\nStarlark expression:\n```json\n{\"$starlark\": \"input['greeting']\"}\n```",
            "anyOf": [
              {
                "title": "Expression",
                "description": "An expression (JMESPath or Starlark) to evaluate.",
                "$ref": "functions.expression.Expression"
              },
              {
                "title": "Value",
                "description": "A literal value.",
                "$ref": "agent.completions.message.RichContentExpression"
              }
            ]
          }
        }
      ]
    },
    "skip": {
      "description": "If this expression evaluates to true, skip the task. Receives: `input`.",
      "anyOf": [
        {
          "$ref": "functions.expression.Expression"
        },
        {
          "type": "null"
        }
      ],
      "omitempty": true
    }
  }
}