POST /v1/messages — non-streaming #9

Open
opened 2026-08-03 16:55:30 -07:00 by kalmiya · 0 comments
Owner

Kanban ticket: t_a445eb1a
Board: hermes-anthropic-api


Task t_a445eb1a: POST /v1/messages — non-streaming
status: ready
assignee: -
workspace: scratch
max-retries: 2 (default)
created: 2026-08-03 16:53 by kalmiya

Body:
Anthropic Messages API: create a message (non-streaming response).

Request shape (Anthropic):

  • model: string — resolves to Hermes provider/model via existing _resolve_route machinery (or falls through to the agent's default provider).
  • messages: [{role, content}] — system prompt lives in the system field, NOT in messages.
  • max_tokens: int — required.
  • Optional: temperature, top_p, stop_sequences, metadata, tools, tool_choice, thinking, stream.

Response shape:

  • {id, type: "message", role: "assistant", content: [{type: "text"|"tool_use"|"thinking", ...}], model, stop_reason, stop_sequence?, usage: {input_tokens, output_tokens, cache_creation_input_tokens?, cache_read_input_tokens?}}

Source: https://docs.anthropic.com/en/api/messages

Notes:

  • System prompt: extract from system field and prepend to Hermes agent call as a system message.
  • Content blocks: emit text blocks for assistant text, tool_use blocks when the agent invoked a tool.
  • stop_reason mapping: agent finish reasons → Anthropic (end_turn, max_tokens, stop_sequence, tool_use).
  • usage mapping: pull from the agent's token accounting; emit cache_* fields when prompt caching is enabled.

Status labels: status/todo on creation.

Events (1):
[2026-08-03 16:53] created {'assignee': None, 'status': 'ready', 'parents': [], 'tenant': None, 'workspace_kind': 'scratch', 'workspace_path': None, 'branch_name': None, 'project_id': None, 'skills': None, 'goal_mode': None, 'model_override': None, 'provider_override': None}

**Kanban ticket:** `t_a445eb1a` **Board:** `hermes-anthropic-api` --- Task t_a445eb1a: POST /v1/messages — non-streaming status: ready assignee: - workspace: scratch max-retries: 2 (default) created: 2026-08-03 16:53 by kalmiya Body: Anthropic Messages API: create a message (non-streaming response). Request shape (Anthropic): - `model: string` — resolves to Hermes provider/model via existing `_resolve_route` machinery (or falls through to the agent's default provider). - `messages: [{role, content}]` — system prompt lives in the `system` field, NOT in messages. - `max_tokens: int` — required. - Optional: `temperature`, `top_p`, `stop_sequences`, `metadata`, `tools`, `tool_choice`, `thinking`, `stream`. Response shape: - `{id, type: "message", role: "assistant", content: [{type: "text"|"tool_use"|"thinking", ...}], model, stop_reason, stop_sequence?, usage: {input_tokens, output_tokens, cache_creation_input_tokens?, cache_read_input_tokens?}}` Source: https://docs.anthropic.com/en/api/messages Notes: - System prompt: extract from `system` field and prepend to Hermes agent call as a system message. - Content blocks: emit text blocks for assistant text, `tool_use` blocks when the agent invoked a tool. - `stop_reason` mapping: agent finish reasons → Anthropic (`end_turn`, `max_tokens`, `stop_sequence`, `tool_use`). - `usage` mapping: pull from the agent's token accounting; emit `cache_*` fields when prompt caching is enabled. Status labels: status/todo on creation. Events (1): [2026-08-03 16:53] created {'assignee': None, 'status': 'ready', 'parents': [], 'tenant': None, 'workspace_kind': 'scratch', 'workspace_path': None, 'branch_name': None, 'project_id': None, 'skills': None, 'goal_mode': None, 'model_override': None, 'provider_override': None}
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kalmiya/hermes-anthropic-api#9
No description provided.