Abid Ali Awan commited on
Commit
4571f97
·
1 Parent(s): cb8dd23

refactor: Introduce a new general system prompt in the Gradio application to provide clear guidelines for user interactions, emphasizing concise and friendly responses while maintaining context relevance. Update chat instructions to enhance user experience and clarity.

Browse files
Files changed (1) hide show
  1. app.py +21 -2
app.py CHANGED
@@ -30,9 +30,28 @@ MCP_TOOLS = [
30
  ]
31
 
32
  # -------------------------
33
- # Short prompts
34
  # -------------------------
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  MAIN_SYSTEM_PROMPT = """
37
  You are an MLOps assistant. You can internally use tools for CSV analysis,
38
  model training, evaluation, deployment, and end-to-end MLOps.
@@ -278,7 +297,7 @@ def chat_send_stream(user_msg, history, file_url):
278
 
279
  stream = client.responses.create(
280
  model=MODEL,
281
- instructions=MAIN_SYSTEM_PROMPT,
282
  input=input_text,
283
  reasoning={"effort": "low"},
284
  stream=True,
 
30
  ]
31
 
32
  # -------------------------
33
+ # Long prompts
34
  # -------------------------
35
 
36
+ GENERAL_SYSTEM_PROMPT = """
37
+ You are a helpful, concise AI assistant.
38
+
39
+ You will receive:
40
+ - A short transcript of the previous conversation (if any).
41
+ - The user's latest message.
42
+
43
+ Your job:
44
+ - Answer the latest user message directly.
45
+ - Use the previous conversation only as context when it is clearly relevant.
46
+ - If something is ambiguous, make a reasonable assumption and keep going.
47
+
48
+ Style:
49
+ - Be clear and friendly.
50
+ - Use Markdown formatting (headings, bullet points, code blocks when helpful).
51
+ - Prefer short, high-signal answers over long explanations, unless the user asks for detail.
52
+ """
53
+
54
+
55
  MAIN_SYSTEM_PROMPT = """
56
  You are an MLOps assistant. You can internally use tools for CSV analysis,
57
  model training, evaluation, deployment, and end-to-end MLOps.
 
297
 
298
  stream = client.responses.create(
299
  model=MODEL,
300
+ instructions=GENERAL_SYSTEM_PROMPT,
301
  input=input_text,
302
  reasoning={"effort": "low"},
303
  stream=True,