Find answers from the community

Home
Members
fengxiaoyang1998
f
fengxiaoyang1998
Offline, last seen 3 months ago
Joined September 25, 2024

you may see references to legacy prompt subclasses such as QuestionAnswerPrompt, RefinePrompt. These have been deprecated (and now are type aliases of PromptTemplate). Now you can directly specify PromptTemplate(template) to construct custom prompts. But you still have to make sure the template string contains the expected parameters (e.g. {context_str} and {query_str}) when replacing a default question answer prompt.

since RefinePrompt have been deprecated, how could i modify the following code:
Plain Text
CHAT_REFINE_PROMPT_LC = ChatPromptTemplate.from_messages(CHAT_REFINE_PROMPT_TMPL_MSGS)
CHAT_REFINE_PROMPT = RefinePrompt.from_langchain_prompt(CHAT_REFINE_PROMPT_LC)
5 comments
f
k
@kapa.ai
ImportError: cannot import name 'DEFAULT_FILE_EXTRACTOR' from 'llama_index.readers.file' (F:\miniconda3\envs\py11-llama\lib\site-packages\llama_index\readers\file__init__.py)
2 comments
k