Skip to content

fix(llm): use Any instead of object for kwargs type in _build_litellm_model#179

Merged
PurpleCHOIms merged 1 commit intoPurpleAILAB:mainfrom
Lempkey:fix/llm-factory-kwargs-type
May 9, 2026
Merged

fix(llm): use Any instead of object for kwargs type in _build_litellm_model#179
PurpleCHOIms merged 1 commit intoPurpleAILAB:mainfrom
Lempkey:fix/llm-factory-kwargs-type

Conversation

@Lempkey
Copy link
Copy Markdown
Contributor

@Lempkey Lempkey commented May 8, 2026

Summary

  • Fixes dict[str, object]dict[str, Any] for the kwargs accumulator in LLMFactory._build_litellm_model() (decepticon/llm/factory.py:702)
  • Any is already imported; this is a one-line change
  • Resolves ~80 spurious pyright warnings of the form Argument of type "object" cannot be assigned to parameter "model" of type "str" that were drowning out real type errors in the factory module

Test plan

  • make lint passes on the changed file (ruff check + ruff format)
  • make test-local passes (no behavioural change — this is a type annotation only)
  • Verify pyright/basedpyright no longer emits the ~80 object → constructor-param warnings in factory.py

Closes #162

…_model

dict[str, object] caused ~80 pyright warnings when the kwargs dict was
unpacked into ChatOpenAI/ChatAnthropic constructors, burying real type
errors in the factory. Any is already imported and is the correct type
for a heterogeneous kwargs accumulator.

Closes PurpleAILAB#162
@Lempkey Lempkey requested a review from PurpleCHOIms as a code owner May 8, 2026 19:25
Copy link
Copy Markdown
Member

@PurpleCHOIms PurpleCHOIms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type-only fix verified: Any already imported, kwargs dict legitimately heterogeneous (SecretStr/int/bool/dict), no runtime impact.

@PurpleCHOIms PurpleCHOIms merged commit 7e20d74 into PurpleAILAB:main May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: dict[str, object] kwargs type in LLM factory masks ~80 type errors

2 participants