mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
from typing import List, Optional
|
|
|
|
from semantic_kernel.memory.memory_query_result import MemoryQueryResult
|
|
from semantic_kernel.memory.semantic_text_memory_base import SemanticTextMemoryBase
|
|
|
|
|
|
class NullMemory(SemanticTextMemoryBase):
|
|
async def save_information_async(
|
|
self, collection: str, text: str, id: str, description: Optional[str] = None
|
|
) -> None:
|
|
return None
|
|
|
|
async def save_reference_async(
|
|
self,
|
|
collection: str,
|
|
text: str,
|
|
external_id: str,
|
|
external_source_name: str,
|
|
description: Optional[str] = None,
|
|
) -> None:
|
|
return None
|
|
|
|
async def get_async(
|
|
self, collection: str, query: str
|
|
) -> Optional[MemoryQueryResult]:
|
|
return None
|
|
|
|
async def search_async(
|
|
self,
|
|
collection: str,
|
|
query: str,
|
|
limit: int = 1,
|
|
min_relevance_score: float = 0.7,
|
|
) -> List[MemoryQueryResult]:
|
|
return []
|
|
|
|
async def get_collections_async(self) -> List[str]:
|
|
return []
|
|
|
|
|
|
NullMemory.instance = NullMemory() # type: ignore
|