File tree 1 file changed +15
-0
lines changed
packages/ragbits-document-search/src/ragbits/document_search/documents
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 3
3
from pathlib import Path
4
4
from typing import Annotated , Any
5
5
6
+ from deprecated import deprecated
6
7
from pydantic import BaseModel
7
8
8
9
from ragbits .core .sources .base import Source , SourceDiscriminator
@@ -75,6 +76,20 @@ async def fetch(self) -> "Document":
75
76
local_path = await self .source .fetch ()
76
77
return Document .from_document_meta (self , local_path )
77
78
79
+ @classmethod
80
+ @deprecated (reason = "Use from_literal() instead" , version = "1.1" )
81
+ def create_text_document_from_literal (cls , content : str ) -> "DocumentMeta" :
82
+ """
83
+ Create a text document from a literal content. This method is deprecated, use from_literal() instead.
84
+
85
+ Args:
86
+ content: The content of the document.
87
+
88
+ Returns:
89
+ The document metadata.
90
+ """
91
+ return cls .from_literal (content )
92
+
78
93
@classmethod
79
94
def from_literal (cls , content : str ) -> "DocumentMeta" :
80
95
"""
You can’t perform that action at this time.
0 commit comments