From 06d18c106d8d35b5b2421f6bca04f7790b4d96eb Mon Sep 17 00:00:00 2001 From: Leonid Ganeline Date: Fri, 19 Apr 2024 18:42:18 -0700 Subject: [PATCH] langchain[patch]: `example_selector` import fix (#20676) Cleaned up updated imports --- libs/langchain/langchain/prompts/__init__.py | 4 +++- .../langchain/prompts/example_selector/__init__.py | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/langchain/langchain/prompts/__init__.py b/libs/langchain/langchain/prompts/__init__.py index 9a966fa552..8de4b06a4a 100644 --- a/libs/langchain/langchain/prompts/__init__.py +++ b/libs/langchain/langchain/prompts/__init__.py @@ -27,6 +27,9 @@ from multiple components. Prompt classes and functions make constructing ChatPromptValue """ # noqa: E501 +from langchain_community.example_selectors.ngram_overlap import ( + NGramOverlapExampleSelector, +) from langchain_core.example_selectors import ( LengthBasedExampleSelector, MaxMarginalRelevanceExampleSelector, @@ -50,7 +53,6 @@ from langchain_core.prompts import ( load_prompt, ) -from langchain.prompts.example_selector import NGramOverlapExampleSelector from langchain.prompts.prompt import Prompt __all__ = [ diff --git a/libs/langchain/langchain/prompts/example_selector/__init__.py b/libs/langchain/langchain/prompts/example_selector/__init__.py index 670eef9c4c..5b04ca453f 100644 --- a/libs/langchain/langchain/prompts/example_selector/__init__.py +++ b/libs/langchain/langchain/prompts/example_selector/__init__.py @@ -1,4 +1,7 @@ """Logic for selecting examples to include in prompts.""" +from langchain_community.example_selectors.ngram_overlap import ( + NGramOverlapExampleSelector, +) from langchain_core.example_selectors.length_based import ( LengthBasedExampleSelector, ) @@ -7,10 +10,6 @@ from langchain_core.example_selectors.semantic_similarity import ( SemanticSimilarityExampleSelector, ) -from langchain.prompts.example_selector.ngram_overlap import ( - NGramOverlapExampleSelector, -) - __all__ = [ "LengthBasedExampleSelector", "MaxMarginalRelevanceExampleSelector",