Skip to content

Commit d717381

Browse files
committed
fix linter failures
1 parent 1793551 commit d717381

File tree

12 files changed

+19
-22
lines changed

12 files changed

+19
-22
lines changed

backend/app/api/assistants.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ async def delete_assistant(
9494
assistant = await storage.get_assistant(user["user_id"], aid)
9595
if not assistant:
9696
raise HTTPException(status_code=404, detail="Assistant not found")
97-
if not assistant.get('public') and assistant.get('user_id') != user["user_id"]:
98-
raise HTTPException(status_code=403, detail="Unauthorized to delete this assistant")
97+
if not assistant.get("public") and assistant.get("user_id") != user["user_id"]:
98+
raise HTTPException(
99+
status_code=403, detail="Unauthorized to delete this assistant"
100+
)
99101
await storage.delete_assistant(user["user_id"], aid)
100102
return {"status": "ok"}

backend/app/auth/handlers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ async def __call__(self, request: Request) -> User:
4141
return user
4242

4343
@abstractmethod
44-
def decode_token(self, token: str, decode_key: str) -> dict:
45-
...
44+
def decode_token(self, token: str, decode_key: str) -> dict: ...
4645

4746
@abstractmethod
48-
def get_decode_key(self, token: str) -> str:
49-
...
47+
def get_decode_key(self, token: str) -> str: ...
5048

5149

5250
class JWTAuthLocal(JWTAuthBase):

backend/app/auth/settings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def set_decode_key(cls, v, values):
3939
return b64decode(values["decode_key_b64"]).decode("utf-8")
4040

4141

42-
class JWTSettingsOIDC(JWTSettingsBase):
43-
...
42+
class JWTSettingsOIDC(JWTSettingsBase): ...
4443

4544

4645
class Settings(BaseSettings):

backend/app/chatbot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from typing import Annotated, List
22

3-
from app.message_types import add_messages_liberal
43
from langchain_core.language_models.base import LanguageModelLike
54
from langchain_core.messages import BaseMessage, SystemMessage
65
from langgraph.checkpoint import BaseCheckpointSaver
76
from langgraph.graph.state import StateGraph
87

8+
from app.message_types import add_messages_liberal
9+
910

1011
def get_chatbot_executor(
1112
llm: LanguageModelLike,

backend/app/ingest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
This code should be agnostic to how the blob got generated; i.e., it does not
77
know about server/uploading etc.
88
"""
9+
910
from typing import List
1011

1112
from langchain.text_splitter import TextSplitter

backend/app/message_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
MessageLikeRepresentation,
77
ToolMessage,
88
)
9-
from langgraph.graph.message import add_messages, Messages
9+
from langgraph.graph.message import Messages, add_messages
1010

1111

1212
class LiberalFunctionMessage(FunctionMessage):
@@ -18,7 +18,7 @@ class LiberalToolMessage(ToolMessage):
1818

1919

2020
def _convert_pydantic_dict_to_message(
21-
data: MessageLikeRepresentation
21+
data: MessageLikeRepresentation,
2222
) -> MessageLikeRepresentation:
2323
if (
2424
isinstance(data, dict)

backend/app/parsing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module contains logic for parsing binary blobs into text."""
2+
23
from langchain_community.document_loaders.parsers import BS4HTMLParser, PDFMinerParser
34
from langchain_community.document_loaders.parsers.generic import MimeTypeBasedParser
45
from langchain_community.document_loaders.parsers.msword import MsWordParser

backend/app/storage.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,10 @@ async def delete_thread(user_id: str, thread_id: str):
212212

213213

214214
async def delete_assistant(user_id: str, assistant_id: str):
215-
"""Delete an assistant by ID.
216-
217-
Args:
218-
user_id: The user's ID.
219-
assistant_id: The assistant's ID.
220-
221-
"""
215+
"""Delete an assistant by ID."""
222216
async with get_pg_pool().acquire() as conn:
223217
await conn.execute(
224218
"DELETE FROM assistant WHERE assistant_id = $1 AND user_id = $2",
225219
assistant_id,
226220
user_id,
227-
)
221+
)

backend/app/tools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ class AvailableTools(str, Enum):
6060
DALL_E = "dall_e"
6161

6262

63-
class ToolConfig(TypedDict):
64-
...
63+
class ToolConfig(TypedDict): ...
6564

6665

6766
class BaseTool(BaseModel):

backend/app/upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import os
1313
from typing import BinaryIO, List, Optional
1414

15-
from langchain_core.document_loaders.blob_loaders import Blob
1615
from langchain_community.vectorstores.pgvector import PGVector
16+
from langchain_core.document_loaders.blob_loaders import Blob
1717
from langchain_core.runnables import (
1818
ConfigurableField,
1919
RunnableConfig,

backend/tests/unit_tests/agent_executor/test_parsing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test parsing logic."""
2+
23
import mimetypes
34

45
from langchain_community.document_loaders import Blob

backend/tests/unit_tests/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test ingestion utilities."""
2+
23
from typing import Any, Dict, Iterable, List, Optional, Sequence, Type
34

45
from langchain.schema import Document

0 commit comments

Comments
 (0)