Browse Source

replace Tuple with tuple

Michael Poluektov 8 months ago
parent
commit
0470146d7b
3 changed files with 4 additions and 4 deletions
  1. 1 1
      backend/apps/ollama/main.py
  2. 2 2
      backend/utils/misc.py
  3. 1 1
      backend/utils/tools.py

+ 1 - 1
backend/apps/ollama/main.py

@@ -21,7 +21,7 @@ import asyncio
 import logging
 import time
 from urllib.parse import urlparse
-from typing import Optional, List, Union
+from typing import Optional, Union
 
 from starlette.background import BackgroundTask
 

+ 2 - 2
backend/utils/misc.py

@@ -2,7 +2,7 @@ from pathlib import Path
 import hashlib
 import re
 from datetime import timedelta
-from typing import Optional, List, Tuple, Callable
+from typing import Optional, Callable
 import uuid
 import time
 
@@ -52,7 +52,7 @@ def remove_system_message(messages: list[dict]) -> list[dict]:
     return [message for message in messages if message["role"] != "system"]
 
 
-def pop_system_message(messages: list[dict]) -> Tuple[Optional[dict], list[dict]]:
+def pop_system_message(messages: list[dict]) -> tuple[Optional[dict], list[dict]]:
     return get_system_message(messages), remove_system_message(messages)
 
 

+ 1 - 1
backend/utils/tools.py

@@ -1,5 +1,5 @@
 import inspect
-from typing import get_type_hints, List, Dict, Any
+from typing import get_type_hints
 
 
 def doc_to_dict(docstring):