MingaClaudeBridge.Session.Request (minga_claude_bridge v0.1.0)

Copy Markdown View Source

One input to a MingaClaudeBridge.Session: a new prompt, or the results of the tool calls the previous request ended with.

  • ref - identifies the request. The session tags every event for this request with it.
  • kind - {:prompt, content} where content is a string or a list of MingaClaudeBridge.Wire.Block values, or {:tool_results, results}.
  • tools - the tools Minga offers for this request. The session answers tools/list and validates tools/call against them until the next request.

A tool result is %{tool_use_id: id, content: [part], is_error: boolean}, where a part is a MingaClaudeBridge.ToolCalls.part/0. The request must carry one result for every tool call the previous request ended with.

Content and results are conversation content. Do not log them.

Summary

Functions

Builds a prompt request with a new ref.

Builds a tool-results request with a new ref.

Types

kind()

@type kind() ::
  {:prompt, String.t() | [MingaClaudeBridge.Wire.Block.t()]}
  | {:tool_results, [tool_result()]}

t()

@type t() :: %MingaClaudeBridge.Session.Request{
  kind: kind(),
  ref: reference(),
  tools: [MingaClaudeBridge.MCP.tool()]
}

tool_result()

@type tool_result() :: %{
  tool_use_id: String.t(),
  content: [MingaClaudeBridge.ToolCalls.part()],
  is_error: boolean()
}

Functions

prompt(content, tools)

Builds a prompt request with a new ref.

tool_results(results, tools)

@spec tool_results([tool_result()], [MingaClaudeBridge.MCP.tool()]) :: t()

Builds a tool-results request with a new ref.