Skip to content

jiti.agent.llm

Internal API

Documented for transparency — the supported public surface is the top-level jiti package. Internals can change in any release.

jiti.agent.llm

LiteLLM adapter for jiti's tool-use loop.

Attributes

DEFAULT_NUM_RETRIES module-attribute

DEFAULT_NUM_RETRIES = 3

How many times litellm should retry a transient provider error (429, 5xx, timeout). A small positive default means a single blip doesn't bubble out of the user's @jiti call.

Classes

ToolCall dataclass

Source code in src/jiti/agent/llm.py
@dataclass(frozen=True)
class ToolCall:
    id: str
    name: str
    input: dict[str, Any]
    type: str = "tool_use"
    parse_error: str | None = None
    """Set when the model's tool-call JSON was malformed. The dispatcher surfaces this as
    a tool error the agent can read and fix on its next turn, instead of letting it raise
    out of the user's `@jiti` call."""
Attributes
parse_error class-attribute instance-attribute
parse_error: str | None = None

Set when the model's tool-call JSON was malformed. The dispatcher surfaces this as a tool error the agent can read and fix on its next turn, instead of letting it raise out of the user's @jiti call.