mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
langchain[small]: Change type to BasePromptTemplate (#23083)
```python Change from_llm( prompt: PromptTemplate ... ) ``` to ```python Change from_llm( prompt: BasePromptTemplate ... ) ```
This commit is contained in:
parent
94452a94b1
commit
db6f46c1a6
@ -9,6 +9,7 @@ from langchain_core.callbacks import (
|
|||||||
from langchain_core.documents import Document
|
from langchain_core.documents import Document
|
||||||
from langchain_core.language_models import BaseLanguageModel
|
from langchain_core.language_models import BaseLanguageModel
|
||||||
from langchain_core.output_parsers import BaseOutputParser
|
from langchain_core.output_parsers import BaseOutputParser
|
||||||
|
from langchain_core.prompts import BasePromptTemplate
|
||||||
from langchain_core.prompts.prompt import PromptTemplate
|
from langchain_core.prompts.prompt import PromptTemplate
|
||||||
from langchain_core.retrievers import BaseRetriever
|
from langchain_core.retrievers import BaseRetriever
|
||||||
from langchain_core.runnables import Runnable
|
from langchain_core.runnables import Runnable
|
||||||
@ -62,7 +63,7 @@ class MultiQueryRetriever(BaseRetriever):
|
|||||||
cls,
|
cls,
|
||||||
retriever: BaseRetriever,
|
retriever: BaseRetriever,
|
||||||
llm: BaseLanguageModel,
|
llm: BaseLanguageModel,
|
||||||
prompt: PromptTemplate = DEFAULT_QUERY_PROMPT,
|
prompt: BasePromptTemplate = DEFAULT_QUERY_PROMPT,
|
||||||
parser_key: Optional[str] = None,
|
parser_key: Optional[str] = None,
|
||||||
include_original: bool = False,
|
include_original: bool = False,
|
||||||
) -> "MultiQueryRetriever":
|
) -> "MultiQueryRetriever":
|
||||||
|
@ -7,6 +7,7 @@ from langchain_core.callbacks import (
|
|||||||
)
|
)
|
||||||
from langchain_core.documents import Document
|
from langchain_core.documents import Document
|
||||||
from langchain_core.language_models import BaseLLM
|
from langchain_core.language_models import BaseLLM
|
||||||
|
from langchain_core.prompts import BasePromptTemplate
|
||||||
from langchain_core.prompts.prompt import PromptTemplate
|
from langchain_core.prompts.prompt import PromptTemplate
|
||||||
from langchain_core.retrievers import BaseRetriever
|
from langchain_core.retrievers import BaseRetriever
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ class RePhraseQueryRetriever(BaseRetriever):
|
|||||||
cls,
|
cls,
|
||||||
retriever: BaseRetriever,
|
retriever: BaseRetriever,
|
||||||
llm: BaseLLM,
|
llm: BaseLLM,
|
||||||
prompt: PromptTemplate = DEFAULT_QUERY_PROMPT,
|
prompt: BasePromptTemplate = DEFAULT_QUERY_PROMPT,
|
||||||
) -> "RePhraseQueryRetriever":
|
) -> "RePhraseQueryRetriever":
|
||||||
"""Initialize from llm using default template.
|
"""Initialize from llm using default template.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user