diff --git a/backend/chainlit/cli/__init__.py b/backend/chainlit/cli/__init__.py index 234b7befb64..5aa9ed72475 100644 --- a/backend/chainlit/cli/__init__.py +++ b/backend/chainlit/cli/__init__.py @@ -5,8 +5,10 @@ import nest_asyncio import uvicorn +# Not sure if it is necessary to call nest_asyncio.apply() before the other imports nest_asyncio.apply() +# ruff: noqa: E402 from chainlit.cache import init_lc_cache from chainlit.config import ( BACKEND_ROOT, diff --git a/backend/chainlit/haystack/callbacks.py b/backend/chainlit/haystack/callbacks.py index 288db5fa3cb..687ec7d4b05 100644 --- a/backend/chainlit/haystack/callbacks.py +++ b/backend/chainlit/haystack/callbacks.py @@ -1,14 +1,13 @@ import re from typing import Any, Generic, List, Optional, TypeVar +from chainlit import Message from chainlit.step import Step from chainlit.sync import run_sync from haystack.agents import Agent, Tool from haystack.agents.agent_step import AgentStep from literalai.helper import utc_now -from chainlit import Message - T = TypeVar("T") diff --git a/cypress/e2e/chat_settings/main.py b/cypress/e2e/chat_settings/main.py index 494e0e1f080..650946fda71 100644 --- a/cypress/e2e/chat_settings/main.py +++ b/cypress/e2e/chat_settings/main.py @@ -1,6 +1,5 @@ -from chainlit.input_widget import Select, Slider, Switch - import chainlit as cl +from chainlit.input_widget import Select, Slider, Switch @cl.on_chat_start diff --git a/cypress/e2e/data_layer/main.py b/cypress/e2e/data_layer/main.py index e44e31bc49c..2fc6181ffa7 100644 --- a/cypress/e2e/data_layer/main.py +++ b/cypress/e2e/data_layer/main.py @@ -2,6 +2,7 @@ import pickle from typing import Dict, List, Optional +import chainlit as cl import chainlit.data as cl_data from chainlit.data.utils import queue_until_user_message from chainlit.element import Element, ElementDict @@ -17,8 +18,6 @@ ) from literalai.helper import utc_now -import chainlit as cl - now = utc_now() thread_history = [ diff --git a/cypress/e2e/llama_index_cb/main.py b/cypress/e2e/llama_index_cb/main.py index 136cd054119..80ce43ef169 100644 --- a/cypress/e2e/llama_index_cb/main.py +++ b/cypress/e2e/llama_index_cb/main.py @@ -1,9 +1,8 @@ +import chainlit as cl from llama_index.core.callbacks.schema import CBEventType, EventPayload from llama_index.core.llms import ChatMessage, ChatResponse from llama_index.core.schema import NodeWithScore, TextNode -import chainlit as cl - @cl.on_chat_start async def start(): diff --git a/cypress/e2e/plotly/main.py b/cypress/e2e/plotly/main.py index e89c5d8fa0e..d17fb4cd7cc 100644 --- a/cypress/e2e/plotly/main.py +++ b/cypress/e2e/plotly/main.py @@ -1,6 +1,5 @@ -import plotly.graph_objects as go - import chainlit as cl +import plotly.graph_objects as go @cl.on_chat_start diff --git a/cypress/e2e/pyplot/main.py b/cypress/e2e/pyplot/main.py index 79f140ba986..0728821ea0a 100644 --- a/cypress/e2e/pyplot/main.py +++ b/cypress/e2e/pyplot/main.py @@ -1,6 +1,5 @@ -import matplotlib.pyplot as plt - import chainlit as cl +import matplotlib.pyplot as plt @cl.on_chat_start