Find answers from the community

Updated 2 years ago

Good idea Is there way to customize

Good idea. Is there way to customize prompt template globally?
L
2 comments
yea as @miaumiks mentioned, if you are using GPT-3.5/4, you could use a system prompt, but you'll still need to customize the internal prompt templates

But for a basic example:

Plain Text
from llama_index.prompts.base import Prompt
SQL_SYNTH_PROMPT= Prompt(
    "Given an input question, synthesize a response from the query results.\n"
    "Query: {query_str}\n"
    "SQL: {sql_query}\n"
    "SQL Response: {sql_response_str}\n"
    "Response: "
)

query_engine = sql_index.as_query_engine(response_synthesis_prompt=SQL_SYNTH_PROMPT)
The above is what the default prompt already is πŸ™‚
Add a reply
Sign up and join the conversation on Discord