cargo-ai 0.3.0

Build lightweight AI agents with Cargo. Powered by Rust. Declared in JSON.
{
  "version": "2026-03-03.r1",
  "inputs": [
    {
      "type": "text",
      "text": "Using the provided resources, determine if it will rain tomorrow between 9am and 5pm local time. Follow these exact steps: 1) Read the current local date and time from the time resource. 2) Determine the date for tomorrow. 3) From the weather data, examine precipitation probabilities for that specific date between 9:00 and 17:00 local time. 4) If any hourly probability exceeds 40%, answer true; otherwise, answer false."
    },
    {
      "type": "url",
      "url": "https://gettimeapi.dev/v1/time?timezone=America/New_York"
    },
    {
      "type": "url",
      "url": "https://api.open-meteo.com/v1/forecast?latitude=39.10&longitude=-84.51&hourly=precipitation_probability&timezone=America/New_York"
    }
  ],
  "agent_schema": {
    "type": "object",
    "properties": {
      "raining": {
        "type": "boolean",
        "description": "Indicates whether it is raining."
      }
    }
  },
  "actions": [
    {
      "name": "umbrella_hint_exec",
      "logic": {
        "==": [ { "var": "raining" }, true ]
      },
      "run": [
        {
          "platform": ["macos", "linux"],
          "kind": "exec",
          "program": "echo",
          "args": ["bring an umbrella because raining=", { "var": "raining" }]
        },
        {
          "platform": "windows",
          "kind": "exec",
          "program": "cmd",
          "args": ["/C", "echo", "bring an umbrella because raining=", { "var": "raining" }]
        }
      ]
    },
    {
      "name": "sunglasses_hint_exec",
      "logic": {
        "==": [ { "var": "raining" }, false ]
      },
      "run": [
        {
          "kind": "exec",
          "program": "echo",
          "args": ["bring sunglasses"]
        }
      ]
    }
  ]
}