DoctranQATransformer#
- class langchain_community.document_transformers.doctran_text_qa.DoctranQATransformer(openai_api_key: str | None = None, openai_api_model: str | None = None)[来源]#
使用doctran从文本文档中提取问答。
- Parameters:
openai_api_key (str | None) – OpenAI API 密钥。也可以通过环境变量
OPENAI_API_KEY
指定。openai_api_model (str | None)
示例
from langchain_community.document_transformers import DoctranQATransformer # Pass in openai_api_key or set env var OPENAI_API_KEY qa_transformer = DoctranQATransformer() transformed_document = await qa_transformer.atransform_documents(documents)
方法
__init__
([openai_api_key, openai_api_model])atransform_documents
(documents, **kwargs)异步转换文档列表。
transform_documents
(documents, **kwargs)使用doctran从文本文档中提取问答。
- __init__(openai_api_key: str | None = None, openai_api_model: str | None = None) None [来源]#
- Parameters:
openai_api_key (str | None)
openai_api_model (str | None)
- Return type:
无
使用 DoctranQATransformer 的示例