Move Document and other interface into base/schema (#69)

This commit is contained in:
Nguyen Trung Duc (john)
2023-11-14 11:51:10 +07:00
committed by GitHub
parent 4704e2c11a
commit 8532138842
34 changed files with 51 additions and 63 deletions

View File

@@ -1,7 +1,7 @@
import pytest
from kotaemon.base import Document
from kotaemon.docstores import InMemoryDocumentStore
from kotaemon.documents.base import Document
def test_simple_document_store_base_interfaces(tmp_path):

View File

@@ -1,4 +1,4 @@
from kotaemon.documents.base import Document, RetrievedDocument
from kotaemon.base.schema import Document, RetrievedDocument
from .conftest import skip_when_haystack_not_installed

View File

@@ -5,8 +5,8 @@ from typing import cast
import pytest
from openai.resources.embeddings import Embeddings
from kotaemon.base import Document
from kotaemon.docstores import InMemoryDocumentStore
from kotaemon.documents.base import Document
from kotaemon.embeddings.openai import AzureOpenAIEmbeddings
from kotaemon.pipelines.indexing import IndexVectorStoreFromDocumentPipeline
from kotaemon.pipelines.retrieving import RetrieveDocumentFromVectorStorePipeline

View File

@@ -4,7 +4,7 @@ from langchain.chat_models import AzureChatOpenAI as AzureChatOpenAILC
from langchain.schema.messages import AIMessage, HumanMessage, SystemMessage
from openai.types.chat.chat_completion import ChatCompletion
from kotaemon.llms.base import LLMInterface
from kotaemon.base.schema import LLMInterface
from kotaemon.llms.chats.openai import AzureChatOpenAI
_openai_chat_completion_response = ChatCompletion.parse_obj(

View File

@@ -4,7 +4,7 @@ from langchain.llms import AzureOpenAI as AzureOpenAILC
from langchain.llms import OpenAI as OpenAILC
from openai.types.completion import Completion
from kotaemon.llms.base import LLMInterface
from kotaemon.base.schema import LLMInterface
from kotaemon.llms.completions.openai import AzureOpenAI, OpenAI
_openai_completion_response = Completion.parse_obj(

View File

@@ -1,6 +1,6 @@
import pytest
from kotaemon.documents.base import Document
from kotaemon.base import Document
from kotaemon.post_processing.extractor import RegexExtractor

View File

@@ -1,6 +1,6 @@
import pytest
from kotaemon.documents.base import Document
from kotaemon.base import Document
from kotaemon.post_processing.extractor import RegexExtractor
from kotaemon.prompt.base import BasePromptComponent
from kotaemon.prompt.template import PromptTemplate

View File

@@ -3,7 +3,7 @@ from pathlib import Path
from langchain.schema import Document as LangchainDocument
from llama_index.node_parser import SimpleNodeParser
from kotaemon.documents.base import Document
from kotaemon.base import Document
from kotaemon.loaders import AutoReader

View File

@@ -4,8 +4,8 @@ from pathlib import Path
import pytest
from openai.resources.embeddings import Embeddings
from kotaemon.base import Document
from kotaemon.docstores import InMemoryDocumentStore
from kotaemon.documents.base import Document
from kotaemon.embeddings.openai import AzureOpenAIEmbeddings
from kotaemon.pipelines.indexing import IndexVectorStoreFromDocumentPipeline
from kotaemon.pipelines.retrieving import RetrieveDocumentFromVectorStorePipeline

View File

@@ -1,6 +1,6 @@
import json
from kotaemon.documents.base import Document
from kotaemon.base import Document
from kotaemon.vectorstores import ChromaVectorStore, InMemoryVectorStore