Spaces:
Sleeping
Sleeping
Update kig_core/prompts.py
Browse files- kig_core/prompts.py +4 -11
kig_core/prompts.py
CHANGED
@@ -84,14 +84,10 @@ SUMMARIZER_PROMPT = ChatPromptTemplate.from_template(SUMMARIZER_TEMPLATE)
|
|
84 |
# This prompt guides the LLM to output structured Key Issues based on gathered context.
|
85 |
# It references the Pydantic model 'KeyIssue' for the desired format.
|
86 |
KEY_ISSUE_STRUCTURING_TEMPLATE = f"""Based on the provided context (summaries of relevant documents, research findings, etc.), identify and formulate distinct Key Issues related to the original user query.
|
87 |
-
|
88 |
User Query: {{user_query}}
|
89 |
-
|
90 |
Context:
|
91 |
{{context}}
|
92 |
-
|
93 |
For each Key Issue identified, provide the following information in the exact JSON format described below. Output a JSON list containing multiple KeyIssue objects.
|
94 |
-
|
95 |
JSON Schema for each Key Issue object:
|
96 |
{{
|
97 |
"id": "Sequential integer ID starting from 1",
|
@@ -100,30 +96,27 @@ JSON Schema for each Key Issue object:
|
|
100 |
"challenges": ["List of specific challenges related to this issue (strings)", "Each challenge as a separate string"],
|
101 |
"potential_impact": "Brief description of the potential impact if not addressed (optional, max 30 words)"
|
102 |
}}
|
103 |
-
|
104 |
Example Format:
|
105 |
[
|
106 |
-
{{
|
107 |
"id": 1,
|
108 |
"title": "Scalability of AI Models in Low-Resource Settings",
|
109 |
"description": "Deploying complex AI models for healthcare diagnostics in areas with limited computational power and data connectivity presents significant scalability challenges. Existing models often require substantial resources.",
|
110 |
"challenges": ["High computational requirements of current models", "Intermittent or low-bandwidth network connectivity", "Lack of large, localized datasets for training/fine-tuning"],
|
111 |
"potential_impact": "Limits equitable access to advanced AI-driven healthcare diagnostics."
|
112 |
-
}},
|
113 |
-
{{
|
114 |
"id": 2,
|
115 |
"title": "...",
|
116 |
"description": "...",
|
117 |
"challenges": ["...", "..."],
|
118 |
"potential_impact": "..."
|
119 |
-
}}
|
120 |
]
|
121 |
-
|
122 |
Generate the JSON list of Key Issues based *only* on the provided context and user query. Ensure the output is a valid JSON list.
|
123 |
"""
|
124 |
KEY_ISSUE_STRUCTURING_PROMPT = ChatPromptTemplate.from_template(KEY_ISSUE_STRUCTURING_TEMPLATE)
|
125 |
|
126 |
-
|
127 |
# --- Initial Prompt Selection ---
|
128 |
def get_initial_planner_prompt(plan_method: str, user_query: str) -> ChatPromptTemplate:
|
129 |
if plan_method == "generation":
|
|
|
84 |
# This prompt guides the LLM to output structured Key Issues based on gathered context.
|
85 |
# It references the Pydantic model 'KeyIssue' for the desired format.
|
86 |
KEY_ISSUE_STRUCTURING_TEMPLATE = f"""Based on the provided context (summaries of relevant documents, research findings, etc.), identify and formulate distinct Key Issues related to the original user query.
|
|
|
87 |
User Query: {{user_query}}
|
|
|
88 |
Context:
|
89 |
{{context}}
|
|
|
90 |
For each Key Issue identified, provide the following information in the exact JSON format described below. Output a JSON list containing multiple KeyIssue objects.
|
|
|
91 |
JSON Schema for each Key Issue object:
|
92 |
{{
|
93 |
"id": "Sequential integer ID starting from 1",
|
|
|
96 |
"challenges": ["List of specific challenges related to this issue (strings)", "Each challenge as a separate string"],
|
97 |
"potential_impact": "Brief description of the potential impact if not addressed (optional, max 30 words)"
|
98 |
}}
|
|
|
99 |
Example Format:
|
100 |
[
|
101 |
+
{{{{
|
102 |
"id": 1,
|
103 |
"title": "Scalability of AI Models in Low-Resource Settings",
|
104 |
"description": "Deploying complex AI models for healthcare diagnostics in areas with limited computational power and data connectivity presents significant scalability challenges. Existing models often require substantial resources.",
|
105 |
"challenges": ["High computational requirements of current models", "Intermittent or low-bandwidth network connectivity", "Lack of large, localized datasets for training/fine-tuning"],
|
106 |
"potential_impact": "Limits equitable access to advanced AI-driven healthcare diagnostics."
|
107 |
+
}}}},
|
108 |
+
{{{{
|
109 |
"id": 2,
|
110 |
"title": "...",
|
111 |
"description": "...",
|
112 |
"challenges": ["...", "..."],
|
113 |
"potential_impact": "..."
|
114 |
+
}}}}
|
115 |
]
|
|
|
116 |
Generate the JSON list of Key Issues based *only* on the provided context and user query. Ensure the output is a valid JSON list.
|
117 |
"""
|
118 |
KEY_ISSUE_STRUCTURING_PROMPT = ChatPromptTemplate.from_template(KEY_ISSUE_STRUCTURING_TEMPLATE)
|
119 |
|
|
|
120 |
# --- Initial Prompt Selection ---
|
121 |
def get_initial_planner_prompt(plan_method: str, user_query: str) -> ChatPromptTemplate:
|
122 |
if plan_method == "generation":
|