MetacouplingLLM 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- metacouplingllm/__init__.py +208 -0
- metacouplingllm/core.py +4542 -0
- metacouplingllm/data/Papers.zip +0 -0
- metacouplingllm/data/PeriTelecoupling_clean.csv +49953 -0
- metacouplingllm/data/PeriTelecoupling_subset.csv +11 -0
- metacouplingllm/data/chunk_embeddings.manifest.json +11 -0
- metacouplingllm/data/chunk_embeddings.npy +0 -0
- metacouplingllm/data/pericoupled_adm1_edge_list.csv +8291 -0
- metacouplingllm/data/telecoupling_literature.bib +3498 -0
- metacouplingllm/knowledge/__init__.py +1 -0
- metacouplingllm/knowledge/adm1_pericoupling.py +591 -0
- metacouplingllm/knowledge/citations.py +109 -0
- metacouplingllm/knowledge/countries.py +557 -0
- metacouplingllm/knowledge/examples.py +713 -0
- metacouplingllm/knowledge/framework.py +717 -0
- metacouplingllm/knowledge/literature.py +518 -0
- metacouplingllm/knowledge/pericoupling.py +241 -0
- metacouplingllm/knowledge/rag.py +1791 -0
- metacouplingllm/knowledge/references.py +112 -0
- metacouplingllm/knowledge/websearch.py +1842 -0
- metacouplingllm/llm/__init__.py +1 -0
- metacouplingllm/llm/client.py +636 -0
- metacouplingllm/llm/parser.py +868 -0
- metacouplingllm/output/__init__.py +1 -0
- metacouplingllm/output/formatter.py +276 -0
- metacouplingllm/prompts/__init__.py +1 -0
- metacouplingllm/prompts/builder.py +477 -0
- metacouplingllm/prompts/templates.py +556 -0
- metacouplingllm/visualization/__init__.py +114 -0
- metacouplingllm/visualization/adm1_map.py +884 -0
- metacouplingllm/visualization/worldmap.py +1372 -0
- metacouplingllm-0.1.0.dist-info/METADATA +440 -0
- metacouplingllm-0.1.0.dist-info/RECORD +35 -0
- metacouplingllm-0.1.0.dist-info/WHEEL +4 -0
- metacouplingllm-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Academic references for the metacoupling and telecoupling frameworks.
|
|
3
|
+
|
|
4
|
+
These references are injected into prompts so the LLM can cite authoritative
|
|
5
|
+
sources when advising researchers.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class Reference:
|
|
15
|
+
"""An academic reference used as a knowledge source."""
|
|
16
|
+
|
|
17
|
+
authors: str
|
|
18
|
+
year: int
|
|
19
|
+
title: str
|
|
20
|
+
journal: str
|
|
21
|
+
key_contribution: str
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
CORE_REFERENCES: list[Reference] = [
|
|
25
|
+
Reference(
|
|
26
|
+
authors="Liu, J., Hull, V., Batistella, M., DeFries, R., Dietz, T., Fu, F., ... & Zhu, C.",
|
|
27
|
+
year=2013,
|
|
28
|
+
title="Framing sustainability in a telecoupled world",
|
|
29
|
+
journal="Ecology and Society, 18(2), 26",
|
|
30
|
+
key_contribution=(
|
|
31
|
+
"Introduced the telecoupling framework with five components "
|
|
32
|
+
"(systems, flows, agents, causes, effects) and 14 telecoupling "
|
|
33
|
+
"categories. Provided foundational examples including the "
|
|
34
|
+
"Brazil-China soybean trade and red imported fire ant invasion."
|
|
35
|
+
),
|
|
36
|
+
),
|
|
37
|
+
Reference(
|
|
38
|
+
authors="Liu, J.",
|
|
39
|
+
year=2017,
|
|
40
|
+
title="Integration across a metacoupled world",
|
|
41
|
+
journal="Ecology and Society, 22(4), 29",
|
|
42
|
+
key_contribution=(
|
|
43
|
+
"Proposed the metacoupling framework as an umbrella concept "
|
|
44
|
+
"encompassing intracoupling (within systems), pericoupling "
|
|
45
|
+
"(between adjacent systems), and telecoupling (between distant "
|
|
46
|
+
"systems). Provided formal comparison table of the three coupling "
|
|
47
|
+
"types (Table 1), a six-phase operationalization procedure, and "
|
|
48
|
+
"detailed Wolong Nature Reserve example with panda loans, tourism, "
|
|
49
|
+
"and marriage immigration. Discussed system boundaries, governance, "
|
|
50
|
+
"and agent-based modeling for metacoupled systems."
|
|
51
|
+
),
|
|
52
|
+
),
|
|
53
|
+
Reference(
|
|
54
|
+
authors="Deines, J. M., Liu, X., & Liu, J.",
|
|
55
|
+
year=2016,
|
|
56
|
+
title="Telecoupling in urban water systems: An examination of Beijing's imported water supply",
|
|
57
|
+
journal="Water International, 41(2), 251-270",
|
|
58
|
+
key_contribution=(
|
|
59
|
+
"Applied the telecoupling framework to urban water supply, "
|
|
60
|
+
"identifying three telecouplings in Beijing's water system: "
|
|
61
|
+
"inter-basin water transfer (SNWTP), virtual water imports, "
|
|
62
|
+
"and payments for ecosystem services (PES)."
|
|
63
|
+
),
|
|
64
|
+
),
|
|
65
|
+
Reference(
|
|
66
|
+
authors="Zhao, Z., Liu, J., Xia, W., & Yang, H.",
|
|
67
|
+
year=2021,
|
|
68
|
+
title=(
|
|
69
|
+
"Metacoupling of sustainable development goals: "
|
|
70
|
+
"Synergies and tradeoffs across panda reserves"
|
|
71
|
+
),
|
|
72
|
+
journal="Global Environmental Change, Under review (based on provided manuscript)",
|
|
73
|
+
key_contribution=(
|
|
74
|
+
"Demonstrated how metacoupling analysis across 67 giant panda "
|
|
75
|
+
"nature reserves reveals synergies and tradeoffs among SDGs. "
|
|
76
|
+
"Showed that tourism and panda loan telecouplings generate "
|
|
77
|
+
"cross-system interactions affecting multiple SDGs simultaneously."
|
|
78
|
+
),
|
|
79
|
+
),
|
|
80
|
+
Reference(
|
|
81
|
+
authors="Liu, J.",
|
|
82
|
+
year=2023,
|
|
83
|
+
title="Leveraging the metacoupling framework for sustainability science and global sustainable development",
|
|
84
|
+
journal="National Science Review, 10(7), nwad090",
|
|
85
|
+
key_contribution=(
|
|
86
|
+
"Comprehensive review of metacoupling advances. Revealed effects "
|
|
87
|
+
"of metacoupling on SDG performance across borders; introduced "
|
|
88
|
+
"coupling transformation stages (noncoupling, coupling, decoupling, "
|
|
89
|
+
"recoupling); documented cascading interactions across space; "
|
|
90
|
+
"re-examined Tobler's First Law showing telecouplings often stronger "
|
|
91
|
+
"than pericouplings; expanded nexus approach across space; proposed "
|
|
92
|
+
"flow-based governance shifting from place-based governance."
|
|
93
|
+
),
|
|
94
|
+
),
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def format_references() -> str:
|
|
99
|
+
"""Format all core references as a text block for prompt injection.
|
|
100
|
+
|
|
101
|
+
Returns
|
|
102
|
+
-------
|
|
103
|
+
A formatted string listing each reference with its key contribution.
|
|
104
|
+
"""
|
|
105
|
+
lines: list[str] = ["## KEY REFERENCES\n"]
|
|
106
|
+
for ref in CORE_REFERENCES:
|
|
107
|
+
lines.append(
|
|
108
|
+
f"- {ref.authors} ({ref.year}). {ref.title}. "
|
|
109
|
+
f"*{ref.journal}*."
|
|
110
|
+
)
|
|
111
|
+
lines.append(f" Key contribution: {ref.key_contribution}\n")
|
|
112
|
+
return "\n".join(lines)
|