fix(): errors discovered by mypy in AIGW 1

What does this merge request do and why?

Addressing the following mypy errors:

ai_gateway/code_suggestions/processing/pre/base.py:25: error: Incompatible types in assignment (expression has type "None", variable has type "PromptTemplateBase")  [assignment]
ai_gateway/code_suggestions/processing/pre/base.py:26: error: Need type annotation for "tpl_args" (hint: "tpl_args: dict[<type>, <type>] = ...")  [var-annotated]
ai_gateway/code_suggestions/processing/base.py:86: error: Argument 4 to "_generate" of "ModelEngineBase" has incompatible type "LanguageId | None"; expected "LanguageId"  [arg-type]
ai_gateway/code_suggestions/processing/base.py:98: error: Incompatible types in assignment (expression has type "str", target has type "None")  [assignment]
ai_gateway/code_suggestions/processing/base.py:101: error: Incompatible types in assignment (expression has type "str", target has type "None")  [assignment]
ai_gateway/code_suggestions/processing/base.py:103: error: Incompatible types in assignment (expression has type "str", target has type "None")  [assignment]
ai_gateway/code_suggestions/experimental.py:13: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]"  [misc]
ai_gateway/code_suggestions/experimental.py:20: error: Name "Model" is not defined  [name-defined]
ai_gateway/code_suggestions/experimental.py:42: error: "type[CodeCompletionsInternal]" has no attribute "Model"  [attr-defined]

How to set up and validate locally

Running linting and testing in CI should be sufficent.

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.

Closes #715 (closed)

Merge request reports

Loading