
    @i                         d Z  G d d      Zy)z%Intent understanding prompts for LLM.c                   2    e Zd ZdZedededefd       ZdZy)IntentPromptz*Prompt templates for intent understanding.queryavailable_poi_typesreturnc                 R    dj                  t        |            }d|  d| d| d}|S )a  Build intent understanding prompt with actual POI types from dataset.
        
        Args:
            query: User query
            available_poi_types: List of actual POI types in the dataset
            
        Returns:
            Formatted prompt string
        z, z<You are an expert in spatial business analysis.

User goal:
z[

Dataset contains the following POI types (ONLY use these types in your recommendations):
a  

Co-location patterns are formed by combinations of these POI types that frequently co-occur in space.

Based on the user's goal, please infer:

1. Target business type: What kind of business or activity is the user interested in?
2. Important spatial factors: What spatial characteristics matter most (e.g., proximity to parks, high traffic areas, etc.)?
3. Preferred co-location patterns: What types of POI co-locations would be beneficial? 
   IMPORTANT: Only use POI types from the list above. Examples: ["Park", "Restaurant"], ["Shopping Mall", "Coffee Shop"]
4. Risk factors: What spatial patterns or characteristics should be avoided?

Return ONLY a valid JSON object in the following format:

{
  "business": "string describing the target business type",
  "importance": {
    "factor1": "description",
    "factor2": "description"
  },
  "pattern_preference": [
    ["POI_type1", "POI_type2"],
    ["POI_type3", "POI_type4"]
  ],
  "risk": {
    "risk1": "description",
    "risk2": "description"
  }
}

CRITICAL REQUIREMENTS:
- Only return the JSON object, no other text, explanations, or dialogue history.
- pattern_preference must be a list of lists, where each inner list represents a preferred co-location pattern.
- ALL POI types in pattern_preference MUST be from the list above: z
- Do NOT use POI types that are not in the dataset.
- If you need to suggest a similar concept, map it to the closest available POI type (e.g., "cafe" -> "Coffee Shop", "store" -> "Shopping Mall").
)joinsorted)r   r   poi_types_strprompts       H   /home/ubuntu/codebase/yexijia/保研/colocation_mvp/llm/intent_prompt.pybuild_intent_promptz IntentPrompt.build_intent_prompt   sV     		&)<"=>    !DB ER? SO*V     a  You are an expert in spatial business analysis.

User goal:
{query}

Dataset contains:
- POI types (e.g., Park, Zoo, Restaurant, Shopping Mall, etc.)
- Co-location patterns (frequently co-occurring spatial features)
- Density information
- Mobility patterns

Based on the user's goal, please infer:

1. Target business type: What kind of business or activity is the user interested in?
2. Important spatial factors: What spatial characteristics matter most (e.g., proximity to parks, high traffic areas, etc.)?
3. Preferred co-location patterns: What types of POI co-locations would be beneficial (e.g., ["Park", "Restaurant"], ["Shopping Mall", "Restaurant"])?
4. Risk factors: What spatial patterns or characteristics should be avoided?

Return ONLY a valid JSON object in the following format:

{{
  "business": "string describing the target business type",
  "importance": {{
    "factor1": "description",
    "factor2": "description"
  }},
  "pattern_preference": [
    ["POI_type1", "POI_type2"],
    ["POI_type3", "POI_type4"]
  ],
  "risk": {{
    "risk1": "description",
    "risk2": "description"
  }}
}}

Important: 
- Only return the JSON object, no other text, explanations, or dialogue history.
- pattern_preference should be a list of lists, where each inner list represents a preferred co-location pattern.
- Use actual POI types that might exist in the dataset (e.g., Park, Zoo, Restaurant, Shopping Mall, School, Hospital, etc.).
N)	__name__
__module____qualname____doc__staticmethodstrlistr   INTENT_PROMPT r   r   r   r      s4    473 7T 7c 7 7t(Mr   r   N)r   r   r   r   r   <module>r      s    +f fr   