isa-model 0.3.2__tar.gz → 0.3.4__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 (100) hide show
  1. {isa_model-0.3.2 → isa_model-0.3.4}/PKG-INFO +1 -1
  2. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/llm/llm_adapter.py +60 -3
  3. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model.egg-info/PKG-INFO +1 -1
  4. {isa_model-0.3.2 → isa_model-0.3.4}/pyproject.toml +1 -1
  5. {isa_model-0.3.2 → isa_model-0.3.4}/MANIFEST.in +0 -0
  6. {isa_model-0.3.2 → isa_model-0.3.4}/README.md +0 -0
  7. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/__init__.py +0 -0
  8. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/core/model_manager.py +0 -0
  9. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/core/model_registry.py +0 -0
  10. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/core/model_storage.py +0 -0
  11. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/core/storage/hf_storage.py +0 -0
  12. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/core/storage/local_storage.py +0 -0
  13. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/core/storage/minio_storage.py +0 -0
  14. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/deployment/__init__.py +0 -0
  15. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/deployment/core/__init__.py +0 -0
  16. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/deployment/core/deployment_config.py +0 -0
  17. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/deployment/core/deployment_manager.py +0 -0
  18. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/deployment/core/isa_deployment_service.py +0 -0
  19. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/deployment/gpu_int8_ds8/app/server.py +0 -0
  20. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/deployment/gpu_int8_ds8/scripts/test_client.py +0 -0
  21. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/deployment/gpu_int8_ds8/scripts/test_client_os.py +0 -0
  22. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/eval/__init__.py +0 -0
  23. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/eval/benchmarks.py +0 -0
  24. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/eval/factory.py +0 -0
  25. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/eval/metrics.py +0 -0
  26. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/__init__.py +0 -0
  27. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/adapter/unified_api.py +0 -0
  28. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/ai_factory.py +0 -0
  29. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/base.py +0 -0
  30. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/billing_tracker.py +0 -0
  31. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/providers/__init__.py +0 -0
  32. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/providers/base_provider.py +0 -0
  33. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/providers/ml_provider.py +0 -0
  34. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/providers/model_cache_manager.py +0 -0
  35. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/providers/ollama_provider.py +0 -0
  36. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/providers/openai_provider.py +0 -0
  37. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/providers/replicate_provider.py +0 -0
  38. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/providers/triton_provider.py +0 -0
  39. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/__init__.py +0 -0
  40. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/audio/base_stt_service.py +0 -0
  41. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/audio/base_tts_service.py +0 -0
  42. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/audio/openai_realtime_service.py +0 -0
  43. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/audio/openai_stt_service.py +0 -0
  44. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/audio/openai_tts_service.py +0 -0
  45. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/audio/replicate_tts_service.py +0 -0
  46. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/base_service.py +0 -0
  47. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/embedding/base_embed_service.py +0 -0
  48. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/embedding/ollama_embed_service.py +0 -0
  49. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/embedding/openai_embed_service.py +0 -0
  50. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/llm/__init__.py +0 -0
  51. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/llm/base_llm_service.py +0 -0
  52. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/llm/ollama_llm_service.py +0 -0
  53. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/llm/openai_llm_service.py +0 -0
  54. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/llm/triton_llm_service.py +0 -0
  55. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/ml/base_ml_service.py +0 -0
  56. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/ml/sklearn_ml_service.py +0 -0
  57. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/others/table_transformer_service.py +0 -0
  58. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/vision/__init__.py +0 -0
  59. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/vision/base_image_gen_service.py +0 -0
  60. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/vision/base_vision_service.py +0 -0
  61. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/vision/helpers/image_utils.py +0 -0
  62. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/vision/helpers/text_splitter.py +0 -0
  63. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/vision/ollama_vision_service.py +0 -0
  64. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/vision/openai_vision_service.py +0 -0
  65. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/services/vision/replicate_image_gen_service.py +0 -0
  66. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/utils/conversion/bge_rerank_convert.py +0 -0
  67. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/utils/conversion/onnx_converter.py +0 -0
  68. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/inference/utils/conversion/torch_converter.py +0 -0
  69. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/scripts/inference_tracker.py +0 -0
  70. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/scripts/mlflow_manager.py +0 -0
  71. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/scripts/model_registry.py +0 -0
  72. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/scripts/start_mlflow.py +0 -0
  73. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/scripts/training_tracker.py +0 -0
  74. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/__init__.py +0 -0
  75. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/annotation/annotation_schema.py +0 -0
  76. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/annotation/processors/annotation_processor.py +0 -0
  77. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/annotation/storage/dataset_manager.py +0 -0
  78. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/annotation/storage/dataset_schema.py +0 -0
  79. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/annotation/tests/test_annotation_flow.py +0 -0
  80. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/annotation/tests/test_minio copy.py +0 -0
  81. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/annotation/tests/test_minio_upload.py +0 -0
  82. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/annotation/views/annotation_controller.py +0 -0
  83. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/cloud/__init__.py +0 -0
  84. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/cloud/job_orchestrator.py +0 -0
  85. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/cloud/runpod_trainer.py +0 -0
  86. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/cloud/storage_manager.py +0 -0
  87. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/core/__init__.py +0 -0
  88. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/core/config.py +0 -0
  89. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/core/dataset.py +0 -0
  90. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/core/trainer.py +0 -0
  91. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/core/utils.py +0 -0
  92. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model/training/factory.py +0 -0
  93. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model.egg-info/SOURCES.txt +0 -0
  94. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model.egg-info/dependency_links.txt +0 -0
  95. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model.egg-info/requires.txt +0 -0
  96. {isa_model-0.3.2 → isa_model-0.3.4}/isa_model.egg-info/top_level.txt +0 -0
  97. {isa_model-0.3.2 → isa_model-0.3.4}/setup.cfg +0 -0
  98. {isa_model-0.3.2 → isa_model-0.3.4}/setup.py +0 -0
  99. {isa_model-0.3.2 → isa_model-0.3.4}/tests/test_all_services.py +0 -0
  100. {isa_model-0.3.2 → isa_model-0.3.4}/tests/test_training_setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: isa_model
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Unified AI model serving framework
5
5
  Author: isA_Model Contributors
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -89,6 +89,33 @@ class LangChainMessageAdapter:
89
89
  msg_dict["role"] = "user"
90
90
  elif msg.type == "ai":
91
91
  msg_dict["role"] = "assistant"
92
+ # Handle tool calls if present in LangChain AI messages
93
+ if hasattr(msg, 'tool_calls') and msg.tool_calls:
94
+ tool_calls = []
95
+ for tc in msg.tool_calls:
96
+ if isinstance(tc, dict):
97
+ # LangChain format: {"name": "func", "args": {...}, "id": "..."}
98
+ tool_call = {
99
+ "id": tc.get("id", f"call_{len(tool_calls)}"),
100
+ "type": "function",
101
+ "function": {
102
+ "name": tc.get("name", "unknown"),
103
+ "arguments": json.dumps(tc.get("args", {}))
104
+ }
105
+ }
106
+ else:
107
+ # Handle other tool call formats
108
+ tool_call = {
109
+ "id": getattr(tc, 'id', f"call_{len(tool_calls)}"),
110
+ "type": "function",
111
+ "function": {
112
+ "name": getattr(tc, 'name', 'unknown'),
113
+ "arguments": json.dumps(getattr(tc, 'args', {}))
114
+ }
115
+ }
116
+ tool_calls.append(tool_call)
117
+
118
+ msg_dict["tool_calls"] = tool_calls # type: ignore
92
119
  elif msg.type == "tool":
93
120
  msg_dict["role"] = "tool"
94
121
  if hasattr(msg, 'tool_call_id'):
@@ -218,6 +245,35 @@ class LangChainToolAdapter:
218
245
  return f"Error executing LangChain tool {tool.name}: {str(e)}"
219
246
 
220
247
 
248
+ # ============= OpenAI 格式工具适配器 =============
249
+
250
+ class DictToolAdapter:
251
+ """OpenAI 格式工具字典适配器"""
252
+
253
+ def __init__(self):
254
+ self.adapter_name = "dict_tool"
255
+ self.priority = 9 # Higher priority than Python functions
256
+
257
+ def can_handle(self, tool: Any) -> bool:
258
+ """检查是否是 OpenAI 格式的工具字典"""
259
+ return (isinstance(tool, dict) and
260
+ tool.get("type") == "function" and
261
+ "function" in tool and
262
+ isinstance(tool["function"], dict) and
263
+ "name" in tool["function"])
264
+
265
+ def to_openai_schema(self, tool: Any) -> Dict[str, Any]:
266
+ """工具已经是 OpenAI 格式,直接返回"""
267
+ return tool
268
+
269
+ async def execute_tool(self, tool: Any, arguments: Dict[str, Any]) -> Any:
270
+ """执行 OpenAI 格式工具(通常需要外部执行器)"""
271
+ # 对于 OpenAI 格式的工具字典,我们无法直接执行
272
+ # 这种情况下返回一个指示,让调用方处理
273
+ tool_name = tool["function"]["name"]
274
+ return f"Error: Cannot execute dict tool {tool_name} directly. Requires external executor."
275
+
276
+
221
277
  # ============= Python 函数适配器 =============
222
278
 
223
279
  class PythonFunctionAdapter:
@@ -364,10 +420,11 @@ class AdapterManager:
364
420
  StandardMessageAdapter() # 回退适配器
365
421
  ]
366
422
 
367
- # 工具适配器
423
+ # 工具适配器(按优先级排序)
368
424
  self.tool_adapters = [
369
- LangChainToolAdapter(),
370
- PythonFunctionAdapter()
425
+ DictToolAdapter(), # 最高优先级 - OpenAI格式工具
426
+ LangChainToolAdapter(), # 中等优先级 - LangChain工具
427
+ PythonFunctionAdapter() # 最低优先级 - Python函数
371
428
  ]
372
429
 
373
430
  def register_custom_adapter(self, adapter, adapter_type: str):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: isa_model
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Unified AI model serving framework
5
5
  Author: isA_Model Contributors
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "isa_model"
7
- version = "0.3.2"
7
+ version = "0.3.4"
8
8
  description = "Unified AI model serving framework"
9
9
  authors = [{name = "isA_Model Contributors"}]
10
10
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes