Skip to content

Change import order to fix app startup issues #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- main
- mob/main
- release/1
- customer-hotfix
jobs:
build:

Expand Down
27 changes: 17 additions & 10 deletions llm-service/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,25 @@
# DATA.
# ##############################################################################

import functools
# ruff: noqa: E402
import sys
import logging
import os
import platform
import sys

logger = logging.getLogger(__name__)

try:
# Manual patch required for CrewAI compatability. DO NOT REMOVE. IT BREAKS ON OLD RUNTIMES IF YOU DO
Copy link
Preview

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

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

Correct the spelling of 'compatability' to 'compatibility' in the comment.

Suggested change
# Manual patch required for CrewAI compatability. DO NOT REMOVE. IT BREAKS ON OLD RUNTIMES IF YOU DO
# Manual patch required for CrewAI compatibility. DO NOT REMOVE. IT BREAKS ON OLD RUNTIMES IF YOU DO

Copilot uses AI. Check for mistakes.

__import__("pysqlite3")
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")
except Exception as e:
logger.info(
f"Unable to swap out pysqlite3. Probably not installed on your platform: {platform.system()}",
e,
)

import functools
import os
import time
from collections.abc import Awaitable, Callable
from contextlib import asynccontextmanager
Expand All @@ -56,15 +70,8 @@

_APP_PKG_NAME = __name__.split(".", maxsplit=1)[0]

logger = logging.getLogger(__name__)
_request_received_logger = logging.getLogger(_APP_PKG_NAME + ".access")

try:
# Manual patch required for CrewAI compatability. DO NOT REMOVE. IT BREAKS ON OLD RUNTIMES IF YOU DO
__import__("pysqlite3")
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")
except Exception as e:
logger.info(f"Unable to swap out pysqlite3. Probably not installed on your platform: {platform.system()}", e)

def _configure_logger() -> None:
"""Configure this module's setup/teardown logging formatting and verbosity."""
Expand Down
Loading