dasein-core 0.2.12__py3-none-any.whl → 0.2.14__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.
- dasein/api.py +26 -73
- {dasein_core-0.2.12.dist-info → dasein_core-0.2.14.dist-info}/METADATA +1 -1
- {dasein_core-0.2.12.dist-info → dasein_core-0.2.14.dist-info}/RECORD +6 -6
- {dasein_core-0.2.12.dist-info → dasein_core-0.2.14.dist-info}/WHEEL +0 -0
- {dasein_core-0.2.12.dist-info → dasein_core-0.2.14.dist-info}/licenses/LICENSE +0 -0
- {dasein_core-0.2.12.dist-info → dasein_core-0.2.14.dist-info}/top_level.txt +0 -0
dasein/api.py
CHANGED
@@ -887,6 +887,11 @@ class CognateProxy:
|
|
887
887
|
# Wrap the agent's LLM with our trace capture wrapper
|
888
888
|
self._wrap_agent_llm()
|
889
889
|
|
890
|
+
# CRITICAL: Update langgraph_params to use wrapped LLM for recreation
|
891
|
+
if self._is_langgraph and self._langgraph_params and self._wrapped_llm:
|
892
|
+
print(f" [DASEIN][WRAPPER] Updating langgraph_params to use wrapped LLM")
|
893
|
+
self._langgraph_params['model'] = self._wrapped_llm
|
894
|
+
|
890
895
|
# Inject universal dead-letter tool
|
891
896
|
self._inject_deadletter_tool()
|
892
897
|
|
@@ -1754,14 +1759,24 @@ Follow these rules when planning your actions."""
|
|
1754
1759
|
# 1. Search in agent
|
1755
1760
|
agent_llm = self._find_llm_recursively(self._agent, max_depth=5)
|
1756
1761
|
if agent_llm:
|
1757
|
-
|
1762
|
+
# CRITICAL: If this is a DaseinLLMWrapper, we need to patch the INNER LLM for pipecleaner!
|
1763
|
+
# But we skip patching the wrapper itself to avoid double callbacks
|
1764
|
+
if isinstance(agent_llm, DaseinLLMWrapper) and hasattr(agent_llm, '_llm'):
|
1765
|
+
print(f"[DASEIN][WRAPPER] Found DaseinLLMWrapper, patching inner LLM: {type(agent_llm._llm).__name__}")
|
1766
|
+
all_llms.append(('agent_inner', agent_llm._llm))
|
1767
|
+
else:
|
1768
|
+
all_llms.append(('agent', agent_llm))
|
1758
1769
|
|
1759
1770
|
# 2. Search in tools (where Summary LLM lives!)
|
1760
1771
|
if hasattr(self._agent, 'tools'):
|
1761
1772
|
for i, tool in enumerate(self._agent.tools or []):
|
1762
1773
|
tool_llm = self._find_llm_recursively(tool, max_depth=3, path=f"tools[{i}]")
|
1763
1774
|
if tool_llm:
|
1764
|
-
|
1775
|
+
# Skip if it's a DaseinLLMWrapper (already handles callbacks)
|
1776
|
+
if isinstance(tool_llm, DaseinLLMWrapper):
|
1777
|
+
print(f"[DASEIN][WRAPPER] Found DaseinLLMWrapper in tool - skipping")
|
1778
|
+
else:
|
1779
|
+
all_llms.append((f'tool_{i}_{getattr(tool, "name", "unknown")}', tool_llm))
|
1765
1780
|
|
1766
1781
|
print(f"[DASEIN][WRAPPER] Found {len(all_llms)} LLM(s)")
|
1767
1782
|
for location, llm in all_llms:
|
@@ -2045,43 +2060,10 @@ Follow these rules when planning your actions."""
|
|
2045
2060
|
traceback.print_exc()
|
2046
2061
|
|
2047
2062
|
try:
|
2048
|
-
#
|
2049
|
-
#
|
2050
|
-
# So we need to manually inject the callback handler
|
2051
|
-
if meth_name in ['_generate', '_agenerate'] and callback_handler:
|
2052
|
-
if 'run_manager' not in kwargs and hasattr(callback_handler, 'on_llm_start'):
|
2053
|
-
# Manually trigger on_llm_start since no run_manager
|
2054
|
-
import uuid
|
2055
|
-
run_id = uuid.uuid4()
|
2056
|
-
# Extract messages for on_llm_start
|
2057
|
-
messages = args[0] if args else []
|
2058
|
-
prompts = []
|
2059
|
-
for msg in (messages if isinstance(messages, list) else [messages]):
|
2060
|
-
if hasattr(msg, 'content'):
|
2061
|
-
prompts.append(str(msg.content))
|
2062
|
-
else:
|
2063
|
-
prompts.append(str(msg))
|
2064
|
-
|
2065
|
-
# Call on_llm_start
|
2066
|
-
callback_handler.on_llm_start(
|
2067
|
-
serialized={'name': type(self_llm).__name__},
|
2068
|
-
prompts=prompts,
|
2069
|
-
run_id=run_id
|
2070
|
-
)
|
2071
|
-
|
2072
|
-
# Store run_id for on_llm_end
|
2073
|
-
if not hasattr(self_llm, '_dasein_pending_run_ids'):
|
2074
|
-
self_llm._dasein_pending_run_ids = []
|
2075
|
-
self_llm._dasein_pending_run_ids.append(run_id)
|
2076
|
-
|
2063
|
+
# NOTE: Manual callback injection DISABLED - DaseinLLMWrapper handles callbacks
|
2064
|
+
# The patched methods ONLY do pipecleaner deduplication, not callbacks
|
2077
2065
|
result = await orig_method(self_llm, *args, **kwargs)
|
2078
2066
|
|
2079
|
-
# Call on_llm_end if we called on_llm_start
|
2080
|
-
if meth_name in ['_generate', '_agenerate'] and callback_handler:
|
2081
|
-
if hasattr(self_llm, '_dasein_pending_run_ids') and self_llm._dasein_pending_run_ids:
|
2082
|
-
run_id = self_llm._dasein_pending_run_ids.pop(0)
|
2083
|
-
callback_handler.on_llm_end(result, run_id=run_id)
|
2084
|
-
|
2085
2067
|
# 🚨 MICROTURN ENFORCEMENT - DISABLED
|
2086
2068
|
# Microturn can interfere with tool execution, so it's disabled
|
2087
2069
|
# TODO: Re-enable with proper gating if needed for specific use cases
|
@@ -2310,43 +2292,10 @@ Follow these rules when planning your actions."""
|
|
2310
2292
|
traceback.print_exc()
|
2311
2293
|
|
2312
2294
|
try:
|
2313
|
-
#
|
2314
|
-
#
|
2315
|
-
# So we need to manually inject the callback handler
|
2316
|
-
if meth_name in ['_generate', '_agenerate'] and callback_handler:
|
2317
|
-
if 'run_manager' not in kwargs and hasattr(callback_handler, 'on_llm_start'):
|
2318
|
-
# Manually trigger on_llm_start since no run_manager
|
2319
|
-
import uuid
|
2320
|
-
run_id = uuid.uuid4()
|
2321
|
-
# Extract messages for on_llm_start
|
2322
|
-
messages = args[0] if args else []
|
2323
|
-
prompts = []
|
2324
|
-
for msg in (messages if isinstance(messages, list) else [messages]):
|
2325
|
-
if hasattr(msg, 'content'):
|
2326
|
-
prompts.append(str(msg.content))
|
2327
|
-
else:
|
2328
|
-
prompts.append(str(msg))
|
2329
|
-
|
2330
|
-
# Call on_llm_start
|
2331
|
-
callback_handler.on_llm_start(
|
2332
|
-
serialized={'name': type(self_llm).__name__},
|
2333
|
-
prompts=prompts,
|
2334
|
-
run_id=run_id
|
2335
|
-
)
|
2336
|
-
|
2337
|
-
# Store run_id for on_llm_end
|
2338
|
-
if not hasattr(self_llm, '_dasein_pending_run_ids'):
|
2339
|
-
self_llm._dasein_pending_run_ids = []
|
2340
|
-
self_llm._dasein_pending_run_ids.append(run_id)
|
2341
|
-
|
2295
|
+
# NOTE: Manual callback injection DISABLED - DaseinLLMWrapper handles callbacks
|
2296
|
+
# The patched methods ONLY do pipecleaner deduplication, not callbacks
|
2342
2297
|
result = orig_method(self_llm, *args, **kwargs)
|
2343
2298
|
|
2344
|
-
# Call on_llm_end if we called on_llm_start
|
2345
|
-
if meth_name in ['_generate', '_agenerate'] and callback_handler:
|
2346
|
-
if hasattr(self_llm, '_dasein_pending_run_ids') and self_llm._dasein_pending_run_ids:
|
2347
|
-
run_id = self_llm._dasein_pending_run_ids.pop(0)
|
2348
|
-
callback_handler.on_llm_end(result, run_id=run_id)
|
2349
|
-
|
2350
2299
|
# 🚨 MICROTURN ENFORCEMENT - DISABLED (can interfere with tool execution)
|
2351
2300
|
# TODO: Re-enable with proper gating if needed
|
2352
2301
|
|
@@ -3841,7 +3790,11 @@ Follow these rules when planning your actions."""
|
|
3841
3790
|
print(f"[DASEIN] 🔧 Pre-loading embedding model for pipecleaner (found filter search rules)...")
|
3842
3791
|
from .pipecleaner import _get_embedding_model
|
3843
3792
|
try:
|
3844
|
-
|
3793
|
+
# Suppress protobuf warnings from sentence-transformers
|
3794
|
+
import warnings
|
3795
|
+
with warnings.catch_warnings():
|
3796
|
+
warnings.filterwarnings('ignore', category=Warning)
|
3797
|
+
_get_embedding_model() # Warm up the model
|
3845
3798
|
print(f"[DASEIN] ✅ Embedding model pre-loaded successfully")
|
3846
3799
|
except Exception as e:
|
3847
3800
|
print(f"[DASEIN] ⚠️ Failed to pre-load embedding model: {e}")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
dasein/__init__.py,sha256=RY0lhaaWB6yJ_5YMRmaHDvQ0eFbc0BGbYNe5OVyxzYE,2316
|
2
2
|
dasein/advice_format.py,sha256=5-h4J24L_B2Y9dlmyDuIYtmPCWOGAYoinBEXqpcNg2s,5386
|
3
|
-
dasein/api.py,sha256=
|
3
|
+
dasein/api.py,sha256=8WYkFUnMqkzOL3NDvowH_WD6A5fd27H39akujnKO99c,252752
|
4
4
|
dasein/capture.py,sha256=D4DvknI2wbmVup5WqvNcgw-zW5riEstYG81Rl98uz6o,110942
|
5
5
|
dasein/config.py,sha256=lXO8JG4RXbodn3gT5yEnuB0VRwWdrRVwhX3Rm06IZmU,1957
|
6
6
|
dasein/events.py,sha256=mG-lnOvQoZUhXbrPSjrG4RME6ywUcbSZ04PscoJ15GI,12896
|
@@ -45,7 +45,7 @@ dasein/services/post_run_client.py,sha256=UjK3eqf7oWGSuWkKe0vQmeMS0yUUOhYFD4-SZ7
|
|
45
45
|
dasein/services/pre_run_client.py,sha256=tXmz_PQaSfq0xwypiWUAqNkXOmREZ6EwXLC4OM89J-A,4317
|
46
46
|
dasein/services/service_adapter.py,sha256=YHk41lR3PXh8WTmxOzzwKf6hwPYGqIdApI92vQKlkAY,7350
|
47
47
|
dasein/services/service_config.py,sha256=8_4tpV4mZvfaOc5_yyHbOyL4rYsPHzkLTEY1rtYgLs8,1629
|
48
|
-
dasein_core-0.2.
|
48
|
+
dasein_core-0.2.14.dist-info/licenses/LICENSE,sha256=7FHjIFEKl_3hSc3tGUVEWmufC_3oi8rh_2zVuL7jMKs,1091
|
49
49
|
dasein/models/en_core_web_sm/en_core_web_sm-3.7.1.dist-info/LICENSE,sha256=OTPBdpebaLxtC8yQLH1sEw8dEn9Hbxe6XNuo2Zz9ABI,1056
|
50
50
|
dasein/models/en_core_web_sm/en_core_web_sm-3.7.1.dist-info/LICENSES_SOURCES,sha256=INnfrNIVESJR8VNB7dGkex-Yvzk6IS8Q8ZT_3H7pipA,2347
|
51
51
|
dasein/models/en_core_web_sm/en_core_web_sm-3.7.1.dist-info/METADATA,sha256=-vGqRxa_M2RwKtLjBhc4JlBQdJ3k7CwOnseT_ReYcic,2958
|
@@ -53,7 +53,7 @@ dasein/models/en_core_web_sm/en_core_web_sm-3.7.1.dist-info/RECORD,sha256=dDb6U7
|
|
53
53
|
dasein/models/en_core_web_sm/en_core_web_sm-3.7.1.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
54
54
|
dasein/models/en_core_web_sm/en_core_web_sm-3.7.1.dist-info/entry_points.txt,sha256=OkWs-KxPJtDdpvIFCVXzDC9ECtejhPxv7pP3Tgk2cNg,47
|
55
55
|
dasein/models/en_core_web_sm/en_core_web_sm-3.7.1.dist-info/top_level.txt,sha256=56OIuRbEuhr12HsM9XpCMnTtHRMgNC5Hje4Xeo8wF2c,15
|
56
|
-
dasein_core-0.2.
|
57
|
-
dasein_core-0.2.
|
58
|
-
dasein_core-0.2.
|
59
|
-
dasein_core-0.2.
|
56
|
+
dasein_core-0.2.14.dist-info/METADATA,sha256=Wor24FjmtzERNq7zLbq-b9oP4EVqlKPASshkGCgAO0c,10297
|
57
|
+
dasein_core-0.2.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
58
|
+
dasein_core-0.2.14.dist-info/top_level.txt,sha256=6yYY9kltjvvPsg9K6KyMKRtzEr5qM7sHXN7VzmrDtp0,7
|
59
|
+
dasein_core-0.2.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|