id stringlengths 14 15 | text stringlengths 44 2.47k | source stringlengths 61 181 |
|---|---|---|
80eec098ac40-0 | langchain.document_loaders.trello.TrelloLoader¶
class langchain.document_loaders.trello.TrelloLoader(client: TrelloClient, board_name: str, *, include_card_name: bool = True, include_comments: bool = True, include_checklist: bool = True, card_filter: Literal['closed', 'open', 'all'] = 'all', extra_metadata: Tuple[str, ... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.trello.TrelloLoader.html |
80eec098ac40-1 | load_and_split([text_splitter])
Load Documents and split into chunks.
__init__(client: TrelloClient, board_name: str, *, include_card_name: bool = True, include_comments: bool = True, include_checklist: bool = True, card_filter: Literal['closed', 'open', 'all'] = 'all', extra_metadata: Tuple[str, ...] = ('due_date', 'l... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.trello.TrelloLoader.html |
80eec098ac40-2 | include_checklist – Whether to include the checklist on the card in the
document.
card_filter – Filter on card status. Valid values are “closed”, “open”,
“all”.
extra_metadata – List of additional metadata fields to include as document
metadata.Valid values are “due_date”, “labels”, “list”, “closed”.
lazy_load() → Iter... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.trello.TrelloLoader.html |
574ea27ba87a-0 | langchain.document_loaders.telegram.concatenate_rows¶
langchain.document_loaders.telegram.concatenate_rows(row: dict) → str[source]¶
Combine message information in a readable format ready to be used. | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.telegram.concatenate_rows.html |
0212e777b96e-0 | langchain.document_loaders.concurrent.ConcurrentLoader¶
class langchain.document_loaders.concurrent.ConcurrentLoader(blob_loader: BlobLoader, blob_parser: BaseBlobParser, num_workers: int = 4)[source]¶
Load and pars Documents concurrently.
A generic document loader.
Parameters
blob_loader – A blob loader which knows ho... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.concurrent.ConcurrentLoader.html |
0212e777b96e-1 | matching the glob will be loaded.
exclude – A list of patterns to exclude from the loader.
show_progress – Whether to show a progress bar or not (requires tqdm).
Proxies to the file system loader.
parser – A blob parser which knows how to parse blobs into documents
num_workers – Max number of concurrent workers to use.... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.concurrent.ConcurrentLoader.html |
199f3e2e6ba2-0 | langchain.document_loaders.notebook.concatenate_cells¶
langchain.document_loaders.notebook.concatenate_cells(cell: dict, include_outputs: bool, max_output_length: int, traceback: bool) → str[source]¶
Combine cells information in a readable format ready to be used.
Parameters
cell – A dictionary
include_outputs – Whethe... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.notebook.concatenate_cells.html |
8104d3d08270-0 | langchain.document_loaders.base_o365.fetch_mime_types¶
langchain.document_loaders.base_o365.fetch_mime_types(file_types: Sequence[_FileType]) → Dict[str, str][source]¶ | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.base_o365.fetch_mime_types.html |
d348f5e33428-0 | langchain.document_loaders.geodataframe.GeoDataFrameLoader¶
class langchain.document_loaders.geodataframe.GeoDataFrameLoader(data_frame: Any, page_content_column: str = 'geometry')[source]¶
Load geopandas Dataframe.
Initialize with geopandas Dataframe.
Parameters
data_frame – geopandas DataFrame object.
page_content_co... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.geodataframe.GeoDataFrameLoader.html |
b47ba1774c13-0 | langchain.document_loaders.blob_loaders.file_system.FileSystemBlobLoader¶
class langchain.document_loaders.blob_loaders.file_system.FileSystemBlobLoader(path: Union[str, Path], *, glob: str = '**/[!.]*', exclude: Sequence[str] = (), suffixes: Optional[Sequence[str]] = None, show_progress: bool = False)[source]¶
Load bl... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.blob_loaders.file_system.FileSystemBlobLoader.html |
b47ba1774c13-1 | "/path/to/directory",
glob="**/*.txt",
exclude=["**/*.py", "**/*.pyc"]
)
Methods
__init__(path, *[, glob, exclude, suffixes, ...])
Initialize with a path to directory and how to glob over it.
count_matching_files()
Count files that match the pattern without loading them.
yield_blobs()
Yield blobs that match the... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.blob_loaders.file_system.FileSystemBlobLoader.html |
b47ba1774c13-2 | # Recursively load all files in a directory, except for py or pyc files.
loader = FileSystemBlobLoader(
"/path/to/directory",
glob="**/*.txt",
exclude=["**/*.py", "**/*.pyc"]
)
count_matching_files() → int[source]¶
Count files that match the pattern without loading them.
yield_blobs() → Iterable[Blob][sourc... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.blob_loaders.file_system.FileSystemBlobLoader.html |
216e2212551e-0 | langchain.document_loaders.figma.FigmaFileLoader¶
class langchain.document_loaders.figma.FigmaFileLoader(access_token: str, ids: str, key: str)[source]¶
Load Figma file.
Initialize with access token, ids, and key.
Parameters
access_token – The access token for the Figma REST API.
ids – The ids of the Figma file.
key – ... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.figma.FigmaFileLoader.html |
df001f38a1df-0 | langchain.document_loaders.blackboard.BlackboardLoader¶
class langchain.document_loaders.blackboard.BlackboardLoader(blackboard_course_url: str, bbrouter: str, load_all_recursively: bool = True, basic_auth: Optional[Tuple[str, str]] = None, cookies: Optional[dict] = None, continue_on_failure: bool = False)[source]¶
Loa... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.blackboard.BlackboardLoader.html |
df001f38a1df-1 | Methods
__init__(blackboard_course_url, bbrouter[, ...])
Initialize with blackboard course url.
aload()
Load text from the urls in web_path async into Documents.
check_bs4()
Check if BeautifulSoup4 is installed.
download(path)
Download a file from an url.
fetch_all(urls)
Fetch all urls concurrently with rate limiting.
... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.blackboard.BlackboardLoader.html |
df001f38a1df-2 | aload() → List[Document]¶
Load text from the urls in web_path async into Documents.
check_bs4() → None[source]¶
Check if BeautifulSoup4 is installed.
Raises
ImportError – If BeautifulSoup4 is not installed.
download(path: str) → None[source]¶
Download a file from an url.
Parameters
path – Path to the file.
async fetch_... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.blackboard.BlackboardLoader.html |
3a952b42cc3a-0 | langchain.document_loaders.async_html.AsyncHtmlLoader¶
class langchain.document_loaders.async_html.AsyncHtmlLoader(web_path: Union[str, List[str]], header_template: Optional[dict] = None, verify_ssl: Optional[bool] = True, proxies: Optional[dict] = None, requests_per_second: int = 2, requests_kwargs: Optional[Dict[str,... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.async_html.AsyncHtmlLoader.html |
3a952b42cc3a-1 | Parameters
text_splitter – TextSplitter instance to use for splitting documents.
Defaults to RecursiveCharacterTextSplitter.
Returns
List of Documents.
Examples using AsyncHtmlLoader¶
html2text
AsyncHtmlLoader
Set env var OPENAI_API_KEY or load from a .env file: | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.async_html.AsyncHtmlLoader.html |
033f805cf1f5-0 | langchain.document_loaders.airtable.AirtableLoader¶
class langchain.document_loaders.airtable.AirtableLoader(api_token: str, table_id: str, base_id: str)[source]¶
Load the Airtable tables.
Initialize with API token and the IDs for table and base
Attributes
api_token
Airtable API token.
table_id
Airtable table ID.
base_... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.airtable.AirtableLoader.html |
509d5b0997e0-0 | langchain.document_loaders.telegram.TelegramChatFileLoader¶
class langchain.document_loaders.telegram.TelegramChatFileLoader(path: str)[source]¶
Load from Telegram chat dump.
Initialize with a path.
Methods
__init__(path)
Initialize with a path.
lazy_load()
A lazy loader for Documents.
load()
Load documents.
load_and_s... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.telegram.TelegramChatFileLoader.html |
ec7629de3adc-0 | langchain.document_loaders.unstructured.UnstructuredFileIOLoader¶
class langchain.document_loaders.unstructured.UnstructuredFileIOLoader(file: Union[IO, Sequence[IO]], mode: str = 'single', **unstructured_kwargs: Any)[source]¶
Load files using Unstructured.
The file loader
uses the unstructured partition function and w... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.unstructured.UnstructuredFileIOLoader.html |
ec7629de3adc-1 | Load Documents and split into chunks. Chunks are returned as Documents.
Parameters
text_splitter – TextSplitter instance to use for splitting documents.
Defaults to RecursiveCharacterTextSplitter.
Returns
List of Documents.
Examples using UnstructuredFileIOLoader¶
Google Drive | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.unstructured.UnstructuredFileIOLoader.html |
bfeb61a71f6d-0 | langchain.document_loaders.github.BaseGitHubLoader¶
class langchain.document_loaders.github.BaseGitHubLoader[source]¶
Bases: BaseLoader, BaseModel, ABC
Load GitHub repository Issues.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.github.BaseGitHubLoader.html |
bfeb61a71f6d-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.github.BaseGitHubLoader.html |
bfeb61a71f6d-2 | Defaults to RecursiveCharacterTextSplitter.
Returns
List of Documents.
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, byt... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.github.BaseGitHubLoader.html |
9606818da6aa-0 | langchain.document_loaders.pdf.OnlinePDFLoader¶
class langchain.document_loaders.pdf.OnlinePDFLoader(file_path: str, *, headers: Optional[Dict] = None)[source]¶
Load online PDF.
Initialize with a file path.
Parameters
file_path – Either a local, S3 or web path to a PDF file.
headers – Headers to use for GET request to ... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.pdf.OnlinePDFLoader.html |
68b60d7bcb51-0 | langchain.document_loaders.open_city_data.OpenCityDataLoader¶
class langchain.document_loaders.open_city_data.OpenCityDataLoader(city_id: str, dataset_id: str, limit: int)[source]¶
Load from Open City.
Initialize with dataset_id.
Example: https://dev.socrata.com/foundry/data.sfgov.org/vw6y-z8j6
e.g., city_id = data.sfg... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.open_city_data.OpenCityDataLoader.html |
68b60d7bcb51-1 | Parameters
text_splitter – TextSplitter instance to use for splitting documents.
Defaults to RecursiveCharacterTextSplitter.
Returns
List of Documents.
Examples using OpenCityDataLoader¶
Geopandas
Open City Data | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.open_city_data.OpenCityDataLoader.html |
381d323805a9-0 | langchain.document_loaders.xml.UnstructuredXMLLoader¶
class langchain.document_loaders.xml.UnstructuredXMLLoader(file_path: str, mode: str = 'single', **unstructured_kwargs: Any)[source]¶
Load XML file using Unstructured.
You can run the loader in one of two modes: “single” and “elements”.
If you use “single” mode, the... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.xml.UnstructuredXMLLoader.html |
3aee14822f6c-0 | langchain.document_loaders.modern_treasury.ModernTreasuryLoader¶
class langchain.document_loaders.modern_treasury.ModernTreasuryLoader(resource: str, organization_id: Optional[str] = None, api_key: Optional[str] = None)[source]¶
Load from Modern Treasury.
Parameters
resource – The Modern Treasury resource to load.
orga... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.modern_treasury.ModernTreasuryLoader.html |
3aee14822f6c-1 | Parameters
text_splitter – TextSplitter instance to use for splitting documents.
Defaults to RecursiveCharacterTextSplitter.
Returns
List of Documents.
Examples using ModernTreasuryLoader¶
Modern Treasury | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.modern_treasury.ModernTreasuryLoader.html |
bf8b264d5f84-0 | langchain.document_loaders.bigquery.BigQueryLoader¶
class langchain.document_loaders.bigquery.BigQueryLoader(query: str, project: Optional[str] = None, page_content_columns: Optional[List[str]] = None, metadata_columns: Optional[List[str]] = None, credentials: Optional[Credentials] = None)[source]¶
Load from the Google... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.bigquery.BigQueryLoader.html |
bf8b264d5f84-1 | Initialize BigQuery document loader.
Parameters
query – The query to run in BigQuery.
project – Optional. The project to run the query in.
page_content_columns – Optional. The columns to write into the page_content
of the document.
metadata_columns – Optional. The columns to write into the metadata of the
document.
cre... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.bigquery.BigQueryLoader.html |
bb20c8b8abe0-0 | langchain.document_loaders.airbyte.AirbyteTypeformLoader¶
class langchain.document_loaders.airbyte.AirbyteTypeformLoader(config: Mapping[str, Any], stream_name: str, record_handler: Optional[Callable[[Any, Optional[str]], Document]] = None, state: Optional[Any] = None)[source]¶
Load from Typeform using an Airbyte sourc... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.airbyte.AirbyteTypeformLoader.html |
bb20c8b8abe0-1 | load() → List[Document]¶
Load data into Document objects.
load_and_split(text_splitter: Optional[TextSplitter] = None) → List[Document]¶
Load Documents and split into chunks. Chunks are returned as Documents.
Parameters
text_splitter – TextSplitter instance to use for splitting documents.
Defaults to RecursiveCharacter... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.airbyte.AirbyteTypeformLoader.html |
ddecfcf66911-0 | langchain.document_loaders.youtube.GoogleApiClient¶
class langchain.document_loaders.youtube.GoogleApiClient(credentials_path: Path = PosixPath('/home/docs/.credentials/credentials.json'), service_account_path: Path = PosixPath('/home/docs/.credentials/credentials.json'), token_path: Path = PosixPath('/home/docs/.crede... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.youtube.GoogleApiClient.html |
36a2d2ba40a2-0 | langchain.document_loaders.pdf.MathpixPDFLoader¶
class langchain.document_loaders.pdf.MathpixPDFLoader(file_path: str, processed_file_format: str = 'md', max_wait_time_seconds: int = 500, should_clean_pdf: bool = False, **kwargs: Any)[source]¶
Load PDF files using Mathpix service.
Initialize with a file path.
Parameter... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.pdf.MathpixPDFLoader.html |
36a2d2ba40a2-1 | **kwargs – additional keyword arguments.
clean_pdf(contents: str) → str[source]¶
Clean the PDF file.
Parameters
contents – a PDF file contents.
Returns:
get_processed_pdf(pdf_id: str) → str[source]¶
lazy_load() → Iterator[Document]¶
A lazy loader for Documents.
load() → List[Document][source]¶
Load data into Document o... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.pdf.MathpixPDFLoader.html |
b3ac0941792d-0 | langchain.document_loaders.parsers.pdf.PDFMinerParser¶
class langchain.document_loaders.parsers.pdf.PDFMinerParser[source]¶
Parse PDF using PDFMiner.
Methods
__init__()
lazy_parse(blob)
Lazily parse the blob.
parse(blob)
Eagerly parse the blob into a document or documents.
__init__()¶
lazy_parse(blob: Blob) → Iterator[... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.parsers.pdf.PDFMinerParser.html |
c26b7bd75883-0 | langchain.document_loaders.airbyte.AirbyteSalesforceLoader¶
class langchain.document_loaders.airbyte.AirbyteSalesforceLoader(config: Mapping[str, Any], stream_name: str, record_handler: Optional[Callable[[Any, Optional[str]], Document]] = None, state: Optional[Any] = None)[source]¶
Load from Salesforce using an Airbyte... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.airbyte.AirbyteSalesforceLoader.html |
c26b7bd75883-1 | load() → List[Document]¶
Load data into Document objects.
load_and_split(text_splitter: Optional[TextSplitter] = None) → List[Document]¶
Load Documents and split into chunks. Chunks are returned as Documents.
Parameters
text_splitter – TextSplitter instance to use for splitting documents.
Defaults to RecursiveCharacter... | https://api.python.langchain.com/en/latest/document_loaders/langchain.document_loaders.airbyte.AirbyteSalesforceLoader.html |
b78f907b88cc-0 | langchain.smith.evaluation.string_run_evaluator.StringExampleMapper¶
class langchain.smith.evaluation.string_run_evaluator.StringExampleMapper[source]¶
Bases: Serializable
Map an example, or row in the dataset, to the inputs of an evaluation.
Create a new model by parsing and validating input data from keyword argument... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringExampleMapper.html |
b78f907b88cc-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringExampleMapper.html |
b78f907b88cc-2 | The unique identifier is a list of strings that describes the path
to the object.
map(example: Example) → Dict[str, str][source]¶
Maps the Example, or dataset row to a dictionary.
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pi... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringExampleMapper.html |
c3e3f94a0f50-0 | langchain.smith.evaluation.runner_utils.InputFormatError¶
class langchain.smith.evaluation.runner_utils.InputFormatError[source]¶
Raised when the input format is invalid. | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.runner_utils.InputFormatError.html |
b31f5bb2e7a3-0 | langchain.smith.evaluation.config.RunEvalConfig¶
class langchain.smith.evaluation.config.RunEvalConfig[source]¶
Bases: BaseModel
Configuration for a run evaluation.
Parameters
evaluators (List[Union[EvaluatorType, EvalConfig]]) – Configurations for which evaluators to apply to the dataset run.
Each can be the string of... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-1 | The language model to pass to any evaluators that require one.
param evaluators: List[Union[langchain.evaluation.schema.EvaluatorType, str, langchain.smith.evaluation.config.EvalConfig]] [Optional]¶
Configurations for which evaluators to apply to the dataset run.
Each can be the string of an
EvaluatorType, such
as Eval... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-2 | param prompt: Optional[langchain.schema.prompt_template.BasePromptTemplate] = None¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is per... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-3 | Get the keyword arguments for the load_evaluator call.
Returns
The keyword arguments for the load_evaluator call.
Return type
Dict[str, Any]
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_de... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-4 | class ContextQA[source]¶
Bases: EvalConfig
Configuration for a context-based QA evaluator.
Parameters
prompt (Optional[BasePromptTemplate]) – The prompt template to use for generating the question.
llm (Optional[BaseLanguageModel]) – The language model to use for the evaluation chain.
Create a new model by parsing and ... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-5 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-6 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-7 | Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-8 | The keyword arguments for the load_evaluator call.
Return type
Dict[str, Any]
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exc... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-9 | Bases: EvalConfig
Configuration for an embedding distance evaluator.
Parameters
embeddings (Optional[Embeddings]) – The embeddings to use for computing the distance.
distance_metric (Optional[EmbeddingDistanceEnum]) – The distance metric to use for computing the distance.
Create a new model by parsing and validating in... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-10 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-11 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-12 | Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-13 | The keyword arguments for the load_evaluator call.
Return type
Dict[str, Any]
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exc... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-14 | Bases: EvalConfig
Configuration for a json equality evaluator.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param evaluator_type: langchain.evaluation.schema.EvaluatorType = EvaluatorType.JSON_EQUALITY¶
c... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-15 | Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
classmethod from_orm(obj: Any) → Model¶
get_kwargs() → Dict[str, Any]¶
Get the keyword arguments for the load_evaluator call.
Returns
The keyword arguments for the load_evaluator call.
Return type
Dict[str, Any]... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-16 | classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶
class JsonValidity[source]¶
Bases: EvalConfig
Configuration for a json validity evaluator.
Create a new model by parsing and validating input d... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-17 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-18 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-19 | Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-20 | The keyword arguments for the load_evaluator call.
Return type
Dict[str, Any]
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exc... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-21 | Bases: EvalConfig
Configuration for a QA evaluator.
Parameters
prompt (Optional[BasePromptTemplate]) – The prompt template to use for generating the question.
llm (Optional[BaseLanguageModel]) – The language model to use for the evaluation chain.
Create a new model by parsing and validating input data from keyword argu... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-22 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-23 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-24 | Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-25 | The keyword arguments for the load_evaluator call.
Return type
Dict[str, Any]
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exc... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-26 | Bases: EvalConfig
Configuration for a string distance evaluator.
Parameters
distance (Optional[StringDistanceEnum]) – The string distance metric to use.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param ... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-27 | exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, i... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-28 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-29 | exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, i... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
b31f5bb2e7a3-30 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.RunEvalConfig.html |
a000e84b1be6-0 | langchain.smith.evaluation.string_run_evaluator.ToolStringRunMapper¶
class langchain.smith.evaluation.string_run_evaluator.ToolStringRunMapper[source]¶
Bases: StringRunMapper
Map an input to the tool.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input dat... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.ToolStringRunMapper.html |
a000e84b1be6-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.ToolStringRunMapper.html |
a000e84b1be6-2 | The unique identifier is a list of strings that describes the path
to the object.
map(run: Run) → Dict[str, str][source]¶
Maps the Run to a dictionary.
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.ToolStringRunMapper.html |
a7d25c33d167-0 | langchain.smith.evaluation.config.EvalConfig¶
class langchain.smith.evaluation.config.EvalConfig[source]¶
Bases: BaseModel
Configuration for a given run evaluator.
Parameters
evaluator_type (EvaluatorType) – The type of evaluator to use.
get_kwargs()[source]¶
Get the keyword arguments for the evaluator configuration.
C... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.EvalConfig.html |
a7d25c33d167-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.EvalConfig.html |
a7d25c33d167-2 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.config.EvalConfig.html |
07a08af9944a-0 | langchain.smith.evaluation.runner_utils.run_on_dataset¶
langchain.smith.evaluation.runner_utils.run_on_dataset(client: Optional[Client], dataset_name: str, llm_or_chain_factory: Union[Callable[[], Union[Chain, Runnable]], BaseLanguageModel, Callable[[dict], Any], Runnable, Chain], *, evaluation: Optional[RunEvalConfig]... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.runner_utils.run_on_dataset.html |
07a08af9944a-1 | Examples
from langsmith import Client
from langchain.chat_models import ChatOpenAI
from langchain.chains import LLMChain
from langchain.smith import smith_eval.RunEvalConfig, run_on_dataset
# Chains may have memory. Passing in a constructor function lets the
# evaluation framework avoid cross-contamination between runs... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.runner_utils.run_on_dataset.html |
07a08af9944a-2 | return {"score": prediction == reference}
evaluation_config = smith_eval.RunEvalConfig(
custom_evaluators = [MyStringEvaluator()],
)
run_on_dataset(
client,
"<my_dataset_name>",
construct_chain,
evaluation=evaluation_config,
)
Examples using run_on_dataset¶
LangSmith Walkthrough | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.runner_utils.run_on_dataset.html |
3f52608c5e0d-0 | langchain.smith.evaluation.runner_utils.TestResult¶
class langchain.smith.evaluation.runner_utils.TestResult[source]¶
A dictionary of the results of a single test run.
Methods
__init__(*args, **kwargs)
clear()
copy()
fromkeys([value])
Create a new dictionary with keys from iterable and values set to value.
get(key[, de... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.runner_utils.TestResult.html |
3f52608c5e0d-1 | Return the value for key if key is in the dictionary, else default.
get_aggregate_feedback(quantiles: Optional[Sequence[float]] = None) → pd.DataFrame[source]¶
Return quantiles for the feedback scores.
This method calculates and prints the quantiles for the feedback scores
across all feedback keys.
Returns
A DataFrame ... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.runner_utils.TestResult.html |
df474acc017e-0 | langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain¶
class langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain[source]¶
Bases: Chain, RunEvaluator
Evaluate Run and optional examples.
Create a new model by parsing and validating input data from keyword arguments.
Raises Validation... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-1 | The name of the evaluation metric.
param run_mapper: StringRunMapper [Required]¶
Maps the Run to a dictionary with ‘input’ and ‘prediction’ strings.
param string_evaluator: StringEvaluator [Required]¶
The evaluation chain.
param tags: Optional[List[str]] = None¶
Optional list of tags associated with the chain. Defaults... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-2 | these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be passed in
addition to tags passed to the chain during construction, but only
these runtime tags will propagate to calls to other objects.
metadata – Optional metadata associated with the ... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-3 | callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be passed in
addition to tags passed to the c... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-4 | with all the inputs
Parameters
*args – If the chain expects a single input, it can be passed in as the
sole positional argument.
callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to call... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-5 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names: Optional[Sequence[... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-6 | Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-7 | Evaluate an example.
classmethod from_orm(obj: Any) → Model¶
classmethod from_run_and_data_type(evaluator: StringEvaluator, run_type: str, data_type: DataType, input_key: Optional[str] = None, prediction_key: Optional[str] = None, reference_key: Optional[str] = None, tags: Optional[List[str]] = None) → StringRunEvaluat... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-8 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → Dict[str, Any]¶
classmethod is_lc_serializable() → bool¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-9 | prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prepare chain inputs, including adding inputs from memory.
Parameters
inputs – Dictionary of raw inputs, or single input if chain expects
only one param. Should contain all inputs specified in
Chain.input_keys except for inputs that will be ... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-10 | these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be passed in
addition to tags passed to the chain during construction, but only
these runtime tags will propagate to calls to other objects.
**kwargs – If the chain expects multiple inputs, ... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-11 | to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶
Default implementation of transform, which buffers input and then calls stream... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
df474acc017e-12 | List of attribute names that should be included in the serialized kwargs.
These attributes must be accepted by the constructor.
property lc_secrets: Dict[str, str]¶
A map of constructor argument names to secret ids.
For example,{“openai_api_key”: “OPENAI_API_KEY”}
property output_keys: List[str]¶
Keys expected to be in... | https://api.python.langchain.com/en/latest/smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.