crewplus 0.2.26__tar.gz → 0.2.27__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.
Potentially problematic release.
This version of crewplus might be problematic. Click here for more details.
- {crewplus-0.2.26 → crewplus-0.2.27}/PKG-INFO +1 -1
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/tracing_manager.py +20 -8
- {crewplus-0.2.26 → crewplus-0.2.27}/pyproject.toml +1 -1
- {crewplus-0.2.26 → crewplus-0.2.27}/LICENSE +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/README.md +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/__init__.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/__init__.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/azure_chat_model.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/gemini_chat_model.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/init_services.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/model_load_balancer.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/utils/__init__.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/utils/schema_action.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/utils/schema_document_updater.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/vectorstores/milvus/__init__.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/vectorstores/milvus/milvus_schema_manager.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/vectorstores/milvus/schema_milvus.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/vectorstores/milvus/vdb_service.py +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/docs/GeminiChatModel.md +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/docs/ModelLoadBalancer.md +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/docs/VDBService.md +0 -0
- {crewplus-0.2.26 → crewplus-0.2.27}/docs/index.md +0 -0
|
@@ -104,9 +104,10 @@ class TracingManager:
|
|
|
104
104
|
"""
|
|
105
105
|
Adds all registered tracing handlers to the request configuration.
|
|
106
106
|
|
|
107
|
-
This method is
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
This method is robust and handles three scenarios for the 'callbacks' key:
|
|
108
|
+
1. A list of callbacks.
|
|
109
|
+
2. A LangChain CallbackManager instance.
|
|
110
|
+
3. None or a missing key.
|
|
110
111
|
|
|
111
112
|
Args:
|
|
112
113
|
config: The request configuration dictionary from a LangChain call.
|
|
@@ -121,16 +122,27 @@ class TracingManager:
|
|
|
121
122
|
if not self._handlers or config.get("metadata", {}).get("tracing_disabled"):
|
|
122
123
|
return config
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
callbacks = config.get("callbacks")
|
|
126
|
+
|
|
127
|
+
# Case 1: The 'callbacks' key holds a CallbackManager instance
|
|
128
|
+
if hasattr(callbacks, 'add_handler') and hasattr(callbacks, 'handlers'):
|
|
129
|
+
for handler in self._handlers:
|
|
130
|
+
if not any(isinstance(cb, type(handler)) for cb in callbacks.handlers):
|
|
131
|
+
callbacks.add_handler(handler, inherit=True)
|
|
132
|
+
return config # Return the original, now-mutated config
|
|
133
|
+
|
|
134
|
+
# Case 2: The 'callbacks' key holds a list or is None
|
|
135
|
+
current_callbacks = callbacks or []
|
|
136
|
+
new_callbacks = list(current_callbacks)
|
|
127
137
|
|
|
128
138
|
for handler in self._handlers:
|
|
129
139
|
if not any(isinstance(cb, type(handler)) for cb in new_callbacks):
|
|
130
140
|
new_callbacks.append(handler)
|
|
131
141
|
|
|
132
|
-
|
|
133
|
-
|
|
142
|
+
if len(new_callbacks) > len(current_callbacks):
|
|
143
|
+
# Create a new dictionary with the updated callbacks list.
|
|
144
|
+
# This is a safe operation that overwrites the existing 'callbacks'
|
|
145
|
+
# key and avoids mutating the original config object.
|
|
134
146
|
return {**config, "callbacks": new_callbacks}
|
|
135
147
|
|
|
136
148
|
return config
|
|
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
|