Jido.AI.Directive.LLMStream (Jido AI v2.2.0)

Copy Markdown View Source

Directive asking the runtime to stream an LLM response via ReqLLM.

Uses ReqLLM for streaming. The runtime will execute this asynchronously and send partial tokens as ai.llm.delta signals and the final result as a ai.llm.response signal.

New Fields

  • system_prompt - Optional system prompt prepended to context
  • model_alias - Model alias (e.g., :fast) resolved via Jido.AI.resolve_model/1
  • timeout - Request timeout in milliseconds

Either model or model_alias must be provided. If model_alias is used, it is resolved to a model spec at execution time.

Summary

Functions

Create a new LLMStream directive.

Types

t()

@type t() :: %Jido.AI.Directive.LLMStream{
  context: any(),
  id: binary(),
  max_tokens: integer(),
  metadata: map(),
  model: nil | binary(),
  model_alias: nil | atom(),
  req_http_options: [any()],
  system_prompt: nil | binary(),
  temperature: number(),
  timeout: nil | integer(),
  tool_choice: any(),
  tools: [any()]
}

Functions

new!(attrs)

Create a new LLMStream directive.