Find answers from the community

Updated last year

How do we add a custom prompt to a chat

How do we add a custom prompt to a chat_engine with OpenAI. The examples I found here in the Discord seem to use langchain and are potentially out-of-date (still referencing gpt-index as the package name). What's the right way to do this? Have looked here: https://gpt-index.readthedocs.io/en/stable/core_modules/query_modules/chat_engines/usage_pattern.html
L
c
3 comments
You can specify a system prompt as a kwarg. This works for every chat engine except the react one

Plain Text
index.as_chat_engine(system_prompt="talk like a pirate")
let me try that, can we pass the class Prompt() to it?
nah, it only takes a string, and converts it to a system message under the hood
Add a reply
Sign up and join the conversation on Discord