#1128 | Remove deprecated type hints from typing module (#1131)

This commit is contained in:
Sandra Serrano
2024-01-09 18:35:24 +01:00
committed by GitHub
parent c9df7a2020
commit 0de9491c61
41 changed files with 272 additions and 267 deletions

View File

@@ -2,7 +2,7 @@ import json
import logging
import sqlite3
import uuid
from typing import Any, Dict, List, Optional
from typing import Any, Optional
from embedchain.constants import SQLITE_PATH
from embedchain.memory.message import ChatMessage
@@ -67,7 +67,7 @@ class ChatHistory:
self.cursor.execute(DELETE_CHAT_HISTORY_QUERY, (app_id, session_id))
self.connection.commit()
def get(self, app_id, session_id, num_rounds=10, display_format=False) -> List[ChatMessage]:
def get(self, app_id, session_id, num_rounds=10, display_format=False) -> list[ChatMessage]:
"""
Get the most recent num_rounds rounds of conversations
between human and AI, for a given app_id.
@@ -114,7 +114,7 @@ class ChatHistory:
return count
@staticmethod
def _serialize_json(metadata: Dict[str, Any]):
def _serialize_json(metadata: dict[str, Any]):
return json.dumps(metadata)
@staticmethod