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.

Files changed (22) hide show
  1. {crewplus-0.2.26 → crewplus-0.2.27}/PKG-INFO +1 -1
  2. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/tracing_manager.py +20 -8
  3. {crewplus-0.2.26 → crewplus-0.2.27}/pyproject.toml +1 -1
  4. {crewplus-0.2.26 → crewplus-0.2.27}/LICENSE +0 -0
  5. {crewplus-0.2.26 → crewplus-0.2.27}/README.md +0 -0
  6. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/__init__.py +0 -0
  7. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/__init__.py +0 -0
  8. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/azure_chat_model.py +0 -0
  9. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/gemini_chat_model.py +0 -0
  10. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/init_services.py +0 -0
  11. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/services/model_load_balancer.py +0 -0
  12. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/utils/__init__.py +0 -0
  13. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/utils/schema_action.py +0 -0
  14. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/utils/schema_document_updater.py +0 -0
  15. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/vectorstores/milvus/__init__.py +0 -0
  16. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/vectorstores/milvus/milvus_schema_manager.py +0 -0
  17. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/vectorstores/milvus/schema_milvus.py +0 -0
  18. {crewplus-0.2.26 → crewplus-0.2.27}/crewplus/vectorstores/milvus/vdb_service.py +0 -0
  19. {crewplus-0.2.26 → crewplus-0.2.27}/docs/GeminiChatModel.md +0 -0
  20. {crewplus-0.2.26 → crewplus-0.2.27}/docs/ModelLoadBalancer.md +0 -0
  21. {crewplus-0.2.26 → crewplus-0.2.27}/docs/VDBService.md +0 -0
  22. {crewplus-0.2.26 → crewplus-0.2.27}/docs/index.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crewplus
3
- Version: 0.2.26
3
+ Version: 0.2.27
4
4
  Summary: Base services for CrewPlus AI applications
5
5
  Author-Email: Tim Liu <tim@opsmateai.com>
6
6
  License: MIT
@@ -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 idempotent; it will not add a handler if one of the
108
- same type is already present in the configuration's callback list. It
109
- also respects a `tracing_disabled` flag in the metadata.
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
- # Use an empty list as a safe default if 'callbacks' is missing or None.
125
- callbacks = config.get("callbacks") or []
126
- new_callbacks = list(callbacks)
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
- # Only create a new config dictionary if callbacks were actually added.
133
- if len(new_callbacks) > len(callbacks):
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
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "crewplus"
9
- version = "0.2.26"
9
+ version = "0.2.27"
10
10
  description = "Base services for CrewPlus AI applications"
11
11
  authors = [
12
12
  { name = "Tim Liu", email = "tim@opsmateai.com" },
File without changes
File without changes
File without changes
File without changes