Skip to content

Incorrectly infering str as Never #2237

@Stream29

Description

@Stream29

Describe the Bug

https://github.com/Stream29/dify-official-plugins/blob/1ad4d571a4d80138a9a76419c8ac9e1074567ce6/models/anthropic/models/llm/llm.py#L774

This will produce a type error without the type: ignore:
cd models/anthropic
uv sync
uv run pyrefly check

ERROR `str` is not assignable to attribute `arguments` with type `Never` [bad-assignment]
   --> models\llm\llm.py:774:61
    |
774 | ...                   tc.function.arguments = current_tool_params
    |                                               ^^^^^^^^^^^^^^^^^^^
    |
 INFO 1 error (2 suppressed)

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    pydanticIssues related to support for Pydantic

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions