Back to Documentation
AMADEV Docs
Guides

Agent Validation

7-step agent validation flow for /v1/chat/completions endpoint

AMADEV Agent Validation

Use amallm-agent-validation.json as the canonical first-turn payload for /v1/chat/completions.

Validation flow:

  1. GET /v1/models
  2. GET /v1/tools
  3. POST /v1/chat/completions with amallm-agent-validation.json
  4. If the selected model reports supports_tools: true, expect:
    • choices[0].message.tool_calls
    • choices[0].finish_reason === "tool_calls"
  5. Append the returned assistant message and a tool result message:
Code
{
  "role": "tool",
  "tool_call_id": "`<id-from-turn-1>`",
  "name": "get_weather",
  "content": "{\"city\":\"Bangkok\",\"temperature_c\":33,\"condition\":\"Cloudy\"}"
}
  1. Submit the second turn to /v1/chat/completions
  2. Expect:
    • final assistant content
    • choices[0].finish_reason === "stop"

Current compatibility behavior:

  • If /v1/models reports supports_tools: false, AMADEV will reject agentic tool-calling requests with a structured compatibility error instead of silently downgrading them into plain chat.
  • /v1/tools and /v1/tools/execute remain available for discovery and direct execution even when canonical chat tool-calling is disabled.