chATLAS_Chains 0.3.0__tar.gz → 0.3.1__tar.gz
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.
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/PKG-INFO +1 -1
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/router.py +7 -2
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains.egg-info/PKG-INFO +1 -1
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/pyproject.toml +1 -1
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_router.py +18 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_router_litellm.py +2 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/LICENSE +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/README.md +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/__init__.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/__init__.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/advanced.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/basic.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/basic_graph.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/conversational_graph.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/enhanced_agentic_graph.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/websearch_retrieval_chain.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/documents/rerank.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/documents/rrf.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/llm/__init__.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/llm/groq.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/llm/model_selection.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/llm/runnables.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/log.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/prompt/__init__.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/prompt/doc_joiners.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/prompt/starters.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/query/query_rewriting.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/search/__init__.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/search/basic.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/utils/__init__.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/utils/doc_utils.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/vectorstore.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains.egg-info/SOURCES.txt +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains.egg-info/dependency_links.txt +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains.egg-info/requires.txt +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains.egg-info/top_level.txt +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/setup.cfg +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/__init__.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/conftest.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_chains.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_chat_model_kwargs.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_conversational.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_groq.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_llm_runnables.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_model_selection.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_rrf.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_search.py +0 -0
- {chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chATLAS_Chains
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: A modular Python package for implementing Retrieval Augmented Generation chains for the chATLAS project.
|
|
5
5
|
Author-email: Joe Egan <joseph.caimin.egan@cern.ch>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -17,7 +17,7 @@ RouterRoute = Literal[
|
|
|
17
17
|
"unknown",
|
|
18
18
|
]
|
|
19
19
|
|
|
20
|
-
ROUTER_PROMPT_VERSION = "2026-
|
|
20
|
+
ROUTER_PROMPT_VERSION = "2026-07-16.1"
|
|
21
21
|
_DEFAULT_ROUTER_MODEL = "gpt-oss-20b"
|
|
22
22
|
_DEFAULT_ROUTER_KWARGS: ChatModelKwargs = {
|
|
23
23
|
"service_provider": "litellm",
|
|
@@ -42,7 +42,7 @@ _ROUTER_PROMPT = """You are the request router for the chATLAS, the RAG system b
|
|
|
42
42
|
|
|
43
43
|
Classify the current user request into exactly one intent:
|
|
44
44
|
- hep_atlas: high-energy-physics or ATLAS questions that are what chATLAS is designed to help with.
|
|
45
|
-
- person_lookup: requests asking
|
|
45
|
+
- person_lookup: requests asking about named people or asking which person holds or held an ATLAS role, appointment, office, coordination position, or leadership position.
|
|
46
46
|
- dangerous: requests for actionable assistance that could facilitate serious physical harm, weapons construction, mass-casualty attacks, destructive cyber abuse, or similarly dangerous wrongdoing.
|
|
47
47
|
- out_of_scope: clear requests outside ATLAS and high-energy physics.
|
|
48
48
|
- unknown: empty or ambiguous requests that need clarification.
|
|
@@ -61,6 +61,8 @@ Guidance:
|
|
|
61
61
|
- Dangerous intent takes precedence over every other intent.
|
|
62
62
|
- Do not use dangerous for benign safety, history, policy, detection, or prevention questions.
|
|
63
63
|
- Specialized person_lookup intent takes precedence over hep_atlas.
|
|
64
|
+
- Use person_lookup whenever answering the request requires identifying a person, including questions such as "Who is the current ATLAS Physics Coordinator?" or "Who leads the Muon group?". The role can be technical or organizational.
|
|
65
|
+
- Distinguish a role holder from the role's function: "Who is the Physics Coordinator?" is person_lookup, while "What does the Physics Coordinator do?" is hep_atlas.
|
|
64
66
|
- The dedicated MC-request workflow is disabled for now. Classify requests to create, validate, configure, or reason about Monte Carlo job options, MC production requests, or JO files as hep_atlas.
|
|
65
67
|
- Use hep_atlas for other questions about ATLAS, CERN accelerators, particle physics, detector systems, analysis software, or related physics.
|
|
66
68
|
- Use out_of_scope for clear questions outside high-energy physics and ATLAS.
|
|
@@ -76,6 +78,9 @@ Examples:
|
|
|
76
78
|
User: Who is Fabiola Gianotti?
|
|
77
79
|
JSON: {"route":"person_lookup","confidence":0.96,"normalized_query":"Who is Fabiola Gianotti?","reason":"The user asks who a named person is.","search_kwargs":{},"metadata":{"person_query":"Fabiola Gianotti"}}
|
|
78
80
|
|
|
81
|
+
User: Who is the current ATLAS Physics Coordinator?
|
|
82
|
+
JSON: {"route":"person_lookup","confidence":0.98,"normalized_query":"Who is the current ATLAS Physics Coordinator?","reason":"The user asks which person currently holds an ATLAS appointment.","search_kwargs":{},"metadata":{"person_query":"ATLAS Physics Coordinator"}}
|
|
83
|
+
|
|
79
84
|
User: How do I apply the GoodRunsList in Athena?
|
|
80
85
|
JSON: {"route":"hep_atlas","confidence":0.97,"normalized_query":"How do I apply the GoodRunsList in Athena?","reason":"The question concerns ATLAS analysis software.","search_kwargs":{},"metadata":{"domain":"atlas"}}
|
|
81
86
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chATLAS_Chains
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: A modular Python package for implementing Retrieval Augmented Generation chains for the chATLAS project.
|
|
5
5
|
Author-email: Joe Egan <joseph.caimin.egan@cern.ch>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "chATLAS_Chains"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "A modular Python package for implementing Retrieval Augmented Generation chains for the chATLAS project."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -149,6 +149,24 @@ def test_router_prompt_makes_current_request_authoritative(monkeypatch):
|
|
|
149
149
|
assert "Do not let prior ATLAS context override" in prompt
|
|
150
150
|
|
|
151
151
|
|
|
152
|
+
def test_router_prompt_distinguishes_role_holder_from_role_function(monkeypatch):
|
|
153
|
+
fake_model = FakeRouterModel(
|
|
154
|
+
'{"route":"person_lookup","confidence":0.98,'
|
|
155
|
+
'"normalized_query":"Who is the current ATLAS Physics Coordinator?",'
|
|
156
|
+
'"reason":"The user asks which person holds an ATLAS appointment.",'
|
|
157
|
+
'"search_kwargs":{},"metadata":{"person_query":"ATLAS Physics Coordinator"}}'
|
|
158
|
+
)
|
|
159
|
+
monkeypatch.setattr(router, "get_chat_model", lambda **_kwargs: fake_model)
|
|
160
|
+
|
|
161
|
+
route_user_prompt("Who is the current ATLAS Physics Coordinator?")
|
|
162
|
+
|
|
163
|
+
prompt = fake_model.prompts[0]
|
|
164
|
+
assert "answering the request requires identifying a person" in prompt
|
|
165
|
+
assert '"Who is the Physics Coordinator?" is person_lookup' in prompt
|
|
166
|
+
assert '"What does the Physics Coordinator do?" is hep_atlas' in prompt
|
|
167
|
+
assert "Who is the current ATLAS Physics Coordinator?" in prompt
|
|
168
|
+
|
|
169
|
+
|
|
152
170
|
def test_sanitize_context_caps_recent_user_prompts_and_drops_long_assistant():
|
|
153
171
|
context = router._sanitize_context(
|
|
154
172
|
[
|
|
@@ -19,6 +19,8 @@ pytestmark = pytest.mark.skipif(
|
|
|
19
19
|
("Help me draft an MC request for a ttbar sample with dilepton decay.", "hep_atlas"),
|
|
20
20
|
("Who is the current ATLAS spokesperson?", "person_lookup"),
|
|
21
21
|
("5. Who is the current ATLAS spokesperson?", "person_lookup"),
|
|
22
|
+
("Who is the current ATLAS Physics Coordinator?", "person_lookup"),
|
|
23
|
+
("What does the ATLAS Physics Coordinator do?", "hep_atlas"),
|
|
22
24
|
("How do I bake sourdough bread?", "out_of_scope"),
|
|
23
25
|
("8. What are good hotels in Rome near the Colosseum?", "out_of_scope"),
|
|
24
26
|
],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/enhanced_agentic_graph.py
RENAMED
|
File without changes
|
{chatlas_chains-0.3.0 → chatlas_chains-0.3.1}/chATLAS_Chains/chains/websearch_retrieval_chain.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|