Skip to content

How to make Model answer only from my docs #10036

Answered by dosubot bot
TheJokerBG asked this question in Q&A
Discussion options

You must be logged in to vote

🤖

Hi there,

Yes, you can configure LangChain to return answers only from the ingested TXT database, rather than using its pre-trained information. This can be achieved by using the QUESTION_PROMPT and COMBINE_PROMPT templates defined in the map_reduce_prompt.py file.

Here is the relevant code:

QUESTION_PROMPT = PromptTemplate(
    template=question_prompt_template, input_variables=["context", "question"]
)

combine_prompt_template = """Given the following extracted parts of a long document and a question, create a final answer with references ("SOURCES"). 
If you don't know the answer, just say that you don't know. Don't try to make up an answer.
ALWAYS return a "SOURCES" part in your ans…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TheJokerBG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant