Allow custom system prompts #30

Closed
opened 2026-02-15 19:15:18 -05:00 by yindo · 1 comment
Owner

Originally created by @SebastianVomMeer on GitHub (Jul 30, 2024).

I just created a new application with version 0.1.25 and it looks like the system prompt setting from the .env file is ignored:

// app/api/chat/engine/chat.ts

  return new ContextChatEngine({
    chatModel: Settings.llm,
    retriever,
    // disable as a custom system prompt disables the generated context
    // systemPrompt: process.env.SYSTEM_PROMPT,
  });

I don't really understand the comment, is there a bug in llamaindex or is some code missing here? Is there an easy way to get this working?


✔ What is your project named? … my-app
✔ Which template would you like to use? › Agentic RAG (single agent)
✔ Which framework would you like to use? › NextJS
✔ Would you like to set up observability? › No
✔ Please provide your OpenAI API key (leave blank to skip): … 
✔ Which data source would you like to use? › Use an example PDF (you can add your own data files later)
✔ Would you like to add another data source? › No
✔ Would you like to use LlamaParse (improved parser for RAG - requires API key)? … no / yes › No
✔ Would you like to use a vector database? › No, just store the data in the file system
✔ Would you like to build an agent using tools? If so, select the tools here, otherwise just press enter › 
✔ How would you like to proceed? › Generate code and install dependencies (~2 min)
Originally created by @SebastianVomMeer on GitHub (Jul 30, 2024). I just created a new application with version 0.1.25 and it looks like the system prompt setting from the .env file is ignored: ```typescript // app/api/chat/engine/chat.ts return new ContextChatEngine({ chatModel: Settings.llm, retriever, // disable as a custom system prompt disables the generated context // systemPrompt: process.env.SYSTEM_PROMPT, }); ``` I don't really understand the comment, is there a bug in llamaindex or is some code missing here? Is there an easy way to get this working? --- ``` ✔ What is your project named? … my-app ✔ Which template would you like to use? › Agentic RAG (single agent) ✔ Which framework would you like to use? › NextJS ✔ Would you like to set up observability? › No ✔ Please provide your OpenAI API key (leave blank to skip): … ✔ Which data source would you like to use? › Use an example PDF (you can add your own data files later) ✔ Would you like to add another data source? › No ✔ Would you like to use LlamaParse (improved parser for RAG - requires API key)? … no / yes › No ✔ Would you like to use a vector database? › No, just store the data in the file system ✔ Would you like to build an agent using tools? If so, select the tools here, otherwise just press enter › ✔ How would you like to proceed? › Generate code and install dependencies (~2 min) ```
yindo closed this issue 2026-02-15 19:15:18 -05:00
Author
Owner

@marcusschiesser commented on GitHub (Jul 31, 2024):

Thanks. Fixed in Release 0.1.26

@marcusschiesser commented on GitHub (Jul 31, 2024): Thanks. Fixed in Release 0.1.26
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/create-llama#30