Skip to content

Commit b756787

Browse files
committed
add deprecation notice
1 parent 535e20f commit b756787

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

packages/ragbits-document-search/src/ragbits/document_search/documents/document.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pathlib import Path
44
from typing import Annotated, Any
55

6+
from deprecated import deprecated
67
from pydantic import BaseModel
78

89
from ragbits.core.sources.base import Source, SourceDiscriminator
@@ -75,6 +76,20 @@ async def fetch(self) -> "Document":
7576
local_path = await self.source.fetch()
7677
return Document.from_document_meta(self, local_path)
7778

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+
7893
@classmethod
7994
def from_literal(cls, content: str) -> "DocumentMeta":
8095
"""

0 commit comments

Comments
 (0)