mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-28 09:28:48 +00:00
docs: Fix diffbot graph transformer description (#18736)
The previous docstring was invalid
This commit is contained in:
parent
b8922480ed
commit
010a234f1e
@ -123,24 +123,15 @@ class DiffbotGraphTransformer:
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
from langchain_experimental.graph_transformers import DiffbotGraphTransformer
|
||||||
|
from langchain_core.documents import Document
|
||||||
|
|
||||||
class DiffbotGraphTransformer(BaseGraphDocumentTransformer):
|
diffbot_api_key = "DIFFBOT_API_KEY"
|
||||||
|
diffbot_nlp = DiffbotGraphTransformer(diffbot_api_key=diffbot_api_key)
|
||||||
|
|
||||||
def transform_documents(
|
document = Document(page_content="Mike Tunge is the CEO of Diffbot.")
|
||||||
self, documents: Sequence[Document], **kwargs: Any
|
graph_documents = diffbot_nlp.convert_to_graph_documents([document])
|
||||||
) -> Sequence[GraphDocument]:
|
|
||||||
results = []
|
|
||||||
|
|
||||||
for document in documents:
|
|
||||||
raw_results = self.nlp_request(document.page_content)
|
|
||||||
graph_document = self.process_response(raw_results, document)
|
|
||||||
results.append(graph_document)
|
|
||||||
return results
|
|
||||||
|
|
||||||
async def atransform_documents(
|
|
||||||
self, documents: Sequence[Document], **kwargs: Any
|
|
||||||
) -> Sequence[Document]:
|
|
||||||
raise NotImplementedError
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
Loading…
Reference in New Issue
Block a user