select_chat_options (options/chat_options.py)

software-agent-sdk · openhands-sdk/openhands/sdk/llm/options/chat_options.py · python · MIT
ai, AI / Agents

Builds provider-aware LLM call options from user input and context.

# Source: https://github.com/OpenHands/software-agent-sdk | License: MIT | Copyright 2026 OpenHands contributors
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

from typing import TYPE_CHECKING, Any

from openhands.sdk.llm.call_context import (
    apply_llm_call_context,
    resolve_llm_call_context,
)
from openhands.sdk.llm.options.common import (
    apply_defaults_if_absent,
    apply_extra_body,
    apply_extra_headers,
    is_openrouter,
)


if TYPE_CHECKING:
    from openhands.sdk.llm.call_context import LLMCallContext


def select_chat_options(
    llm,
    user_kwargs: dict[str, Any],
    has_tools: bool,
    call_context: LLMCallContext | None = None,
) -> dict[str, Any]:
    """Behavior-preserving extraction of _normalize_call_

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key