Skip to content

Commit 4112db5

Browse files
committed
Make generation prompt more robust
+ change default question in front-end
1 parent ed5d1a0 commit 4112db5

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

chains.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,23 +175,23 @@ def generate_ticket(neo4j_graph, llm_chain, input_question):
175175
# Ask LLM to generate new question in the same style
176176
questions_prompt = ""
177177
for i, question in enumerate(questions, start=1):
178-
questions_prompt += f"{i}. {question[0]}\n"
179-
questions_prompt += f"{question[1]}\n\n"
178+
questions_prompt += f"{i}. \n{question[0]}\n----\n\n"
179+
questions_prompt += f"{question[1][:150]}\n\n"
180180
questions_prompt += "----\n\n"
181181

182182
gen_system_template = f"""
183183
You're an expert in formulating high quality questions.
184-
Can you formulate a question in the same style, detail and tone as the following example questions?
184+
Formulate a question in the same style and tone as the following example questions.
185185
{questions_prompt}
186186
---
187187
188188
Don't make anything up, only use information in the following question.
189189
Return a title for the question, and the question post itself.
190190
191-
Return example:
191+
Return format template:
192192
---
193-
Title: How do I use the Neo4j Python driver?
194-
Question: I'm trying to connect to Neo4j using the Python driver, but I'm getting an error.
193+
Title: This is a new title
194+
Question: This is a new question
195195
---
196196
"""
197197
# we need jinja2 since the questions themselves contain curly braces
@@ -203,7 +203,7 @@ def generate_ticket(neo4j_graph, llm_chain, input_question):
203203
system_prompt,
204204
SystemMessagePromptTemplate.from_template(
205205
"""
206-
Respond in the following format or you will be unplugged.
206+
Respond in the following template format or you will be unplugged.
207207
---
208208
Title: New title
209209
Question: New question

front-end/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import { generationStore } from "./lib/generation.store";
1111
1212
let ragMode = false;
13-
let question = "How summarize PDFs using langchain?";
13+
let question = "How can I calculate age from date of birth in Cypher?";
1414
let shouldAutoScroll = true;
1515
let input;
1616
let senderImages = { bot: botImage, me: meImage };

0 commit comments

Comments
 (0)