I'm trying to create the load_summarize_chain for Langchain using prompts that I created myself.
llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0.7)
PROMPT = PromptTemplate(template=prompt_template, input_variables=["text"])
chain = load_summarize_chain(llm, chain_type="refine", verbose=True, prompt=PROMPT)
However, I'm only able to successfully create the chain when the chain_type is set as "stuff". When I try to specify it as "map_reduce" or "refine", I get an error message like the following:
ValidationError: 1 validation error for RefineDocumentsChain
prompt
extra fields not permitted (type=value_error.extra)
What's wrong with it?
I think it might be because "map_reduce" or "refine" cannot directly specify custom prompts in the load_summarize_chain
, or some other reason.