|
1 | | -"""Model-specific adaptors — tailored instructions per LLM provider. |
2 | | -
|
3 | | -Each provider has different strengths. We optimize prompt style accordingly: |
4 | | -- DeepSeek V3: strong structured output, good reasoning, cost-effective |
5 | | -- Gemini Flash: fast, good at concise responses |
6 | | -- NVIDIA Nemotron: free tier, needs explicit format guidance |
7 | | -- Anthropic Haiku: excellent tool calling, chain-of-thought |
8 | | -""" |
| 1 | +"""Model-specific adaptors — tailored instructions per pool complexity level.""" |
9 | 2 |
|
10 | 3 | MODEL_ADAPTORS = { |
11 | | - "pool-a": { |
12 | | - "deepseek": """## Response Style (DeepSeek — Efficient) |
13 | | -- Be concise: respond in under 150 words unless detailed analysis is explicitly requested |
| 4 | + "pool-a": """## Response Style (Quick Analysis) |
| 5 | +- Be concise: under 150 words unless detailed analysis requested |
14 | 6 | - When using tools, summarize results in 2-3 sentences |
15 | | -- For structured output, use exact JSON format — no markdown wrapping |
16 | | -- Prefer bullet points over paragraphs |
17 | 7 | - Include well IDs and numeric values, skip verbose explanations |
18 | | -- Example anomaly summary: "AUH-01-003: debit declined 32% (12.1→8.2 L/s). Recommend pump inspection." |
19 | | -""", |
20 | | - "gemini_flash": """## Response Style (Gemini Flash — Concise) |
21 | | -- Be very concise: under 100 words for simple queries |
22 | | -- Use bullet points, not paragraphs |
23 | | -- Include well IDs and numeric values with units |
24 | | -- For structured output, return exact JSON — no wrapping |
| 8 | +- Example: "AUH-01-003: debit declined 32% (12.1 to 8.2 L/s). Recommend pump inspection." |
25 | 9 | """, |
26 | | - }, |
27 | 10 | "pool-b": """## Response Style (Analytical) |
28 | | -- Think step by step before concluding. Consider multiple hypotheses. |
29 | | -- Structure your analysis: |
30 | | - 1. Observation: what the data shows |
31 | | - 2. Context: relevant hydrogeological factors |
32 | | - 3. Assessment: most likely explanation |
33 | | - 4. Recommendation: specific actionable steps |
34 | | -- You may use chain-of-thought reasoning for complex questions |
| 11 | +- Think step by step before concluding |
| 12 | +- Structure: Observation -> Context -> Assessment -> Recommendation |
35 | 13 | - Cross-reference multiple data points before declaring anomalies |
36 | | -- Compare with neighboring wells when relevant |
37 | 14 | - Cite specific values and well IDs throughout |
38 | 15 | """, |
39 | | - "pool-b-upgrade": """## Response Style (Comprehensive Analysis) |
| 16 | + "pool-b-upgrade": """## Response Style (Comprehensive) |
40 | 17 | - Provide comprehensive analysis with evidence and reasoning |
41 | | -- You have full freedom to reason at length — use it for complex cases |
42 | 18 | - Consider geological, operational, and seasonal factors holistically |
43 | | -- For anomaly interpretation: |
44 | | - - Analyze time series patterns in detail |
45 | | - - Consider superposition effects from neighboring wells |
46 | | - - Evaluate whether anomaly is isolated or part of regional trend |
47 | | - - Provide differential diagnosis with likelihood assessment |
48 | | -- For calibration/optimization questions: |
49 | | - - Consider trade-offs explicitly |
50 | | - - Provide quantitative recommendations where possible |
51 | | - - Reference hydrogeological principles (Theis, Cooper-Jacob) |
52 | | -- Include confidence levels in your assessments |
| 19 | +- Include confidence levels in assessments |
| 20 | +- Reference hydrogeological principles (Theis, Cooper-Jacob) |
53 | 21 | """, |
54 | 22 | } |
55 | 23 |
|
56 | 24 |
|
57 | 25 | def get_model_adaptor(model_pool: str, model_name: str = "") -> str: |
58 | 26 | """Get the appropriate model adaptor text for a model pool.""" |
59 | | - adaptor = MODEL_ADAPTORS.get(model_pool, "") |
60 | | - if isinstance(adaptor, dict): |
61 | | - if "gemini" in model_name: |
62 | | - return adaptor.get("gemini_flash", list(adaptor.values())[0]) |
63 | | - return adaptor.get("deepseek", list(adaptor.values())[0]) |
64 | | - return adaptor |
| 27 | + return MODEL_ADAPTORS.get(model_pool, MODEL_ADAPTORS["pool-b"]) |
0 commit comments