aidev-bkplugin 2.0.2__tar.gz → 2.0.3__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.
Files changed (72) hide show
  1. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/PKG-INFO +2 -2
  2. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/serializers/chat_completion.py +17 -1
  3. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/pyproject.toml +2 -2
  4. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/__init__.py +0 -0
  5. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/apps.py +0 -0
  6. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/constants.py +0 -0
  7. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/management/__init__.py +0 -0
  8. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/management/commands/__init__.py +0 -0
  9. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/management/commands/upgrade_sessions.py +0 -0
  10. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/migrations/0001_initial.py +0 -0
  11. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/migrations/__init__.py +0 -0
  12. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/models.py +0 -0
  13. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/openapi/__init__.py +0 -0
  14. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/openapi/urls.py +0 -0
  15. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/openapi/views.py +0 -0
  16. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/__init__.py +0 -0
  17. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/apigw/__init__.py +0 -0
  18. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/apigw/permissions.py +0 -0
  19. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/checkpoint/__init__.py +0 -0
  20. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/checkpoint/bk_django_saver.py +0 -0
  21. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/drf/__init__.py +0 -0
  22. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/drf/authentication.py +0 -0
  23. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/drf/decorators.py +0 -0
  24. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/drf/exception.py +0 -0
  25. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/drf/renderers.py +0 -0
  26. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/opentelemetry/__init__.py +0 -0
  27. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/opentelemetry/callback_handler.py +0 -0
  28. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/opentelemetry/config.py +0 -0
  29. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/opentelemetry/instrumentor.py +0 -0
  30. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/opentelemetry/otel_service.py +0 -0
  31. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/opentelemetry/span_utils.py +0 -0
  32. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/packages/opentelemetry/utils.py +0 -0
  33. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/permissions.py +0 -0
  34. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/serializers/__init__.py +0 -0
  35. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/serializers/agent.py +0 -0
  36. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/services/__init__.py +0 -0
  37. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/services/agent_builder.py +0 -0
  38. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/services/agent_config.py +0 -0
  39. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/services/agent_execution.py +0 -0
  40. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/services/agent_helpers.py +0 -0
  41. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/services/agent_session.py +0 -0
  42. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/settings.py +0 -0
  43. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/urls.py +0 -0
  44. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/utils.py +0 -0
  45. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/views/__init__.py +0 -0
  46. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/views/agent.py +0 -0
  47. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/views/base.py +0 -0
  48. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/views/chat.py +0 -0
  49. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/views/chat_group.py +0 -0
  50. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/views/flow_agent.py +0 -0
  51. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/aidev_bkplugin/views/session.py +0 -0
  52. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/readme.md +0 -0
  53. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/__init__.py +0 -0
  54. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/conftest.py +0 -0
  55. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/packages/__init__.py +0 -0
  56. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/packages/opentelemetry/__init__.py +0 -0
  57. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/packages/opentelemetry/conftest.py +0 -0
  58. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/packages/opentelemetry/test_callback_handler.py +0 -0
  59. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/packages/opentelemetry/test_instrumentor.py +0 -0
  60. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/packages/opentelemetry/test_integration.py +0 -0
  61. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/services/__init__.py +0 -0
  62. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/services/agent/__init__.py +0 -0
  63. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/services/agent/conftest.py +0 -0
  64. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/services/agent/test_agent_config_fetcher.py +0 -0
  65. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/services/agent/test_builder.py +0 -0
  66. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/services/agent/test_session_manager.py +0 -0
  67. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/services/test_agui_handler.py +0 -0
  68. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/services/test_thread_chat_completion.py +0 -0
  69. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/settings.py +0 -0
  70. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/test_constants.py +0 -0
  71. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/views/__init__.py +0 -0
  72. {aidev_bkplugin-2.0.2 → aidev_bkplugin-2.0.3}/tests/views/test_chat_completion_serializer.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aidev-bkplugin
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: AiDev Agent Bkplugin builtin functions
5
5
  Requires-Python: <3.12,>=3.11
6
- Requires-Dist: aidev-agent>=2.0.2
6
+ Requires-Dist: aidev-agent>=2.0.3
7
7
  Requires-Dist: blueapps<5.0,>=4.15.1
8
8
  Requires-Dist: django<5.0,>=4.2.28
9
9
  Provides-Extra: opentelemetry
@@ -23,9 +23,25 @@ from aidev_bkplugin.services.agent_config import AgentConfigFetcher
23
23
  from aidev_bkplugin.services.agent_execution import build_execute_kwargs
24
24
 
25
25
 
26
+ class ChatPromptContentField(serializers.Field):
27
+ """chat_history.content 字段:兼容字符串与多模态列表。"""
28
+
29
+ default_error_messages = {"invalid": "content must be a string or list[dict]"}
30
+
31
+ def to_internal_value(self, data):
32
+ if isinstance(data, str):
33
+ return data
34
+ if isinstance(data, list) and all(isinstance(item, dict) for item in data):
35
+ return data
36
+ self.fail("invalid")
37
+
38
+ def to_representation(self, value):
39
+ return value
40
+
41
+
26
42
  class ChatPromptItemSerializer(serializers.Serializer):
27
43
  role = serializers.CharField()
28
- content = serializers.CharField(allow_blank=True)
44
+ content = ChatPromptContentField()
29
45
 
30
46
 
31
47
  class ChatCompletionRequestSerializer(serializers.Serializer):
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "aidev-bkplugin"
3
- version = "2.0.2"
3
+ version = "2.0.3"
4
4
  description = "AiDev Agent Bkplugin builtin functions"
5
5
  readme = "readme.md"
6
6
  requires-python = "<3.12,>=3.11"
7
7
  dependencies = [
8
- "aidev-agent>=2.0.2",
8
+ "aidev-agent>=2.0.3",
9
9
  "blueapps>=4.15.1, <5.0",
10
10
  "django>=4.2.28,<5.0",
11
11
  ]
File without changes