HTTP request tools for Ava

t-265.2·WorkTask·
·
·
Parent:t-265·Created2 months ago·Updated2 months ago

Description

Edit

Create explicit HTTP GET/POST tools for Ava to make API calls.

Context

Ava needs to interact with external APIs (forms, analytics, web services) as part of customer acquisition for PodcastItLater. While python_exec can do this, explicit HTTP tools are clearer and safer.

Requirements

1. Create Omni/Agent/Tools/Http.hs module 2. Two tools: http_get and http_post 3. Support headers, query params, JSON body 4. Return status code, headers, body 5. Timeout after 30 seconds

Tool Schemas

http_get

{
  "name": "http_get",
  "parameters": {
    "url": "string (required)",
    "headers": "object (optional) - key-value pairs",
    "params": "object (optional) - query parameters"
  }
}

http_post

{
  "name": "http_post",
  "parameters": {
    "url": "string (required)",
    "headers": "object (optional)",
    "body": "object or string (optional) - JSON body or raw string",
    "content_type": "string (optional) - default application/json"
  }
}

Implementation Notes

  • Use http-conduit (already a dependency in the codebase)
  • Follow patterns in Omni/Agent/Tools/WebReader.hs
  • Parse response body as text, let caller handle JSON parsing
  • Include response headers in result

Return Schema

{
  "status": 200,
  "headers": {"content-type": "application/json"},
  "body": "...response body as string..."
}

Files to Modify

  • Create: Omni/Agent/Tools/Http.hs
  • Modify: Omni/Agent/Telegram.hs (add tools to agent)

Verification

  • bild Omni/Agent/Tools/Http.hs
  • bild --test Omni/Agent/Tools/Http.hs

Timeline (2)

🔄[human]Open → InProgress2 months ago
🔄[human]InProgress → Done2 months ago