Jidoka.Chat.Request (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Runtime handle for an async Jidoka chat request.

The handle is intentionally not part of the durable agent data contract. It is a caller-owned runtime convenience for UI processes that need to start a turn, stream request-scoped events, and await the normalized final chat result.

Summary

Functions

Waits for an async chat request to finish.

Starts an async chat task and returns a request handle.

Types

t()

@type t() :: %Jidoka.Chat.Request{
  metadata: map(),
  request_id: String.t(),
  session_id: String.t() | nil,
  started_at_ms: integer(),
  stream_to: pid() | nil,
  target: term(),
  task: Task.t()
}

Functions

await(request, opts \\ [])

@spec await(
  t(),
  keyword()
) :: term() | {:error, term()}

Waits for an async chat request to finish.

start(target, input, opts)

@spec start(term(), String.t(), keyword()) :: {:ok, t()} | {:error, term()}

Starts an async chat task and returns a request handle.