moo.agent.tests.test_llm_client

Tests for moo/agent/llm_client.py.

Covers:
  • make_agent: returns a PydanticAI Agent per provider

  • call_llm: runs the agent and returns the validated AgentResponse

  • _model_settings: provider-specific sampling-kwarg assembly

  • _patch_reasoning_content: LM Studio reasoning_content -> content shim

Functions

test_call_llm_lm_studio_config()

The lm_studio config branch still produces a validated response.

test_call_llm_returns_agent_response_and_tool_calls()

call_llm runs the agent and returns (validated AgentResponse, tool_calls).

test_make_agent_anthropic(monkeypatch)

test_make_agent_lm_studio()

test_make_agent_lm_studio_default_base_url()

test_model_settings_anthropic_no_extra_body()

Non-lm_studio providers omit extra_body and unset sampling params.

test_model_settings_lm_studio_sampling()

LM Studio gets repeat_penalty/min_p/reasoning_effort in extra_body.

test_patch_reasoning_content_leaves_content_when_present()

When content is already populated, reasoning_content is ignored.

test_patch_reasoning_content_promotes_when_content_empty()

When content is empty, reasoning_content is copied into content.