Find answers from the community

Updated 12 months ago

OpenAI has a "System Role" set by

At a glance

The community member asks if it is possible to customize the "System Role" when using LlamaIndex with OpenAI as the language model. Another community member responds that it is possible to customize the system prompt by setting the system_prompt parameter when initializing the OpenAI language model in LlamaIndex.

OpenAI has a "System Role" set by default to "You are a helpful assistant." If I directly use the OpenAI API or SDK, I can customize it. When using LlamaIndex with OpenAI as the LLM, is there a way to customize it?
W
S
2 comments
Yes you can customize it like this:
Plain Text
from llama_index.core import Settings
from llama_index.llms.openai import OpenAI
Settings.llm = OpenAI(system_prompt="ADD_YOUR_SYTEM_PROMPT_HERE")
Add a reply
Sign up and join the conversation on Discord