Skip to content

Conversation

@2725244134
Copy link

Changes dict to dict[str, Any] in RequestError static factory methods to provide more precise type hints
Motivation

The kimi-cli project uses this library and has enabled Pyright strict type checking. The current dict annotations in RequestError methods trigger type warnings:

Changes

Updated the following methods in exceptions.py:

parse_error()
invalid_request()
invalid_params()
internal_error()
auth_required()
Benefits

✅ Passes strict type checking (Pyright, mypy)
✅ Correct JSON-RPC 2.0 semantics (JSON objects use string keys)
✅ Better IDE autocomplete and error detection

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.

1 participant