Spaces:
Sleeping
Sleeping
Update src/prompts.py
Browse files265 unmodified lines2662672682692702713 unmodified lines27527627727827928011 unmodified lines292293294295296297298265 unmodified linesYou are a query-routing classifier for a {domain} research chatbot.Your task is to read the user's query and extract the country, value chain, and investment area in which the PERI analysis is to be run. Return ONLY valid JSON.Place all output values in a list and if not specified in the user query return NoneOutput:{{"country": ["Malawi"] or None,3 unmodified linesUSER'S QUESTION: {query}Return only the JSON object. Do not provide explanations, markdown, or additional text."""def build_stata_prompt(query:str,subcmd:str,dofx:str,11 unmodified lines):return CATEGORIZER_PROMPT_TEMPLATE.format(domain=domain,query=query)def build_init_prompt(query:str,265 unmodified lines2662672682692702712722732743 unmodified lines27827928028128228328428528628728828929029129229329429529629729811 unmodified lines310311312313314315316317265 unmodified linesYou are a query-routing classifier for a {domain} research chatbot.Your task is to read the user's query and extract the country, value chain, and investment area in which the PERI analysis is to be run. Return ONLY valid JSON.Place all output values in a list and if not specified in the user query return NoneMatch labels included in the user queries with options included in this items list:{approved_options}Output:{{"country": ["Malawi"] or None,3 unmodified linesUSER'S QUESTION: {query}Return only the JSON object. Do not provide explanations, markdown, or additional text."""def dict_to_string(d, indent=0):result = ""for key, value in d.items():# Add indentation based on nesting depthspacing = " " * indentif isinstance(value, dict):result += f"{spacing}{key}:\n"# Recursively call the function for nested dictionariesresult += dict_to_string(value, indent + 1)else:result += f"{spacing}{key}: {value}\n"return resultdef build_stata_prompt(query:str,subcmd:str,dofx:str,11 unmodified lines):return CATEGORIZER_PROMPT_TEMPLATE.format(domain=domain,query=query,approved_options=dict_to_string(APPROVED_OPTIONS, indent=4))def build_init_prompt(query:str,
src/prompts.py+20-1