From 9245914cb5dffe687a01a874f6fa3f9a3f13bf93 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 08:23:11 -0800 Subject: [PATCH 01/23] Add mypy dependencies And configure mypy. However, there are still a ton of errors. Not ready to add this to CI yet. --- mypy.ini | 29 +++++++++++++++++++++++++++++ setup.py | 9 +++++++++ 2 files changed, 38 insertions(+) create mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..5b753bd --- /dev/null +++ b/mypy.ini @@ -0,0 +1,29 @@ +[mypy] +python_version = 3.11 +warn_return_any = True +warn_unused_configs = True +disallow_untyped_defs = False +disallow_incomplete_defs = False +check_untyped_defs = False +disallow_untyped_decorators = True +no_implicit_optional = True +warn_redundant_casts = True +warn_unused_ignores = True +warn_no_return = True +warn_unreachable = True + +[mypy-*] +disallow_untyped_defs = False +check_untyped_defs = False + +[mypy-django.*] +ignore_missing_imports = True + +[mypy-sentry_sdk.*] +ignore_missing_imports = True + +[mypy-posthog.test.*] +ignore_errors = True + +[mypy-posthog.*.test.*] +ignore_errors = True \ No newline at end of file diff --git a/setup.py b/setup.py index 6ae42b5..94ab730 100644 --- a/setup.py +++ b/setup.py @@ -25,9 +25,18 @@ extras_require = { "dev": [ "black", + "django-stubs", "isort", "flake8", "flake8-print", + "lxml", + "mypy", + "mypy-baseline", + "types-mock", + "types-python-dateutil", + "types-requests", + "types-setuptools", + "types-six", "pre-commit", ], "test": [ From d04e7781decb680188cbef81c092137df1207f91 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 08:33:39 -0800 Subject: [PATCH 02/23] Add mypy to CI But only report on new errors --- .github/workflows/ci.yml | 4 + mypy-baseline.txt | 348 +++++++++++++++++++++++++++++++++++++++ mypy.ini | 6 +- 3 files changed, 355 insertions(+), 3 deletions(-) create mode 100644 mypy-baseline.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3c96dd..2ae91c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,10 @@ jobs: run: | isort --check-only . + - name: Check types with mypy + run: | + mypy . | mypy-baseline filter + tests: name: Python tests runs-on: ubuntu-latest diff --git a/mypy-baseline.txt b/mypy-baseline.txt new file mode 100644 index 0000000..10d36ed --- /dev/null +++ b/mypy-baseline.txt @@ -0,0 +1,348 @@ +posthog/poller.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/poller.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/poller.py:0: note: Use "-> None" if function does not return a value +posthog/poller.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/poller.py:0: note: Use "-> None" if function does not return a value +posthog/exception_utils.py:0: error: Statement is unreachable [unreachable] +setup_analytics.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] +setup_analytics.py:0: error: Cannot find implementation or library stub for module named "version" [import-not-found] +setup.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] +setup.py:0: error: Cannot find implementation or library stub for module named "version" [import-not-found] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] +sentry_django_example/manage.py:0: error: Function is missing a return type annotation [no-untyped-def] +sentry_django_example/manage.py:0: note: Use "-> None" if function does not return a value +posthog/exception_integrations/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] +posthog/exception_integrations/django.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +posthog/exception_integrations/django.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/exception_integrations/django.py:0: note: Use "-> None" if function does not return a value +posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Argument 1 to "join" of "str" has incompatible type "AttributeError"; expected "Iterable[str]" [arg-type] +posthog/utils.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/request.py:0: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] +posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/request.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/request.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/consumer.py:0: error: Skipping analyzing "monotonic": module is installed, but missing library stubs or py.typed marker [import-untyped] +posthog/consumer.py:0: error: Cannot find implementation or library stub for module named "Queue" [import-not-found] +posthog/consumer.py:0: error: Name "Empty" already defined (possibly by an import) [no-redef] +posthog/consumer.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/consumer.py:0: note: Use "-> None" if function does not return a value +posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/consumer.py:0: note: Use "-> None" if function does not return a value +posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/consumer.py:0: error: Need type annotation for "items" (hint: "items: list[] = ...") [var-annotated] +posthog/consumer.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/consumer.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/consumer.py:0: error: Unsupported operand types for <= ("int" and "str") [operator] +posthog/consumer.py:0: note: Right operand is of type "int | str" +posthog/consumer.py:0: error: Unsupported operand types for < ("str" and "int") [operator] +posthog/consumer.py:0: note: Left operand is of type "int | str" +posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/consumer.py:0: note: Use "-> None" if function does not return a value +posthog/exception_capture.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/exception_capture.py:0: note: Use "-> None" if function does not return a value +posthog/exception_capture.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/exception_capture.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/exception_capture.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/exception_capture.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/feature_flags.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/feature_flags.py:0: error: Unused "type: ignore" comment [unused-ignore] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/feature_flags.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/client.py:0: error: Cannot find implementation or library stub for module named "Queue" [import-not-found] +posthog/client.py:0: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports +posthog/client.py:0: error: Name "queue" already defined (by an import) [no-redef] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Need type annotation for "queue" [var-annotated] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/client.py:0: note: Use "-> None" if function does not return a value +posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/client.py:0: note: Use "-> None" if function does not return a value +posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/client.py:0: note: Use "-> None" if function does not return a value +posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/client.py:0: note: Use "-> None" if function does not return a value +posthog/client.py:0: error: Value of type "Response" is not indexable [index] +posthog/client.py:0: error: Value of type "Response" is not indexable [index] +posthog/client.py:0: error: Value of type "Response" is not indexable [index] +posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/client.py:0: note: Use "-> None" if function does not return a value +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Item "None" of "Any | None" has no attribute "get" [union-attr] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] +posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] +posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] +posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] +posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] +posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] +posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] +posthog/__init__.py:0: error: Returning Any from function declared to return "bool" [no-any-return] +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: note: Use "-> None" if function does not return a value +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: note: Use "-> None" if function does not return a value +posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/__init__.py:0: note: Use "-> None" if function does not return a value +posthog/__init__.py:0: error: Function is missing a type annotation [no-untyped-def] +simulator.py:0: error: Function is missing a type annotation [no-untyped-def] +simulator.py:0: error: Function is missing a type annotation [no-untyped-def] +simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] +simulator.py:0: note: Use "-> None" if function does not return a value +simulator.py:0: error: Unexpected keyword argument "anonymous_id" for "capture" [call-arg] +posthog/__init__.py:0: note: "capture" defined here +simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] +simulator.py:0: note: Use "-> None" if function does not return a value +simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] +simulator.py:0: note: Use "-> None" if function does not return a value +simulator.py:0: error: Unexpected keyword argument "anonymous_id" for "identify" [call-arg] +posthog/__init__.py:0: note: "identify" defined here +simulator.py:0: error: Unexpected keyword argument "traits" for "identify" [call-arg] +posthog/__init__.py:0: note: "identify" defined here +simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] +simulator.py:0: note: Use "-> None" if function does not return a value +simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] +simulator.py:0: note: Use "-> None" if function does not return a value +simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] +simulator.py:0: note: Use "-> None" if function does not return a value +example.py:0: error: Statement is unreachable [unreachable] +sentry_django_example/sentry_django_example/urls.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/sentry/posthog_integration.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/sentry/posthog_integration.py:0: error: Untyped decorator makes function "processor" untyped [misc] +posthog/sentry/posthog_integration.py:0: error: Statement is unreachable [unreachable] +sentry_django_example/sentry_django_example/settings.py:0: error: Need type annotation for "ALLOWED_HOSTS" (hint: "ALLOWED_HOSTS: list[] = ...") [var-annotated] +sentry_django_example/sentry_django_example/settings.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment] +posthog/ai/utils.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/utils.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/utils.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/utils.py:0: error: Need type annotation for "output" (hint: "output: list[] = ...") [var-annotated] +posthog/ai/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/ai/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/ai/utils.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [valid-type] +posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"? +posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [valid-type] +posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"? +posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/utils.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/openai/openai_async.py:0: error: Argument 6 to "call_llm_and_track_usage_async" has incompatible type "URL"; expected "bool" [arg-type] +posthog/ai/openai/openai_async.py:0: error: Argument 7 to "call_llm_and_track_usage_async" has incompatible type overloaded function; expected "dict[str, Any] | None" [arg-type] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/openai/openai_async.py:0: error: Unpacked dict entry 11 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/openai/openai_async.py:0: error: Unpacked dict entry 8 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/openai/openai.py:0: error: Unpacked dict entry 11 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/openai/openai.py:0: error: Unpacked dict entry 8 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic_async.py:0: error: Signature of "stream" incompatible with supertype "AsyncMessages" [override] +posthog/ai/anthropic/anthropic_async.py:0: note: Superclass: +posthog/ai/anthropic/anthropic_async.py:0: note: def stream(self, *, max_tokens: int, messages: Iterable[MessageParam], model: Literal['claude-3-5-haiku-latest', 'claude-3-5-haiku-20241022', 'claude-3-5-sonnet-latest', 'claude-3-5-sonnet-20241022', 'claude-3-5-sonnet-20240620', 'claude-3-opus-latest', 'claude-3-opus-20240229', 'claude-3-sonnet-20240229', 'claude-3-haiku-20240307', 'claude-2.1', 'claude-2.0'] | str, metadata: MetadataParam | NotGiven = ..., stop_sequences: list[str] | NotGiven = ..., system: str | Iterable[TextBlockParam] | NotGiven = ..., temperature: float | NotGiven = ..., top_k: int | NotGiven = ..., top_p: float | NotGiven = ..., tool_choice: ToolChoiceAutoParam | ToolChoiceAnyParam | ToolChoiceToolParam | NotGiven = ..., tools: Iterable[ToolParam] | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> AsyncMessageStreamManager +posthog/ai/anthropic/anthropic_async.py:0: note: Subclass: +posthog/ai/anthropic/anthropic_async.py:0: note: def stream(self, posthog_distinct_id: str | None = ..., posthog_trace_id: str | None = ..., posthog_properties: dict[str, Any] | None = ..., posthog_privacy_mode: bool = ..., posthog_groups: dict[str, Any] | None = ..., **kwargs: Any) -> Coroutine[Any, Any, Any] +posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/anthropic/anthropic.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +llm_observability_examples.py:0: error: Argument "posthog_client" to "OpenAI" has incompatible type Module; expected "Client" [arg-type] +llm_observability_examples.py:0: error: Argument "posthog_client" to "AsyncOpenAI" has incompatible type Module; expected "Client" [arg-type] +llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] +llm_observability_examples.py:0: note: Use "-> None" if function does not return a value +llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] +llm_observability_examples.py:0: note: Use "-> None" if function does not return a value +llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] +llm_observability_examples.py:0: error: No overload variant of "create" of "Completions" matches argument types "str", "list[dict[str, str]]", "int", "float", "Any", "Any", "Any", "Any" [call-overload] +llm_observability_examples.py:0: note: Possible overload variants: +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Stream[ChatCompletionChunk] +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion | Stream[ChatCompletionChunk] +llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] +llm_observability_examples.py:0: error: No overload variant of "create" of "AsyncCompletions" matches argument types "str", "list[dict[str, str]]", "int", "float", "Any", "Any", "Any", "Any" [call-overload] +llm_observability_examples.py:0: note: Possible overload variants: +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion] +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, AsyncStream[ChatCompletionChunk]] +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion | AsyncStream[ChatCompletionChunk]] +llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] +llm_observability_examples.py:0: error: No overload variant of "create" of "Completions" matches argument types "str", "list[dict[str, str]]", "int", "float", "bool", "Any", "Any", "Any", "Any" [call-overload] +llm_observability_examples.py:0: note: Possible overload variants: +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Stream[ChatCompletionChunk] +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion | Stream[ChatCompletionChunk] +llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] +llm_observability_examples.py:0: error: No overload variant of "create" of "AsyncCompletions" matches argument types "str", "list[dict[str, str]]", "int", "float", "bool", "Any", "Any", "Any", "Any" [call-overload] +llm_observability_examples.py:0: note: Possible overload variants: +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion] +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, AsyncStream[ChatCompletionChunk]] +llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion | AsyncStream[ChatCompletionChunk]] +llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] +llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] +llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "Embeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "Embeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "Embeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "Embeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here +llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "AsyncEmbeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "AsyncEmbeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "AsyncEmbeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "AsyncEmbeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here +llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "parse" of "Completions" [call-arg] +env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "parse" of "Completions" [call-arg] +env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "parse" of "Completions" [call-arg] +env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here +llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "parse" of "Completions" [call-arg] +env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/ai/langchain/callbacks.py:0: error: Returning Any from function declared to return "str | None" [no-any-return] +posthog/ai/langchain/callbacks.py:0: error: Returning Any from function declared to return "str | None" [no-any-return] +posthog/ai/langchain/callbacks.py:0: error: Returning Any from function declared to return "str | None" [no-any-return] +posthog/ai/anthropic/anthropic_providers.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/anthropic/anthropic_providers.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/anthropic/anthropic_providers.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] +posthog/ai/anthropic/anthropic_providers.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] diff --git a/mypy.ini b/mypy.ini index 5b753bd..fc7e244 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2,9 +2,9 @@ python_version = 3.11 warn_return_any = True warn_unused_configs = True -disallow_untyped_defs = False -disallow_incomplete_defs = False -check_untyped_defs = False +disallow_untyped_defs = True +disallow_incomplete_defs = True +check_untyped_defs = True disallow_untyped_decorators = True no_implicit_optional = True warn_redundant_casts = True From cf84ebc6f34442f1be78046efa69a37b23db6ca4 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 08:45:12 -0800 Subject: [PATCH 03/23] Add more dependencies And ignore more missing imports --- mypy-baseline.txt | 22 +++++++++++----------- setup.py | 2 ++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/mypy-baseline.txt b/mypy-baseline.txt index 10d36ed..89fbee2 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -8,18 +8,8 @@ setup_analytics.py:0: error: Incompatible import of "setup" (imported name has t setup_analytics.py:0: error: Cannot find implementation or library stub for module named "version" [import-not-found] setup.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] setup.py:0: error: Cannot find implementation or library stub for module named "version" [import-not-found] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] sentry_django_example/manage.py:0: error: Function is missing a return type annotation [no-untyped-def] sentry_django_example/manage.py:0: note: Use "-> None" if function does not return a value -posthog/exception_integrations/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] -posthog/exception_integrations/django.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True -posthog/exception_integrations/django.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase -posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/exception_integrations/django.py:0: note: Use "-> None" if function does not return a value -posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] @@ -35,6 +25,16 @@ posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-de posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/exception_integrations/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] +posthog/exception_integrations/django.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +posthog/exception_integrations/django.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/exception_integrations/django.py:0: note: Use "-> None" if function does not return a value +posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] posthog/request.py:0: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] @@ -179,10 +179,10 @@ simulator.py:0: note: Use "-> None" if function does not return a value simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] simulator.py:0: note: Use "-> None" if function does not return a value example.py:0: error: Statement is unreachable [unreachable] -sentry_django_example/sentry_django_example/urls.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/sentry/posthog_integration.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/sentry/posthog_integration.py:0: error: Untyped decorator makes function "processor" untyped [misc] posthog/sentry/posthog_integration.py:0: error: Statement is unreachable [unreachable] +sentry_django_example/sentry_django_example/urls.py:0: error: Function is missing a type annotation [no-untyped-def] sentry_django_example/sentry_django_example/settings.py:0: error: Need type annotation for "ALLOWED_HOSTS" (hint: "ALLOWED_HOSTS: list[] = ...") [var-annotated] sentry_django_example/sentry_django_example/settings.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment] posthog/ai/utils.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] diff --git a/setup.py b/setup.py index 94ab730..253f54b 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,8 @@ "types-requests", "types-setuptools", "types-six", + "types-httpx", + "types-pydantic", "pre-commit", ], "test": [ From 988b3b0711252ede1021427d4e8d451c4564e1d8 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 08:46:49 -0800 Subject: [PATCH 04/23] Ignore more imports --- mypy.ini | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index fc7e244..eba305d 100644 --- a/mypy.ini +++ b/mypy.ini @@ -26,4 +26,19 @@ ignore_missing_imports = True ignore_errors = True [mypy-posthog.*.test.*] -ignore_errors = True \ No newline at end of file +ignore_errors = True + +[mypy-openai.*] +ignore_missing_imports = True + +[mypy-langchain.*] +ignore_missing_imports = True + +[mypy-langchain_core.*] +ignore_missing_imports = True + +[mypy-anthropic.*] +ignore_missing_imports = True + +[mypy-pydantic.*] +ignore_missing_imports = True \ No newline at end of file From d1a25ff9a7e8f447e81a704cf9e7dbaf80ee5072 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 08:48:49 -0800 Subject: [PATCH 05/23] Remove redundant section --- mypy-baseline.txt | 12 ------------ mypy.ini | 4 ---- 2 files changed, 16 deletions(-) diff --git a/mypy-baseline.txt b/mypy-baseline.txt index 89fbee2..3098717 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -288,31 +288,19 @@ llm_observability_examples.py:0: error: Function is missing a return type annota llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "Embeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "Embeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "Embeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "Embeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "AsyncEmbeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "AsyncEmbeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "AsyncEmbeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "AsyncEmbeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "parse" of "Completions" [call-arg] -env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "parse" of "Completions" [call-arg] -env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "parse" of "Completions" [call-arg] -env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "parse" of "Completions" [call-arg] -env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] diff --git a/mypy.ini b/mypy.ini index eba305d..17944d2 100644 --- a/mypy.ini +++ b/mypy.ini @@ -12,10 +12,6 @@ warn_unused_ignores = True warn_no_return = True warn_unreachable = True -[mypy-*] -disallow_untyped_defs = False -check_untyped_defs = False - [mypy-django.*] ignore_missing_imports = True From 03c1eb8d6f2bfb3a315596fa098dee9f1afd99af Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 08:50:32 -0800 Subject: [PATCH 06/23] Remove non-existent --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 253f54b..6e41369 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,6 @@ "types-requests", "types-setuptools", "types-six", - "types-httpx", "types-pydantic", "pre-commit", ], From 2f432bcd972ceebc807e8093f67bcb2275892dad Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 08:51:35 -0800 Subject: [PATCH 07/23] Update setup.py --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 6e41369..94ab730 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,6 @@ "types-requests", "types-setuptools", "types-six", - "types-pydantic", "pre-commit", ], "test": [ From f3cd89fbacc941f02ace5f1c853e895d750d0905 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 08:53:07 -0800 Subject: [PATCH 08/23] Ignore more missing imports --- mypy.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index 17944d2..d263596 100644 --- a/mypy.ini +++ b/mypy.ini @@ -37,4 +37,7 @@ ignore_missing_imports = True ignore_missing_imports = True [mypy-pydantic.*] -ignore_missing_imports = True \ No newline at end of file +ignore_missing_imports = True + +[mypy-httpx.*] +ignore_missing_imports = True From 3ea56e9835f33be63028f5c3c2a037c398257b9a Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:02:59 -0800 Subject: [PATCH 09/23] Update the baseline --- mypy-baseline.txt | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/mypy-baseline.txt b/mypy-baseline.txt index 3098717..47df161 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -8,8 +8,18 @@ setup_analytics.py:0: error: Incompatible import of "setup" (imported name has t setup_analytics.py:0: error: Cannot find implementation or library stub for module named "version" [import-not-found] setup.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] setup.py:0: error: Cannot find implementation or library stub for module named "version" [import-not-found] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] sentry_django_example/manage.py:0: error: Function is missing a return type annotation [no-untyped-def] sentry_django_example/manage.py:0: note: Use "-> None" if function does not return a value +posthog/exception_integrations/django.py:0: error: Function is missing a type annotation [no-untyped-def] +posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] +posthog/exception_integrations/django.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +posthog/exception_integrations/django.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] +posthog/exception_integrations/django.py:0: note: Use "-> None" if function does not return a value +posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] @@ -25,16 +35,6 @@ posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-de posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/exception_integrations/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] -posthog/exception_integrations/django.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True -posthog/exception_integrations/django.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase -posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/exception_integrations/django.py:0: note: Use "-> None" if function does not return a value -posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] posthog/request.py:0: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] @@ -288,19 +288,31 @@ llm_observability_examples.py:0: error: Function is missing a return type annota llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "Embeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "Embeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "Embeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "Embeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "AsyncEmbeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "AsyncEmbeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "AsyncEmbeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "AsyncEmbeddings" [call-arg] +env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "parse" of "Completions" [call-arg] +env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "parse" of "Completions" [call-arg] +env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "parse" of "Completions" [call-arg] +env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "parse" of "Completions" [call-arg] +env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] From a6eaf1c71691502f1273fb17c40e484162296b6f Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:07:51 -0800 Subject: [PATCH 10/23] Look at mypy.ini in posthog/posthog Adapted some changes from there. --- .github/workflows/ci.yml | 4 +- mypy-baseline.txt | 241 --------------------------------------- mypy.ini | 14 +-- 3 files changed, 8 insertions(+), 251 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ae91c3..425f73b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,10 @@ jobs: with: fetch-depth: 1 - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.11.9 - uses: actions/cache@v3 with: diff --git a/mypy-baseline.txt b/mypy-baseline.txt index 47df161..d033e17 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -1,292 +1,86 @@ -posthog/poller.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/poller.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/poller.py:0: note: Use "-> None" if function does not return a value -posthog/poller.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/poller.py:0: note: Use "-> None" if function does not return a value posthog/exception_utils.py:0: error: Statement is unreachable [unreachable] setup_analytics.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] -setup_analytics.py:0: error: Cannot find implementation or library stub for module named "version" [import-not-found] setup.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] -setup.py:0: error: Cannot find implementation or library stub for module named "version" [import-not-found] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/sentry/django.py:0: error: Function is missing a type annotation [no-untyped-def] -sentry_django_example/manage.py:0: error: Function is missing a return type annotation [no-untyped-def] -sentry_django_example/manage.py:0: note: Use "-> None" if function does not return a value -posthog/exception_integrations/django.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] posthog/exception_integrations/django.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True posthog/exception_integrations/django.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase -posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/exception_integrations/django.py:0: note: Use "-> None" if function does not return a value -posthog/exception_integrations/django.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/utils.py:0: error: Argument 1 to "join" of "str" has incompatible type "AttributeError"; expected "Iterable[str]" [arg-type] -posthog/utils.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] posthog/request.py:0: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] -posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/request.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/request.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/request.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/consumer.py:0: error: Skipping analyzing "monotonic": module is installed, but missing library stubs or py.typed marker [import-untyped] -posthog/consumer.py:0: error: Cannot find implementation or library stub for module named "Queue" [import-not-found] posthog/consumer.py:0: error: Name "Empty" already defined (possibly by an import) [no-redef] -posthog/consumer.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/consumer.py:0: note: Use "-> None" if function does not return a value -posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/consumer.py:0: note: Use "-> None" if function does not return a value -posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/consumer.py:0: error: Need type annotation for "items" (hint: "items: list[] = ...") [var-annotated] -posthog/consumer.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/consumer.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/consumer.py:0: error: Unsupported operand types for <= ("int" and "str") [operator] posthog/consumer.py:0: note: Right operand is of type "int | str" posthog/consumer.py:0: error: Unsupported operand types for < ("str" and "int") [operator] posthog/consumer.py:0: note: Left operand is of type "int | str" -posthog/consumer.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/consumer.py:0: note: Use "-> None" if function does not return a value -posthog/exception_capture.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/exception_capture.py:0: note: Use "-> None" if function does not return a value -posthog/exception_capture.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/exception_capture.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/exception_capture.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/exception_capture.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/feature_flags.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/feature_flags.py:0: error: Unused "type: ignore" comment [unused-ignore] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/feature_flags.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/feature_flags.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/client.py:0: error: Cannot find implementation or library stub for module named "Queue" [import-not-found] -posthog/client.py:0: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports posthog/client.py:0: error: Name "queue" already defined (by an import) [no-redef] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/client.py:0: error: Need type annotation for "queue" [var-annotated] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/client.py:0: note: Use "-> None" if function does not return a value -posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/client.py:0: note: Use "-> None" if function does not return a value -posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/client.py:0: note: Use "-> None" if function does not return a value -posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/client.py:0: note: Use "-> None" if function does not return a value posthog/client.py:0: error: Value of type "Response" is not indexable [index] posthog/client.py:0: error: Value of type "Response" is not indexable [index] posthog/client.py:0: error: Value of type "Response" is not indexable [index] -posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/client.py:0: note: Use "-> None" if function does not return a value -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] posthog/client.py:0: error: Item "None" of "Any | None" has no attribute "get" [union-attr] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/client.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] -posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] -posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] -posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] -posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] -posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] -posthog/__init__.py:0: error: Returning Any from function declared to return "tuple[bool, dict[Any, Any]]" [no-any-return] -posthog/__init__.py:0: error: Returning Any from function declared to return "bool" [no-any-return] -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: note: Use "-> None" if function does not return a value -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: note: Use "-> None" if function does not return a value -posthog/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/__init__.py:0: note: Use "-> None" if function does not return a value -posthog/__init__.py:0: error: Function is missing a type annotation [no-untyped-def] -simulator.py:0: error: Function is missing a type annotation [no-untyped-def] -simulator.py:0: error: Function is missing a type annotation [no-untyped-def] -simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] -simulator.py:0: note: Use "-> None" if function does not return a value simulator.py:0: error: Unexpected keyword argument "anonymous_id" for "capture" [call-arg] posthog/__init__.py:0: note: "capture" defined here -simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] -simulator.py:0: note: Use "-> None" if function does not return a value -simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] -simulator.py:0: note: Use "-> None" if function does not return a value simulator.py:0: error: Unexpected keyword argument "anonymous_id" for "identify" [call-arg] posthog/__init__.py:0: note: "identify" defined here simulator.py:0: error: Unexpected keyword argument "traits" for "identify" [call-arg] posthog/__init__.py:0: note: "identify" defined here -simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] -simulator.py:0: note: Use "-> None" if function does not return a value -simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] -simulator.py:0: note: Use "-> None" if function does not return a value -simulator.py:0: error: Function is missing a return type annotation [no-untyped-def] -simulator.py:0: note: Use "-> None" if function does not return a value example.py:0: error: Statement is unreachable [unreachable] -posthog/sentry/posthog_integration.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/sentry/posthog_integration.py:0: error: Untyped decorator makes function "processor" untyped [misc] posthog/sentry/posthog_integration.py:0: error: Statement is unreachable [unreachable] -sentry_django_example/sentry_django_example/urls.py:0: error: Function is missing a type annotation [no-untyped-def] sentry_django_example/sentry_django_example/settings.py:0: error: Need type annotation for "ALLOWED_HOSTS" (hint: "ALLOWED_HOSTS: list[] = ...") [var-annotated] sentry_django_example/sentry_django_example/settings.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment] -posthog/ai/utils.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/utils.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/utils.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] posthog/ai/utils.py:0: error: Need type annotation for "output" (hint: "output: list[] = ...") [var-annotated] -posthog/ai/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/ai/utils.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/ai/utils.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [valid-type] posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"? posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [valid-type] posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"? posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/utils.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai_async.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/openai/openai_async.py:0: error: Argument 6 to "call_llm_and_track_usage_async" has incompatible type "URL"; expected "bool" [arg-type] posthog/ai/openai/openai_async.py:0: error: Argument 7 to "call_llm_and_track_usage_async" has incompatible type overloaded function; expected "dict[str, Any] | None" [arg-type] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/openai/openai_async.py:0: error: Unpacked dict entry 11 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/openai/openai_async.py:0: error: Unpacked dict entry 8 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai_async.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/openai/openai.py:0: error: Unpacked dict entry 11 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/openai/openai.py:0: error: Unpacked dict entry 8 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/openai/openai.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/anthropic/anthropic_async.py:0: error: Signature of "stream" incompatible with supertype "AsyncMessages" [override] posthog/ai/anthropic/anthropic_async.py:0: note: Superclass: posthog/ai/anthropic/anthropic_async.py:0: note: def stream(self, *, max_tokens: int, messages: Iterable[MessageParam], model: Literal['claude-3-5-haiku-latest', 'claude-3-5-haiku-20241022', 'claude-3-5-sonnet-latest', 'claude-3-5-sonnet-20241022', 'claude-3-5-sonnet-20240620', 'claude-3-opus-latest', 'claude-3-opus-20240229', 'claude-3-sonnet-20240229', 'claude-3-haiku-20240307', 'claude-2.1', 'claude-2.0'] | str, metadata: MetadataParam | NotGiven = ..., stop_sequences: list[str] | NotGiven = ..., system: str | Iterable[TextBlockParam] | NotGiven = ..., temperature: float | NotGiven = ..., top_k: int | NotGiven = ..., top_p: float | NotGiven = ..., tool_choice: ToolChoiceAutoParam | ToolChoiceAnyParam | ToolChoiceToolParam | NotGiven = ..., tools: Iterable[ToolParam] | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> AsyncMessageStreamManager posthog/ai/anthropic/anthropic_async.py:0: note: Subclass: posthog/ai/anthropic/anthropic_async.py:0: note: def stream(self, posthog_distinct_id: str | None = ..., posthog_trace_id: str | None = ..., posthog_properties: dict[str, Any] | None = ..., posthog_privacy_mode: bool = ..., posthog_groups: dict[str, Any] | None = ..., **kwargs: Any) -> Coroutine[Any, Any, Any] posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/anthropic/anthropic_async.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/anthropic/anthropic.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/anthropic/anthropic.py:0: error: Function is missing a return type annotation [no-untyped-def] posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] llm_observability_examples.py:0: error: Argument "posthog_client" to "OpenAI" has incompatible type Module; expected "Client" [arg-type] llm_observability_examples.py:0: error: Argument "posthog_client" to "AsyncOpenAI" has incompatible type Module; expected "Client" [arg-type] -llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] -llm_observability_examples.py:0: note: Use "-> None" if function does not return a value -llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] -llm_observability_examples.py:0: note: Use "-> None" if function does not return a value -llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: No overload variant of "create" of "Completions" matches argument types "str", "list[dict[str, str]]", "int", "float", "Any", "Any", "Any", "Any" [call-overload] llm_observability_examples.py:0: note: Possible overload variants: llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Stream[ChatCompletionChunk] llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion | Stream[ChatCompletionChunk] -llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: No overload variant of "create" of "AsyncCompletions" matches argument types "str", "list[dict[str, str]]", "int", "float", "Any", "Any", "Any", "Any" [call-overload] llm_observability_examples.py:0: note: Possible overload variants: llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion] llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, AsyncStream[ChatCompletionChunk]] llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion | AsyncStream[ChatCompletionChunk]] -llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: No overload variant of "create" of "Completions" matches argument types "str", "list[dict[str, str]]", "int", "float", "bool", "Any", "Any", "Any", "Any" [call-overload] llm_observability_examples.py:0: note: Possible overload variants: llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Stream[ChatCompletionChunk] llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion | Stream[ChatCompletionChunk] -llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: No overload variant of "create" of "AsyncCompletions" matches argument types "str", "list[dict[str, str]]", "int", "float", "bool", "Any", "Any", "Any", "Any" [call-overload] llm_observability_examples.py:0: note: Possible overload variants: llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion] llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, AsyncStream[ChatCompletionChunk]] llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion | AsyncStream[ChatCompletionChunk]] -llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] -llm_observability_examples.py:0: error: Function is missing a return type annotation [no-untyped-def] -llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "Embeddings" [call-arg] env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "Embeddings" [call-arg] @@ -295,7 +89,6 @@ llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_pro env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "Embeddings" [call-arg] env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here -llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "AsyncEmbeddings" [call-arg] env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "AsyncEmbeddings" [call-arg] @@ -304,7 +97,6 @@ llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_pro env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "AsyncEmbeddings" [call-arg] env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here -llm_observability_examples.py:0: error: Function is missing a type annotation [no-untyped-def] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "parse" of "Completions" [call-arg] env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "parse" of "Completions" [call-arg] @@ -313,36 +105,3 @@ llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_pro env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "parse" of "Completions" [call-arg] env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Function is missing a return type annotation [no-untyped-def] -posthog/ai/langchain/callbacks.py:0: error: Returning Any from function declared to return "str | None" [no-any-return] -posthog/ai/langchain/callbacks.py:0: error: Returning Any from function declared to return "str | None" [no-any-return] -posthog/ai/langchain/callbacks.py:0: error: Returning Any from function declared to return "str | None" [no-any-return] -posthog/ai/anthropic/anthropic_providers.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/anthropic/anthropic_providers.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/anthropic/anthropic_providers.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] -posthog/ai/anthropic/anthropic_providers.py:0: error: Function is missing a type annotation for one or more arguments [no-untyped-def] diff --git a/mypy.ini b/mypy.ini index d263596..9bf1179 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,16 +1,14 @@ [mypy] python_version = 3.11 -warn_return_any = True -warn_unused_configs = True -disallow_untyped_defs = True -disallow_incomplete_defs = True -check_untyped_defs = True -disallow_untyped_decorators = True +plugins = + pydantic.mypy +strict_optional = True no_implicit_optional = True -warn_redundant_casts = True warn_unused_ignores = True -warn_no_return = True +check_untyped_defs = True warn_unreachable = True +strict_equality = True +ignore_missing_imports = True [mypy-django.*] ignore_missing_imports = True From 3a3a6f99ff5d7dd5a6de08ef50ff58edd3f3ca6b Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:11:50 -0800 Subject: [PATCH 11/23] Add pydantic --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 94ab730..67531f5 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,7 @@ "types-setuptools", "types-six", "pre-commit", + "pydantic", ], "test": [ "mock>=2.0.0", From 5f1515ae136fc99a323fec9aeb2f52191e66f295 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:14:21 -0800 Subject: [PATCH 12/23] Fix type annotation --- posthog/exception_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/exception_utils.py b/posthog/exception_utils.py index 17b7630..b08395f 100644 --- a/posthog/exception_utils.py +++ b/posthog/exception_utils.py @@ -793,7 +793,7 @@ def event_from_exception( def _module_in_list(name, items): - # type: (str, Optional[List[str]]) -> bool + # type: (str | None, Optional[List[str]]) -> bool if name is None: return False From 239ab1460af66c0f75321534f86782e247bcbba3 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:14:32 -0800 Subject: [PATCH 13/23] Stop ignoring pydantic --- mypy.ini | 3 --- 1 file changed, 3 deletions(-) diff --git a/mypy.ini b/mypy.ini index 9bf1179..ac78a4c 100644 --- a/mypy.ini +++ b/mypy.ini @@ -34,8 +34,5 @@ ignore_missing_imports = True [mypy-anthropic.*] ignore_missing_imports = True -[mypy-pydantic.*] -ignore_missing_imports = True - [mypy-httpx.*] ignore_missing_imports = True From 23e1cce340f1c64fcde48f9973f0e9fff3d16b56 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:14:42 -0800 Subject: [PATCH 14/23] Create new baseline --- mypy-baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/mypy-baseline.txt b/mypy-baseline.txt index d033e17..309b430 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -1,4 +1,3 @@ -posthog/exception_utils.py:0: error: Statement is unreachable [unreachable] setup_analytics.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] setup.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] From 34038332bb39ad00512dbde7c16f41ee939451c5 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:20:13 -0800 Subject: [PATCH 15/23] Update mypy-baseline.txt --- mypy-baseline.txt | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/mypy-baseline.txt b/mypy-baseline.txt index 309b430..352df18 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -1,9 +1,9 @@ setup_analytics.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] setup.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] +posthog/utils.py:0: error: Argument 1 to "join" of "str" has incompatible type "AttributeError"; expected "Iterable[str]" [arg-type] posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] posthog/exception_integrations/django.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True posthog/exception_integrations/django.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase -posthog/utils.py:0: error: Argument 1 to "join" of "str" has incompatible type "AttributeError"; expected "Iterable[str]" [arg-type] posthog/request.py:0: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] posthog/consumer.py:0: error: Name "Empty" already defined (possibly by an import) [no-redef] posthog/consumer.py:0: error: Need type annotation for "items" (hint: "items: list[] = ...") [var-annotated] @@ -81,26 +81,14 @@ llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[Ch llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, AsyncStream[ChatCompletionChunk]] llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion | AsyncStream[ChatCompletionChunk]] llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "Embeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "Embeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "Embeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "Embeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "Embeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "AsyncEmbeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "AsyncEmbeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "AsyncEmbeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "AsyncEmbeddings" [call-arg] -env/lib/python3.11/site-packages/openai/resources/embeddings.py:0: note: "create" of "AsyncEmbeddings" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "parse" of "Completions" [call-arg] -env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "parse" of "Completions" [call-arg] -env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "parse" of "Completions" [call-arg] -env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "parse" of "Completions" [call-arg] -env/lib/python3.11/site-packages/openai/resources/beta/chat/completions.py:0: note: "parse" of "Completions" defined here From 27b8dca64e6382482bd5b8bfb34f3b3826ea2b3d Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:26:13 -0800 Subject: [PATCH 16/23] Attempt to fix CI's mypy --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 425f73b..db5de58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python 3.11 uses: actions/setup-python@v2 with: - python-version: 3.11.9 + python-version: 3.11.11 - uses: actions/cache@v3 with: @@ -42,9 +42,12 @@ jobs: run: | isort --check-only . + - name: Check mypy version + run: mypy --version + - name: Check types with mypy run: | - mypy . | mypy-baseline filter + mypy --config-file mypy.ini . | mypy-baseline filter tests: name: Python tests From 738d81f5df05fab19c4d9a182a4b6eb26167972f Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:28:00 -0800 Subject: [PATCH 17/23] Add verbose output --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db5de58..5d8ef98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,10 @@ jobs: - name: Check mypy version run: mypy --version + - name: Verbose mypy output for debugging + run: | + mypy -v --config-file mypy.ini . + - name: Check types with mypy run: | mypy --config-file mypy.ini . | mypy-baseline filter From 69ab0f6e81feb58af0c8b47e914ca45e39c7f0cc Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:34:01 -0800 Subject: [PATCH 18/23] Update mypy-baseline.txt --- mypy-baseline.txt | 65 ++++++++++++----------------------------------- 1 file changed, 16 insertions(+), 49 deletions(-) diff --git a/mypy-baseline.txt b/mypy-baseline.txt index 352df18..31c016a 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -1,9 +1,10 @@ -setup_analytics.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] -setup.py:0: error: Incompatible import of "setup" (imported name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(list[distutils.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[distutils.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(Literal[0, 1] | bool, 'include_package_data'), DefaultNamedArg(list[str], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], distutils.dist.Distribution]", local name has type "Callable[[DefaultNamedArg(str, 'name'), DefaultNamedArg(str, 'version'), DefaultNamedArg(str, 'description'), DefaultNamedArg(str, 'long_description'), DefaultNamedArg(str, 'long_description_content_type'), DefaultNamedArg(str, 'author'), DefaultNamedArg(str, 'author_email'), DefaultNamedArg(str, 'maintainer'), DefaultNamedArg(str, 'maintainer_email'), DefaultNamedArg(str, 'url'), DefaultNamedArg(str, 'download_url'), DefaultNamedArg(list[str], 'packages'), DefaultNamedArg(list[str], 'py_modules'), DefaultNamedArg(list[str], 'scripts'), DefaultNamedArg(Sequence[setuptools.extension.Extension], 'ext_modules'), DefaultNamedArg(list[str], 'classifiers'), DefaultNamedArg(type[setuptools.dist.Distribution], 'distclass'), DefaultNamedArg(str, 'script_name'), DefaultNamedArg(list[str], 'script_args'), DefaultNamedArg(Mapping[str, Any], 'options'), DefaultNamedArg(str, 'license'), DefaultNamedArg(list[str] | str, 'keywords'), DefaultNamedArg(list[str] | str, 'platforms'), DefaultNamedArg(Mapping[str, type[setuptools._distutils.cmd.Command]], 'cmdclass'), DefaultNamedArg(list[tuple[str, list[str]]], 'data_files'), DefaultNamedArg(Mapping[str, str], 'package_dir'), DefaultNamedArg(list[str], 'obsoletes'), DefaultNamedArg(list[str], 'provides'), DefaultNamedArg(list[str], 'requires'), DefaultNamedArg(list[str], 'command_packages'), DefaultNamedArg(Mapping[str, Mapping[str, tuple[Any, Any]]], 'command_options'), DefaultNamedArg(Mapping[str, list[str]], 'package_data'), DefaultNamedArg(bool, 'include_package_data'), DefaultNamedArg(list[tuple[str, _BuildInfo]], 'libraries'), DefaultNamedArg(list[str], 'headers'), DefaultNamedArg(str, 'ext_package'), DefaultNamedArg(list[str], 'include_dirs'), DefaultNamedArg(str, 'password'), DefaultNamedArg(str, 'fullname'), KwArg(Any)], setuptools.dist.Distribution]") [assignment] +posthog/utils.py:0: error: Library stubs not installed for "six" [import-untyped] +posthog/utils.py:0: error: Library stubs not installed for "dateutil.tz" [import-untyped] +posthog/utils.py:0: error: Statement is unreachable [unreachable] posthog/utils.py:0: error: Argument 1 to "join" of "str" has incompatible type "AttributeError"; expected "Iterable[str]" [arg-type] -posthog/exception_integrations/django.py:0: error: Incompatible default for argument "request" (default has type "None", argument has type "WSGIRequest") [assignment] -posthog/exception_integrations/django.py:0: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True -posthog/exception_integrations/django.py:0: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +posthog/request.py:0: error: Library stubs not installed for "requests" [import-untyped] +posthog/request.py:0: note: Hint: "python3 -m pip install types-requests" +posthog/request.py:0: error: Library stubs not installed for "dateutil.tz" [import-untyped] posthog/request.py:0: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] posthog/consumer.py:0: error: Name "Empty" already defined (possibly by an import) [no-redef] posthog/consumer.py:0: error: Need type annotation for "items" (hint: "items: list[] = ...") [var-annotated] @@ -11,12 +12,17 @@ posthog/consumer.py:0: error: Unsupported operand types for <= ("int" and "str") posthog/consumer.py:0: note: Right operand is of type "int | str" posthog/consumer.py:0: error: Unsupported operand types for < ("str" and "int") [operator] posthog/consumer.py:0: note: Left operand is of type "int | str" +posthog/feature_flags.py:0: error: Library stubs not installed for "dateutil" [import-untyped] +posthog/feature_flags.py:0: error: Library stubs not installed for "dateutil.relativedelta" [import-untyped] posthog/feature_flags.py:0: error: Unused "type: ignore" comment [unused-ignore] +posthog/client.py:0: error: Library stubs not installed for "dateutil.tz" [import-untyped] +posthog/client.py:0: note: Hint: "python3 -m pip install types-python-dateutil" +posthog/client.py:0: note: (or run "mypy --install-types" to install all missing stub packages) +posthog/client.py:0: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports +posthog/client.py:0: error: Library stubs not installed for "six" [import-untyped] +posthog/client.py:0: note: Hint: "python3 -m pip install types-six" posthog/client.py:0: error: Name "queue" already defined (by an import) [no-redef] posthog/client.py:0: error: Need type annotation for "queue" [var-annotated] -posthog/client.py:0: error: Value of type "Response" is not indexable [index] -posthog/client.py:0: error: Value of type "Response" is not indexable [index] -posthog/client.py:0: error: Value of type "Response" is not indexable [index] posthog/client.py:0: error: Item "None" of "Any | None" has no attribute "get" [union-attr] simulator.py:0: error: Unexpected keyword argument "anonymous_id" for "capture" [call-arg] posthog/__init__.py:0: note: "capture" defined here @@ -26,8 +32,6 @@ simulator.py:0: error: Unexpected keyword argument "traits" for "identify" [cal posthog/__init__.py:0: note: "identify" defined here example.py:0: error: Statement is unreachable [unreachable] posthog/sentry/posthog_integration.py:0: error: Statement is unreachable [unreachable] -sentry_django_example/sentry_django_example/settings.py:0: error: Need type annotation for "ALLOWED_HOSTS" (hint: "ALLOWED_HOSTS: list[] = ...") [var-annotated] -sentry_django_example/sentry_django_example/settings.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment] posthog/ai/utils.py:0: error: Need type annotation for "output" (hint: "output: list[] = ...") [var-annotated] posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [valid-type] posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"? @@ -35,9 +39,9 @@ posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has t posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [valid-type] posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"? posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] +sentry_django_example/sentry_django_example/settings.py:0: error: Need type annotation for "ALLOWED_HOSTS" (hint: "ALLOWED_HOSTS: list[] = ...") [var-annotated] +sentry_django_example/sentry_django_example/settings.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment] posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/openai/openai_async.py:0: error: Argument 6 to "call_llm_and_track_usage_async" has incompatible type "URL"; expected "bool" [arg-type] -posthog/ai/openai/openai_async.py:0: error: Argument 7 to "call_llm_and_track_usage_async" has incompatible type overloaded function; expected "dict[str, Any] | None" [arg-type] posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/openai/openai_async.py:0: error: Unpacked dict entry 11 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] @@ -48,11 +52,6 @@ posthog/ai/openai/openai.py:0: error: Unpacked dict entry 11 has incompatible ty posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/openai/openai.py:0: error: Unpacked dict entry 8 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] -posthog/ai/anthropic/anthropic_async.py:0: error: Signature of "stream" incompatible with supertype "AsyncMessages" [override] -posthog/ai/anthropic/anthropic_async.py:0: note: Superclass: -posthog/ai/anthropic/anthropic_async.py:0: note: def stream(self, *, max_tokens: int, messages: Iterable[MessageParam], model: Literal['claude-3-5-haiku-latest', 'claude-3-5-haiku-20241022', 'claude-3-5-sonnet-latest', 'claude-3-5-sonnet-20241022', 'claude-3-5-sonnet-20240620', 'claude-3-opus-latest', 'claude-3-opus-20240229', 'claude-3-sonnet-20240229', 'claude-3-haiku-20240307', 'claude-2.1', 'claude-2.0'] | str, metadata: MetadataParam | NotGiven = ..., stop_sequences: list[str] | NotGiven = ..., system: str | Iterable[TextBlockParam] | NotGiven = ..., temperature: float | NotGiven = ..., top_k: int | NotGiven = ..., top_p: float | NotGiven = ..., tool_choice: ToolChoiceAutoParam | ToolChoiceAnyParam | ToolChoiceToolParam | NotGiven = ..., tools: Iterable[ToolParam] | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> AsyncMessageStreamManager -posthog/ai/anthropic/anthropic_async.py:0: note: Subclass: -posthog/ai/anthropic/anthropic_async.py:0: note: def stream(self, posthog_distinct_id: str | None = ..., posthog_trace_id: str | None = ..., posthog_properties: dict[str, Any] | None = ..., posthog_privacy_mode: bool = ..., posthog_groups: dict[str, Any] | None = ..., **kwargs: Any) -> Coroutine[Any, Any, Any] posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] @@ -60,35 +59,3 @@ posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (ex posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] llm_observability_examples.py:0: error: Argument "posthog_client" to "OpenAI" has incompatible type Module; expected "Client" [arg-type] llm_observability_examples.py:0: error: Argument "posthog_client" to "AsyncOpenAI" has incompatible type Module; expected "Client" [arg-type] -llm_observability_examples.py:0: error: No overload variant of "create" of "Completions" matches argument types "str", "list[dict[str, str]]", "int", "float", "Any", "Any", "Any", "Any" [call-overload] -llm_observability_examples.py:0: note: Possible overload variants: -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Stream[ChatCompletionChunk] -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion | Stream[ChatCompletionChunk] -llm_observability_examples.py:0: error: No overload variant of "create" of "AsyncCompletions" matches argument types "str", "list[dict[str, str]]", "int", "float", "Any", "Any", "Any", "Any" [call-overload] -llm_observability_examples.py:0: note: Possible overload variants: -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion] -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, AsyncStream[ChatCompletionChunk]] -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion | AsyncStream[ChatCompletionChunk]] -llm_observability_examples.py:0: error: No overload variant of "create" of "Completions" matches argument types "str", "list[dict[str, str]]", "int", "float", "bool", "Any", "Any", "Any", "Any" [call-overload] -llm_observability_examples.py:0: note: Possible overload variants: -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Stream[ChatCompletionChunk] -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> ChatCompletion | Stream[ChatCompletionChunk] -llm_observability_examples.py:0: error: No overload variant of "create" of "AsyncCompletions" matches argument types "str", "list[dict[str, str]]", "int", "float", "bool", "Any", "Any", "Any", "Any" [call-overload] -llm_observability_examples.py:0: note: Possible overload variants: -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion] -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: Literal[True], audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, AsyncStream[ChatCompletionChunk]] -llm_observability_examples.py:0: note: def create(self, *, messages: Iterable[ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: str | Literal['o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'chatgpt-4o-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613'], stream: bool, audio: ChatCompletionAudioParam | NotGiven | None = ..., frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: Iterable[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., logprobs: bool | NotGiven | None = ..., max_completion_tokens: int | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., metadata: dict[str, str] | NotGiven | None = ..., modalities: list[Literal['text', 'audio']] | NotGiven | None = ..., n: int | NotGiven | None = ..., parallel_tool_calls: bool | NotGiven = ..., prediction: ChatCompletionPredictionContentParam | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., reasoning_effort: Literal['low', 'medium', 'high'] | NotGiven = ..., response_format: ResponseFormatText | ResponseFormatJSONObject | ResponseFormatJSONSchema | NotGiven = ..., seed: int | NotGiven | None = ..., service_tier: Literal['auto', 'default'] | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., store: bool | NotGiven | None = ..., stream_options: ChatCompletionStreamOptionsParam | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto', 'required'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: Iterable[ChatCompletionToolParam] | NotGiven = ..., top_logprobs: int | NotGiven | None = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion | AsyncStream[ChatCompletionChunk]] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "Embeddings" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "Embeddings" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "Embeddings" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "Embeddings" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "create" of "AsyncEmbeddings" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "create" of "AsyncEmbeddings" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "create" of "AsyncEmbeddings" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "create" of "AsyncEmbeddings" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_distinct_id" for "parse" of "Completions" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_trace_id" for "parse" of "Completions" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_properties" for "parse" of "Completions" [call-arg] -llm_observability_examples.py:0: error: Unexpected keyword argument "posthog_groups" for "parse" of "Completions" [call-arg] From 9a1aa3c5933c44d821405f19e45cf049dd19d604 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:34:20 -0800 Subject: [PATCH 19/23] No site packages --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d8ef98..91d13b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,11 +47,11 @@ jobs: - name: Verbose mypy output for debugging run: | - mypy -v --config-file mypy.ini . + mypy --no-site-packages --config-file mypy.ini . - name: Check types with mypy run: | - mypy --config-file mypy.ini . | mypy-baseline filter + mypy --no-site-packages --config-file mypy.ini . | mypy-baseline filter tests: name: Python tests From cd1f806ca18cd572cb556f8c2f5718f09c3b69ca Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:39:09 -0800 Subject: [PATCH 20/23] Update ci.yml --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91d13b5..eba0072 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,12 +42,13 @@ jobs: run: | isort --check-only . - - name: Check mypy version - run: mypy --version - - name: Verbose mypy output for debugging run: | - mypy --no-site-packages --config-file mypy.ini . + mypy --no-site-packages --config-file mypy.ini . | mypy-baseline sync + + - name: Echo the baseline file created in the previous step + run: | + cat .mypy_cache/baseline.txt - name: Check types with mypy run: | From 82477f0f1cdbf739be89c201c15eacf3231f0a8a Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:44:00 -0800 Subject: [PATCH 21/23] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eba0072..61b78d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: - name: Echo the baseline file created in the previous step run: | - cat .mypy_cache/baseline.txt + cat mypy-baseline.txt - name: Check types with mypy run: | From b65edfab52ae14c10abda180b3cdb58e623f4d64 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:45:37 -0800 Subject: [PATCH 22/23] Remove trailing newline --- mypy-baseline.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy-baseline.txt b/mypy-baseline.txt index 31c016a..9e95c31 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -58,4 +58,4 @@ posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (ex posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] llm_observability_examples.py:0: error: Argument "posthog_client" to "OpenAI" has incompatible type Module; expected "Client" [arg-type] -llm_observability_examples.py:0: error: Argument "posthog_client" to "AsyncOpenAI" has incompatible type Module; expected "Client" [arg-type] +llm_observability_examples.py:0: error: Argument "posthog_client" to "AsyncOpenAI" has incompatible type Module; expected "Client" [arg-type] \ No newline at end of file From 6a61f2fe342c956628dfd4b8e19c1ae82b15ca45 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 11 Feb 2025 09:46:18 -0800 Subject: [PATCH 23/23] Update ci.yml --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61b78d7..dc4a15a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,14 +42,6 @@ jobs: run: | isort --check-only . - - name: Verbose mypy output for debugging - run: | - mypy --no-site-packages --config-file mypy.ini . | mypy-baseline sync - - - name: Echo the baseline file created in the previous step - run: | - cat mypy-baseline.txt - - name: Check types with mypy run: | mypy --no-site-packages --config-file mypy.ini . | mypy-baseline filter