mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-24 05:50:18 +00:00
x
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import uuid
|
||||
from typing import Any, Dict, List, Optional, Sequence
|
||||
from typing import Any, Dict, List, Optional, Sequence, cast
|
||||
|
||||
from langchain_core.documents import Document
|
||||
from langchain_core.indexing import UpsertResponse
|
||||
@@ -31,7 +31,7 @@ class InMemoryDocumentIndexer(DocumentIndexer):
|
||||
id_ = item.id
|
||||
|
||||
self.store[id_] = item_
|
||||
ok_ids.append(item_.id)
|
||||
ok_ids.append(cast(str, item_.id))
|
||||
|
||||
return UpsertResponse(succeeded=ok_ids, failed=[])
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ from abc import ABC, abstractmethod
|
||||
from typing import AsyncGenerator, Generator
|
||||
|
||||
import pytest
|
||||
|
||||
from langchain_core.documents import Document
|
||||
from langchain_core.indexing import DocumentIndexer
|
||||
from langchain_core.indexing import DocumentIndexer, AsyncDocumentIndexer
|
||||
|
||||
|
||||
class DocumentIndexerTestSuite(ABC):
|
||||
@@ -211,7 +212,7 @@ class AsyncDocumentIndexerTestSuite(ABC):
|
||||
|
||||
@abstractmethod
|
||||
@pytest.fixture
|
||||
async def indexer(self) -> AsyncGenerator[DocumentIndexer, None]:
|
||||
async def indexer(self) -> AsyncGenerator[AsyncDocumentIndexer, None]:
|
||||
"""Get the indexer."""
|
||||
|
||||
async def test_upsert_documents_has_no_ids(self, indexer: DocumentIndexer) -> None:
|
||||
|
||||
Reference in New Issue
Block a user