Skip to content

Commit 7397ad0

Browse files
committed
fix black
1 parent 5d47073 commit 7397ad0

5 files changed

Lines changed: 13 additions & 14 deletions

File tree

openchatbi/code/docker_executor.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def check_docker_status() -> tuple[bool, str]:
3636

3737
# Check if Docker daemon is running
3838
# Fixed command and arguments; no user input reaches subprocess.
39-
result = subprocess.run( # nosec B603
40-
[docker_cli_path, "info"], capture_output=True, text=True, timeout=10
41-
)
39+
result = subprocess.run([docker_cli_path, "info"], capture_output=True, text=True, timeout=10) # nosec B603
4240

4341
if result.returncode == 0:
4442
return True, "Docker is installed and running"
@@ -85,9 +83,7 @@ def _check_docker_availability() -> None:
8583
# Check if Docker daemon is running
8684
try:
8785
# Fixed command and arguments; no user input reaches subprocess.
88-
result = subprocess.run( # nosec B603
89-
[docker_cli_path, "info"], capture_output=True, text=True, timeout=10
90-
)
86+
result = subprocess.run([docker_cli_path, "info"], capture_output=True, text=True, timeout=10) # nosec B603
9187
if result.returncode != 0:
9288
if "Cannot connect to the Docker daemon" in result.stderr:
9389
raise RuntimeError(

openchatbi/context_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@ def _apply_conversation_summarization(self, messages: list[BaseMessage]) -> None
289289

290290
if len(historical_messages) == 1:
291291
msg = historical_messages[0]
292-
if isinstance(msg, AIMessage) and isinstance(msg.content, str) and msg.content.startswith(
293-
"[Conversation Summary]"
292+
if (
293+
isinstance(msg, AIMessage)
294+
and isinstance(msg.content, str)
295+
and msg.content.startswith("[Conversation Summary]")
294296
):
295297
return
296298

openchatbi/streaming.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,9 @@ def _process_updates(self, depth: int, layer_label: str, event_value: Any) -> It
296296

297297
elif node_name == "information_extraction":
298298
message_obj = (_message_list(node_output.get("messages")) or [None])[0]
299-
if message_obj and getattr(message_obj, "tool_calls", None):
300-
tool_name = getattr(message_obj, "tool_calls")[0]["name"]
299+
tool_calls = getattr(message_obj, "tool_calls", None)
300+
if message_obj and tool_calls:
301+
tool_name = tool_calls[0]["name"]
301302
desc = f"🛠️ Using tool: {tool_name}"
302303
kind = "tool"
303304
data = {"tools": [tool_name]}

openchatbi/text2sql/data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
sql_example_retriever, sql_example_dicts, sql_example_vector_db = _init_sql_example_retriever(
2222
_catalog_store, config.get().vector_db_path
2323
)
24-
learned_sql_store: LearnedSQLStore | None = LearnedSQLStore(sql_example_vector_db, sql_example_dicts, threading.Lock())
24+
learned_sql_store: LearnedSQLStore | None = LearnedSQLStore(
25+
sql_example_vector_db, sql_example_dicts, threading.Lock()
26+
)
2527
table_selection_retriever, table_selection_example_dict = _init_table_selection_example_dict(
2628
_catalog_store, config.get().vector_db_path
2729
)

openchatbi/tool/memory.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,7 @@ def tool_call_schema(self) -> Any:
200200
return tcs
201201

202202

203-
def get_memory_tools(
204-
llm: BaseChatModel, sync_mode: bool = False, store: Any | None = None
205-
) -> list[BaseTool] | None:
203+
def get_memory_tools(llm: BaseChatModel, sync_mode: bool = False, store: Any | None = None) -> list[BaseTool] | None:
206204
# Get the appropriate store based on mode
207205
if not store:
208206
if sync_mode:

0 commit comments

Comments
 (0)