camel-ai 0.2.49__py3-none-any.whl → 0.2.50__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.
Potentially problematic release.
This version of camel-ai might be problematic. Click here for more details.
- camel/__init__.py +1 -1
- camel/agents/chat_agent.py +159 -15
- camel/configs/__init__.py +6 -0
- camel/configs/modelscope_config.py +4 -1
- camel/configs/novita_config.py +102 -0
- camel/configs/qwen_config.py +0 -7
- camel/configs/watsonx_config.py +96 -0
- camel/models/__init__.py +4 -0
- camel/models/model_factory.py +29 -6
- camel/models/modelscope_model.py +175 -2
- camel/models/novita_model.py +95 -0
- camel/models/qwen_model.py +175 -2
- camel/models/watsonx_model.py +253 -0
- camel/societies/workforce/prompts.py +31 -4
- camel/societies/workforce/workforce.py +1 -1
- camel/toolkits/browser_toolkit.py +53 -55
- camel/types/enums.py +223 -1
- camel/types/unified_model_type.py +10 -0
- camel/utils/__init__.py +2 -0
- camel/utils/filename.py +80 -0
- camel/verifiers/__init__.py +2 -0
- camel/verifiers/physics_verifier.py +881 -0
- camel/verifiers/python_verifier.py +16 -31
- {camel_ai-0.2.49.dist-info → camel_ai-0.2.50.dist-info}/METADATA +4 -1
- {camel_ai-0.2.49.dist-info → camel_ai-0.2.50.dist-info}/RECORD +27 -21
- {camel_ai-0.2.49.dist-info → camel_ai-0.2.50.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.49.dist-info → camel_ai-0.2.50.dist-info}/licenses/LICENSE +0 -0
camel/types/enums.py
CHANGED
|
@@ -212,6 +212,10 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
212
212
|
QWEN_MAX = "qwen-max"
|
|
213
213
|
QWEN_PLUS = "qwen-plus"
|
|
214
214
|
QWEN_TURBO = "qwen-turbo"
|
|
215
|
+
QWEN_PLUS_LATEST = "qwen-plus-latest"
|
|
216
|
+
QWEN_PLUS_2025_04_28 = "qwen-plus-2025-04-28"
|
|
217
|
+
QWEN_TURBO_LATEST = "qwen-turbo-latest"
|
|
218
|
+
QWEN_TURBO_2025_04_28 = "qwen-turbo-2025-04-28"
|
|
215
219
|
QWEN_LONG = "qwen-long"
|
|
216
220
|
QWEN_VL_MAX = "qwen-vl-max"
|
|
217
221
|
QWEN_VL_PLUS = "qwen-vl-plus"
|
|
@@ -270,6 +274,63 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
270
274
|
AIML_MIXTRAL_8X7B = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
|
271
275
|
AIML_MISTRAL_7B_INSTRUCT = "mistralai/Mistral-7B-Instruct-v0.1"
|
|
272
276
|
|
|
277
|
+
# Novita platform models support tool calling
|
|
278
|
+
NOVITA_LLAMA_4_MAVERICK_17B = (
|
|
279
|
+
"meta-llama/llama-4-maverick-17b-128e-instruct-fp8"
|
|
280
|
+
)
|
|
281
|
+
NOVITA_LLAMA_4_SCOUT_17B = "meta-llama/llama-4-scout-17b-16e-instruct"
|
|
282
|
+
NOVITA_DEEPSEEK_V3_0324 = "deepseek/deepseek-v3-0324"
|
|
283
|
+
NOVITA_QWEN_2_5_V1_72B = "qwen/qwen2.5-vl-72b-instruct"
|
|
284
|
+
NOVITA_DEEPSEEK_V3_TURBO = "deepseek/deepseek-v3-turbo"
|
|
285
|
+
NOVITA_DEEPSEEK_R1_TURBO = "deepseek/deepseek-r1-turbo"
|
|
286
|
+
NOVITA_GEMMA_3_27B_IT = "google/gemma-3-27b-it"
|
|
287
|
+
NOVITA_QWEN_32B = "qwen/qwq-32b"
|
|
288
|
+
NOVITA_L3_8B_STHENO_V3_2 = "Sao10K/L3-8B-Stheno-v3.2"
|
|
289
|
+
NOVITA_MYTHOMAX_L2_13B = "gryphe/mythomax-l2-13b"
|
|
290
|
+
NOVITA_DEEPSEEK_R1_DISTILL_LLAMA_8B = (
|
|
291
|
+
"deepseek/deepseek-r1-distill-llama-8b"
|
|
292
|
+
)
|
|
293
|
+
NOVITA_DEEPSEEK_V3 = "deepseek/deepseek_v3"
|
|
294
|
+
NOVITA_LLAMA_3_1_8B = "meta-llama/llama-3.1-8b-instruct"
|
|
295
|
+
NOVITA_DEEPSEEK_R1_DISTILL_QWEN_14B = (
|
|
296
|
+
"deepseek/deepseek-r1-distill-qwen-14b"
|
|
297
|
+
)
|
|
298
|
+
NOVITA_LLAMA_3_3_70B = "meta-llama/llama-3.3-70b-instruct"
|
|
299
|
+
NOVITA_QWEN_2_5_72B = "qwen/qwen-2.5-72b-instruct"
|
|
300
|
+
NOVITA_MISTRAL_NEMO = "mistralai/mistral-nemo"
|
|
301
|
+
NOVITA_DEEPSEEK_R1_DISTILL_QWEN_32B = (
|
|
302
|
+
"deepseek/deepseek-r1-distill-qwen-32b"
|
|
303
|
+
)
|
|
304
|
+
NOVITA_LLAMA_3_8B = "meta-llama/llama-3-8b-instruct"
|
|
305
|
+
NOVITA_WIZARDLM_2_8X22B = "microsoft/wizardlm-2-8x22b"
|
|
306
|
+
NOVITA_DEEPSEEK_R1_DISTILL_LLAMA_70B = (
|
|
307
|
+
"deepseek/deepseek-r1-distill-llama-70b"
|
|
308
|
+
)
|
|
309
|
+
NOVITA_LLAMA_3_1_70B = "meta-llama/llama-3.1-70b-instruct"
|
|
310
|
+
NOVITA_GEMMA_2_9B_IT = "google/gemma-2-9b-it"
|
|
311
|
+
NOVITA_MISTRAL_7B = "mistralai/mistral-7b-instruct"
|
|
312
|
+
NOVITA_LLAMA_3_70B = "meta-llama/llama-3-70b-instruct"
|
|
313
|
+
NOVITA_DEEPSEEK_R1 = "deepseek/deepseek-r1"
|
|
314
|
+
NOVITA_HERMES_2_PRO_LLAMA_3_8B = "nousresearch/hermes-2-pro-llama-3-8b"
|
|
315
|
+
NOVITA_L3_70B_EURYALE_V2_1 = "sao10k/l3-70b-euryale-v2.1"
|
|
316
|
+
NOVITA_DOLPHIN_MIXTRAL_8X22B = (
|
|
317
|
+
"cognitivecomputations/dolphin-mixtral-8x22b"
|
|
318
|
+
)
|
|
319
|
+
NOVITA_AIROBOROS_L2_70B = "jondurbin/airoboros-l2-70b"
|
|
320
|
+
NOVITA_MIDNIGHT_ROSE_70B = "sophosympatheia/midnight-rose-70b"
|
|
321
|
+
NOVITA_L3_8B_LUNARIS = "sao10k/l3-8b-lunaris"
|
|
322
|
+
NOVITA_GLM_4_9B_0414 = "thudm/glm-4-9b-0414"
|
|
323
|
+
NOVITA_GLM_Z1_9B_0414 = "thudm/glm-z1-9b-0414"
|
|
324
|
+
NOVITA_GLM_Z1_32B_0414 = "thudm/glm-z1-32b-0414"
|
|
325
|
+
NOVITA_GLM_4_32B_0414 = "thudm/glm-4-32b-0414"
|
|
326
|
+
NOVITA_GLM_Z1_RUMINATION_32B_0414 = "thudm/glm-z1-rumination-32b-0414"
|
|
327
|
+
NOVITA_QWEN_2_5_7B = "qwen/qwen2.5-7b-instruct"
|
|
328
|
+
NOVITA_LLAMA_3_2_1B = "meta-llama/llama-3.2-1b-instruct"
|
|
329
|
+
NOVITA_LLAMA_3_2_11B_VISION = "meta-llama/llama-3.2-11b-vision-instruct"
|
|
330
|
+
NOVITA_LLAMA_3_2_3B = "meta-llama/llama-3.2-3b-instruct"
|
|
331
|
+
NOVITA_LLAMA_3_1_8B_BF16 = "meta-llama/llama-3.1-8b-instruct-bf16"
|
|
332
|
+
NOVITA_L31_70B_EURYALE_V2_2 = "sao10k/l31-70b-euryale-v2.2"
|
|
333
|
+
|
|
273
334
|
# ModelScope models support tool calling
|
|
274
335
|
MODELSCOPE_QWEN_2_5_7B_INSTRUCT = "Qwen/Qwen2.5-7B-Instruct"
|
|
275
336
|
MODELSCOPE_QWEN_2_5_14B_INSTRUCT = "Qwen/Qwen2.5-14B-Instruct"
|
|
@@ -278,6 +339,8 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
278
339
|
MODELSCOPE_QWEN_2_5_CODER_7B_INSTRUCT = "Qwen/Qwen2.5-Coder-7B-Instruct"
|
|
279
340
|
MODELSCOPE_QWEN_2_5_CODER_14B_INSTRUCT = "Qwen/Qwen2.5-Coder-14B-Instruct"
|
|
280
341
|
MODELSCOPE_QWEN_2_5_CODER_32B_INSTRUCT = "Qwen/Qwen2.5-Coder-32B-Instruct"
|
|
342
|
+
MODELSCOPE_QWEN_3_235B_A22B = "Qwen/Qwen3-235B-A22B"
|
|
343
|
+
MODELSCOPE_QWEN_3_32B = "Qwen/Qwen3-32B"
|
|
281
344
|
MODELSCOPE_QWQ_32B = "Qwen/QwQ-32B"
|
|
282
345
|
MODELSCOPE_QWQ_32B_PREVIEW = "Qwen/QwQ-32B-Preview"
|
|
283
346
|
MODELSCOPE_LLAMA_3_1_8B_INSTRUCT = (
|
|
@@ -293,6 +356,22 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
293
356
|
MODELSCOPE_MINISTRAL_8B_INSTRUCT = "mistralai/Ministral-8B-Instruct-2410"
|
|
294
357
|
MODELSCOPE_DEEPSEEK_V3_0324 = "deepseek-ai/DeepSeek-V3-0324"
|
|
295
358
|
|
|
359
|
+
# WatsonX models
|
|
360
|
+
WATSONX_GRANITE_3_8B_INSTRUCT = "ibm/granite-3-8b-instruct"
|
|
361
|
+
WATSONX_LLAMA_3_3_70B_INSTRUCT = "meta-llama/llama-3-3-70b-instruct"
|
|
362
|
+
WATSONX_LLAMA_3_2_1B_INSTRUCT = "meta-llama/llama-3-2-1b-instruct"
|
|
363
|
+
WATSONX_LLAMA_3_2_3B_INSTRUCT = "meta-llama/llama-3-2-3b-instruct"
|
|
364
|
+
WATSONX_LLAMA_3_2_11B_VISION_INSTRUCT = (
|
|
365
|
+
"meta-llama/llama-3-2-11b-vision-instruct"
|
|
366
|
+
)
|
|
367
|
+
WATSONX_LLAMA_3_2_90B_VISION_INSTRUCT = (
|
|
368
|
+
"meta-llama/llama-3-2-90b-vision-instruct"
|
|
369
|
+
)
|
|
370
|
+
WATSONX_LLAMA_GUARD_3_11B_VISION_INSTRUCT = (
|
|
371
|
+
"meta-llama/llama-guard-3-11b-vision-instruct"
|
|
372
|
+
)
|
|
373
|
+
WATSONX_MISTRAL_LARGE = "mistralai/mistral-large"
|
|
374
|
+
|
|
296
375
|
def __str__(self):
|
|
297
376
|
return self.value
|
|
298
377
|
|
|
@@ -345,6 +424,7 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
345
424
|
self.is_zhipuai,
|
|
346
425
|
self.is_aiml,
|
|
347
426
|
self.is_azure_openai,
|
|
427
|
+
self.is_novita,
|
|
348
428
|
]
|
|
349
429
|
)
|
|
350
430
|
|
|
@@ -609,6 +689,10 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
609
689
|
ModelType.QWEN_QWQ_32B,
|
|
610
690
|
ModelType.QWEN_QVQ_72B,
|
|
611
691
|
ModelType.QWEN_QWQ_PLUS,
|
|
692
|
+
ModelType.QWEN_PLUS_LATEST,
|
|
693
|
+
ModelType.QWEN_PLUS_2025_04_28,
|
|
694
|
+
ModelType.QWEN_TURBO_LATEST,
|
|
695
|
+
ModelType.QWEN_TURBO_2025_04_28,
|
|
612
696
|
}
|
|
613
697
|
|
|
614
698
|
@property
|
|
@@ -664,6 +748,8 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
664
748
|
ModelType.MODELSCOPE_QWEN_2_5_CODER_7B_INSTRUCT,
|
|
665
749
|
ModelType.MODELSCOPE_QWEN_2_5_CODER_14B_INSTRUCT,
|
|
666
750
|
ModelType.MODELSCOPE_QWEN_2_5_CODER_32B_INSTRUCT,
|
|
751
|
+
ModelType.MODELSCOPE_QWEN_3_235B_A22B,
|
|
752
|
+
ModelType.MODELSCOPE_QWEN_3_32B,
|
|
667
753
|
ModelType.MODELSCOPE_QWQ_32B,
|
|
668
754
|
ModelType.MODELSCOPE_QWQ_32B_PREVIEW,
|
|
669
755
|
ModelType.MODELSCOPE_LLAMA_3_1_8B_INSTRUCT,
|
|
@@ -713,6 +799,67 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
713
799
|
ModelType.SILICONFLOW_PRO_THUDM_GLM_4_9B_CHAT,
|
|
714
800
|
}
|
|
715
801
|
|
|
802
|
+
@property
|
|
803
|
+
def is_watsonx(self) -> bool:
|
|
804
|
+
return self in {
|
|
805
|
+
ModelType.WATSONX_GRANITE_3_8B_INSTRUCT,
|
|
806
|
+
ModelType.WATSONX_LLAMA_3_3_70B_INSTRUCT,
|
|
807
|
+
ModelType.WATSONX_LLAMA_3_2_1B_INSTRUCT,
|
|
808
|
+
ModelType.WATSONX_LLAMA_3_2_3B_INSTRUCT,
|
|
809
|
+
ModelType.WATSONX_LLAMA_3_2_11B_VISION_INSTRUCT,
|
|
810
|
+
ModelType.WATSONX_LLAMA_3_2_90B_VISION_INSTRUCT,
|
|
811
|
+
ModelType.WATSONX_LLAMA_GUARD_3_11B_VISION_INSTRUCT,
|
|
812
|
+
ModelType.WATSONX_MISTRAL_LARGE,
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
@property
|
|
816
|
+
def is_novita(self) -> bool:
|
|
817
|
+
return self in {
|
|
818
|
+
ModelType.NOVITA_LLAMA_4_MAVERICK_17B,
|
|
819
|
+
ModelType.NOVITA_LLAMA_4_SCOUT_17B,
|
|
820
|
+
ModelType.NOVITA_DEEPSEEK_V3_0324,
|
|
821
|
+
ModelType.NOVITA_QWEN_2_5_V1_72B,
|
|
822
|
+
ModelType.NOVITA_DEEPSEEK_V3_TURBO,
|
|
823
|
+
ModelType.NOVITA_DEEPSEEK_R1_TURBO,
|
|
824
|
+
ModelType.NOVITA_GEMMA_3_27B_IT,
|
|
825
|
+
ModelType.NOVITA_QWEN_32B,
|
|
826
|
+
ModelType.NOVITA_L3_8B_STHENO_V3_2,
|
|
827
|
+
ModelType.NOVITA_MYTHOMAX_L2_13B,
|
|
828
|
+
ModelType.NOVITA_DEEPSEEK_R1_DISTILL_LLAMA_8B,
|
|
829
|
+
ModelType.NOVITA_DEEPSEEK_V3,
|
|
830
|
+
ModelType.NOVITA_LLAMA_3_1_8B,
|
|
831
|
+
ModelType.NOVITA_DEEPSEEK_R1_DISTILL_QWEN_14B,
|
|
832
|
+
ModelType.NOVITA_LLAMA_3_3_70B,
|
|
833
|
+
ModelType.NOVITA_QWEN_2_5_72B,
|
|
834
|
+
ModelType.NOVITA_MISTRAL_NEMO,
|
|
835
|
+
ModelType.NOVITA_DEEPSEEK_R1_DISTILL_QWEN_32B,
|
|
836
|
+
ModelType.NOVITA_LLAMA_3_8B,
|
|
837
|
+
ModelType.NOVITA_WIZARDLM_2_8X22B,
|
|
838
|
+
ModelType.NOVITA_DEEPSEEK_R1_DISTILL_LLAMA_70B,
|
|
839
|
+
ModelType.NOVITA_LLAMA_3_1_70B,
|
|
840
|
+
ModelType.NOVITA_GEMMA_2_9B_IT,
|
|
841
|
+
ModelType.NOVITA_MISTRAL_7B,
|
|
842
|
+
ModelType.NOVITA_LLAMA_3_70B,
|
|
843
|
+
ModelType.NOVITA_DEEPSEEK_R1,
|
|
844
|
+
ModelType.NOVITA_HERMES_2_PRO_LLAMA_3_8B,
|
|
845
|
+
ModelType.NOVITA_L3_70B_EURYALE_V2_1,
|
|
846
|
+
ModelType.NOVITA_DOLPHIN_MIXTRAL_8X22B,
|
|
847
|
+
ModelType.NOVITA_AIROBOROS_L2_70B,
|
|
848
|
+
ModelType.NOVITA_MIDNIGHT_ROSE_70B,
|
|
849
|
+
ModelType.NOVITA_L3_8B_LUNARIS,
|
|
850
|
+
ModelType.NOVITA_GLM_4_9B_0414,
|
|
851
|
+
ModelType.NOVITA_GLM_Z1_9B_0414,
|
|
852
|
+
ModelType.NOVITA_GLM_Z1_32B_0414,
|
|
853
|
+
ModelType.NOVITA_GLM_4_32B_0414,
|
|
854
|
+
ModelType.NOVITA_GLM_Z1_RUMINATION_32B_0414,
|
|
855
|
+
ModelType.NOVITA_QWEN_2_5_7B,
|
|
856
|
+
ModelType.NOVITA_LLAMA_3_2_1B,
|
|
857
|
+
ModelType.NOVITA_LLAMA_3_2_11B_VISION,
|
|
858
|
+
ModelType.NOVITA_LLAMA_3_2_3B,
|
|
859
|
+
ModelType.NOVITA_LLAMA_3_1_8B_BF16,
|
|
860
|
+
ModelType.NOVITA_L31_70B_EURYALE_V2_2,
|
|
861
|
+
}
|
|
862
|
+
|
|
716
863
|
@property
|
|
717
864
|
def is_aiml(self) -> bool:
|
|
718
865
|
return self in {
|
|
@@ -740,6 +887,9 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
740
887
|
ModelType.COHERE_COMMAND_LIGHT,
|
|
741
888
|
ModelType.NVIDIA_NEMOTRON_340B_INSTRUCT,
|
|
742
889
|
ModelType.NVIDIA_NEMOTRON_340B_REWARD,
|
|
890
|
+
ModelType.NOVITA_MYTHOMAX_L2_13B,
|
|
891
|
+
ModelType.NOVITA_AIROBOROS_L2_70B,
|
|
892
|
+
ModelType.NOVITA_MIDNIGHT_ROSE_70B,
|
|
743
893
|
}:
|
|
744
894
|
return 4_096
|
|
745
895
|
elif self in {
|
|
@@ -761,12 +911,26 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
761
911
|
ModelType.LMSTUDIO_GEMMA_3_4B,
|
|
762
912
|
ModelType.LMSTUDIO_GEMMA_3_12B,
|
|
763
913
|
ModelType.LMSTUDIO_GEMMA_3_27B,
|
|
914
|
+
ModelType.WATSONX_GRANITE_3_8B_INSTRUCT,
|
|
915
|
+
ModelType.NOVITA_L3_8B_STHENO_V3_2,
|
|
916
|
+
ModelType.NOVITA_LLAMA_3_8B,
|
|
917
|
+
ModelType.NOVITA_GEMMA_2_9B_IT,
|
|
918
|
+
ModelType.NOVITA_LLAMA_3_70B,
|
|
919
|
+
ModelType.NOVITA_HERMES_2_PRO_LLAMA_3_8B,
|
|
920
|
+
ModelType.NOVITA_L3_70B_EURYALE_V2_1,
|
|
921
|
+
ModelType.NOVITA_L3_8B_LUNARIS,
|
|
922
|
+
ModelType.NOVITA_LLAMA_3_1_8B_BF16,
|
|
923
|
+
ModelType.NOVITA_L31_70B_EURYALE_V2_2,
|
|
764
924
|
}:
|
|
765
925
|
return 8_192
|
|
766
926
|
elif self in {
|
|
767
927
|
ModelType.PPIO_BAICHUAN_2_13B_CHAT,
|
|
768
928
|
}:
|
|
769
929
|
return 14_336
|
|
930
|
+
elif self in {
|
|
931
|
+
ModelType.NOVITA_DOLPHIN_MIXTRAL_8X22B,
|
|
932
|
+
}:
|
|
933
|
+
return 16_000
|
|
770
934
|
elif self in {
|
|
771
935
|
ModelType.GPT_3_5_TURBO,
|
|
772
936
|
ModelType.YI_LIGHTNING,
|
|
@@ -780,11 +944,21 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
780
944
|
ModelType.GLM_4V_PLUS_0111,
|
|
781
945
|
ModelType.GLM_ZERO_PREVIEW,
|
|
782
946
|
ModelType.PPIO_YI_1_5_34B_CHAT,
|
|
947
|
+
ModelType.NOVITA_LLAMA_3_1_8B,
|
|
783
948
|
}:
|
|
784
949
|
return 16_384
|
|
785
|
-
|
|
786
950
|
elif self in {
|
|
787
951
|
ModelType.NETMIND_DOUBAO_1_5_PRO,
|
|
952
|
+
ModelType.NOVITA_GEMMA_3_27B_IT,
|
|
953
|
+
ModelType.NOVITA_DEEPSEEK_R1_DISTILL_LLAMA_8B,
|
|
954
|
+
ModelType.NOVITA_QWEN_2_5_72B,
|
|
955
|
+
ModelType.NOVITA_DEEPSEEK_R1_DISTILL_LLAMA_70B,
|
|
956
|
+
ModelType.NOVITA_GLM_4_9B_0414,
|
|
957
|
+
ModelType.NOVITA_GLM_Z1_9B_0414,
|
|
958
|
+
ModelType.NOVITA_GLM_Z1_32B_0414,
|
|
959
|
+
ModelType.NOVITA_GLM_4_32B_0414,
|
|
960
|
+
ModelType.NOVITA_GLM_Z1_RUMINATION_32B_0414,
|
|
961
|
+
ModelType.NOVITA_QWEN_2_5_7B,
|
|
788
962
|
}:
|
|
789
963
|
return 32_000
|
|
790
964
|
elif self in {
|
|
@@ -820,6 +994,8 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
820
994
|
ModelType.MODELSCOPE_QWEN_2_5_CODER_7B_INSTRUCT,
|
|
821
995
|
ModelType.MODELSCOPE_QWEN_2_5_CODER_14B_INSTRUCT,
|
|
822
996
|
ModelType.MODELSCOPE_QWEN_2_5_CODER_32B_INSTRUCT,
|
|
997
|
+
ModelType.MODELSCOPE_QWEN_3_235B_A22B,
|
|
998
|
+
ModelType.MODELSCOPE_QWEN_3_32B,
|
|
823
999
|
ModelType.MODELSCOPE_QWQ_32B,
|
|
824
1000
|
ModelType.MODELSCOPE_QWQ_32B_PREVIEW,
|
|
825
1001
|
ModelType.MODELSCOPE_LLAMA_3_1_8B_INSTRUCT,
|
|
@@ -829,6 +1005,12 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
829
1005
|
ModelType.MODELSCOPE_MINISTRAL_8B_INSTRUCT,
|
|
830
1006
|
ModelType.MODELSCOPE_DEEPSEEK_V3_0324,
|
|
831
1007
|
ModelType.OPENROUTER_LLAMA_3_1_405B,
|
|
1008
|
+
ModelType.WATSONX_MISTRAL_LARGE,
|
|
1009
|
+
ModelType.NOVITA_QWEN_32B,
|
|
1010
|
+
ModelType.NOVITA_LLAMA_3_1_70B,
|
|
1011
|
+
ModelType.NOVITA_MISTRAL_7B,
|
|
1012
|
+
ModelType.NOVITA_LLAMA_3_2_11B_VISION,
|
|
1013
|
+
ModelType.NOVITA_LLAMA_3_2_3B,
|
|
832
1014
|
}:
|
|
833
1015
|
return 32_768
|
|
834
1016
|
elif self in {
|
|
@@ -843,8 +1025,22 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
843
1025
|
ModelType.PPIO_DEEPSEEK_V3,
|
|
844
1026
|
ModelType.AWS_DEEPSEEK_R1,
|
|
845
1027
|
ModelType.NETMIND_QWQ_32B,
|
|
1028
|
+
ModelType.NOVITA_DEEPSEEK_V3_TURBO,
|
|
1029
|
+
ModelType.NOVITA_DEEPSEEK_R1_TURBO,
|
|
1030
|
+
ModelType.NOVITA_DEEPSEEK_V3,
|
|
1031
|
+
ModelType.NOVITA_DEEPSEEK_R1_DISTILL_QWEN_14B,
|
|
1032
|
+
ModelType.NOVITA_DEEPSEEK_R1_DISTILL_QWEN_32B,
|
|
1033
|
+
ModelType.NOVITA_DEEPSEEK_R1,
|
|
846
1034
|
}:
|
|
847
1035
|
return 64_000
|
|
1036
|
+
elif self in {
|
|
1037
|
+
ModelType.NOVITA_WIZARDLM_2_8X22B,
|
|
1038
|
+
}:
|
|
1039
|
+
return 65_535
|
|
1040
|
+
elif self in {
|
|
1041
|
+
ModelType.NOVITA_QWEN_2_5_V1_72B,
|
|
1042
|
+
}:
|
|
1043
|
+
return 96_000
|
|
848
1044
|
elif self in {
|
|
849
1045
|
ModelType.CLAUDE_2_0,
|
|
850
1046
|
ModelType.CLAUDE_INSTANT_1_2,
|
|
@@ -894,13 +1090,22 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
894
1090
|
ModelType.AWS_LLAMA_3_2_11B_INSTRUCT,
|
|
895
1091
|
ModelType.NETMIND_DEEPSEEK_R1,
|
|
896
1092
|
ModelType.NETMIND_DEEPSEEK_V3,
|
|
1093
|
+
ModelType.NOVITA_DEEPSEEK_V3_0324,
|
|
897
1094
|
}:
|
|
898
1095
|
return 128_000
|
|
1096
|
+
elif self in {
|
|
1097
|
+
ModelType.NOVITA_LLAMA_3_2_1B,
|
|
1098
|
+
}:
|
|
1099
|
+
return 131_000
|
|
899
1100
|
elif self in {
|
|
900
1101
|
ModelType.GROQ_LLAMA_3_1_8B,
|
|
901
1102
|
ModelType.QWEN_PLUS,
|
|
902
1103
|
ModelType.QWEN_TURBO,
|
|
903
1104
|
ModelType.QWEN_CODER_TURBO,
|
|
1105
|
+
ModelType.QWEN_PLUS_LATEST,
|
|
1106
|
+
ModelType.QWEN_PLUS_2025_04_28,
|
|
1107
|
+
ModelType.QWEN_TURBO_LATEST,
|
|
1108
|
+
ModelType.QWEN_TURBO_2025_04_28,
|
|
904
1109
|
ModelType.TOGETHER_LLAMA_3_1_8B,
|
|
905
1110
|
ModelType.TOGETHER_LLAMA_3_1_70B,
|
|
906
1111
|
ModelType.TOGETHER_LLAMA_3_1_405B,
|
|
@@ -911,6 +1116,15 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
911
1116
|
ModelType.OPENROUTER_LLAMA_3_1_70B,
|
|
912
1117
|
ModelType.PPIO_LLAMA_3_3_70B,
|
|
913
1118
|
ModelType.OPENROUTER_LLAMA_4_SCOUT,
|
|
1119
|
+
ModelType.WATSONX_LLAMA_3_3_70B_INSTRUCT,
|
|
1120
|
+
ModelType.WATSONX_LLAMA_3_2_1B_INSTRUCT,
|
|
1121
|
+
ModelType.WATSONX_LLAMA_3_2_3B_INSTRUCT,
|
|
1122
|
+
ModelType.WATSONX_LLAMA_3_2_11B_VISION_INSTRUCT,
|
|
1123
|
+
ModelType.WATSONX_LLAMA_3_2_90B_VISION_INSTRUCT,
|
|
1124
|
+
ModelType.WATSONX_LLAMA_GUARD_3_11B_VISION_INSTRUCT,
|
|
1125
|
+
ModelType.NOVITA_LLAMA_4_SCOUT_17B,
|
|
1126
|
+
ModelType.NOVITA_LLAMA_3_3_70B,
|
|
1127
|
+
ModelType.NOVITA_MISTRAL_NEMO,
|
|
914
1128
|
}:
|
|
915
1129
|
return 131_072
|
|
916
1130
|
elif self in {
|
|
@@ -961,6 +1175,7 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
961
1175
|
ModelType.GPT_4_1,
|
|
962
1176
|
ModelType.GPT_4_1_MINI,
|
|
963
1177
|
ModelType.GPT_4_1_NANO,
|
|
1178
|
+
ModelType.NOVITA_LLAMA_4_MAVERICK_17B,
|
|
964
1179
|
}:
|
|
965
1180
|
return 1_048_576
|
|
966
1181
|
elif self in {
|
|
@@ -1159,6 +1374,8 @@ class ModelPlatformType(Enum):
|
|
|
1159
1374
|
AIML = "aiml"
|
|
1160
1375
|
VOLCANO = "volcano"
|
|
1161
1376
|
NETMIND = "netmind"
|
|
1377
|
+
NOVITA = "novita"
|
|
1378
|
+
WATSONX = "watsonx"
|
|
1162
1379
|
|
|
1163
1380
|
@classmethod
|
|
1164
1381
|
def from_name(cls, name):
|
|
@@ -1324,6 +1541,11 @@ class ModelPlatformType(Enum):
|
|
|
1324
1541
|
r"""Returns whether this platform is volcano."""
|
|
1325
1542
|
return self is ModelPlatformType.VOLCANO
|
|
1326
1543
|
|
|
1544
|
+
@property
|
|
1545
|
+
def is_novita(self) -> bool:
|
|
1546
|
+
r"""Returns whether this platform is Novita."""
|
|
1547
|
+
return self is ModelPlatformType.NOVITA
|
|
1548
|
+
|
|
1327
1549
|
|
|
1328
1550
|
class AudioModelType(Enum):
|
|
1329
1551
|
TTS_1 = "tts-1"
|
|
@@ -153,6 +153,16 @@ class UnifiedModelType(str):
|
|
|
153
153
|
r"""Returns whether this platform is Moonshot model."""
|
|
154
154
|
return True
|
|
155
155
|
|
|
156
|
+
@property
|
|
157
|
+
def is_novita(self) -> bool:
|
|
158
|
+
r"""Returns whether the model is a Novita served model."""
|
|
159
|
+
return True
|
|
160
|
+
|
|
161
|
+
@property
|
|
162
|
+
def is_watsonx(self) -> bool:
|
|
163
|
+
r"""Returns whether the model is a WatsonX served model."""
|
|
164
|
+
return True
|
|
165
|
+
|
|
156
166
|
@property
|
|
157
167
|
def support_native_structured_output(self) -> bool:
|
|
158
168
|
r"""Returns whether the model supports native structured output."""
|
camel/utils/__init__.py
CHANGED
|
@@ -41,6 +41,7 @@ from .commons import (
|
|
|
41
41
|
)
|
|
42
42
|
from .constants import Constants
|
|
43
43
|
from .deduplication import DeduplicationResult, deduplicate_internally
|
|
44
|
+
from .filename import sanitize_filename
|
|
44
45
|
from .mcp import MCPServer
|
|
45
46
|
from .response_format import get_pydantic_model
|
|
46
47
|
from .token_counting import (
|
|
@@ -90,4 +91,5 @@ __all__ = [
|
|
|
90
91
|
"BatchProcessor",
|
|
91
92
|
"with_timeout",
|
|
92
93
|
"MCPServer",
|
|
94
|
+
"sanitize_filename",
|
|
93
95
|
]
|
camel/utils/filename.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
# you may not use this file except in compliance with the License.
|
|
4
|
+
# You may obtain a copy of the License at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
# See the License for the specific language governing permissions and
|
|
12
|
+
# limitations under the License.
|
|
13
|
+
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
|
+
import platform
|
|
15
|
+
import re
|
|
16
|
+
import unicodedata
|
|
17
|
+
|
|
18
|
+
MAX_FILENAME_LENGTH = 255
|
|
19
|
+
WINDOWS_RESERVED = {
|
|
20
|
+
'CON',
|
|
21
|
+
'PRN',
|
|
22
|
+
'AUX',
|
|
23
|
+
'NUL',
|
|
24
|
+
'COM1',
|
|
25
|
+
'COM2',
|
|
26
|
+
'COM3',
|
|
27
|
+
'COM4',
|
|
28
|
+
'LPT1',
|
|
29
|
+
'LPT2',
|
|
30
|
+
'LPT3',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def sanitize_filename(
|
|
35
|
+
url_name: str,
|
|
36
|
+
default: str = "index",
|
|
37
|
+
max_length: int = MAX_FILENAME_LENGTH,
|
|
38
|
+
) -> str:
|
|
39
|
+
r"""Sanitize a URL path into a safe filename that is safe for
|
|
40
|
+
most platforms.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
url_name (str): The URL path to sanitize.
|
|
44
|
+
default (str): Default name if sanitization results in empty string.
|
|
45
|
+
(default: :obj:`"index"`)
|
|
46
|
+
max_length (int): Maximum length of the filename.
|
|
47
|
+
(default: :obj:`MAX_FILENAME_LENGTH`)
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
str: A sanitized filename safe for most platforms.
|
|
51
|
+
"""
|
|
52
|
+
if max_length < 1:
|
|
53
|
+
raise ValueError(
|
|
54
|
+
f"`max_length` must be greater than " f"0, got {max_length}"
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
if not url_name:
|
|
58
|
+
return default
|
|
59
|
+
|
|
60
|
+
# Normalize Unicode characters by removing characters
|
|
61
|
+
# such as accents and special characters:
|
|
62
|
+
# café☕.txt -> cafe.txt
|
|
63
|
+
url_name = unicodedata.normalize('NFKD', url_name)
|
|
64
|
+
url_name = url_name.encode('ASCII', 'ignore').decode('ASCII')
|
|
65
|
+
|
|
66
|
+
# Replace special characters such as:
|
|
67
|
+
# Separators: my/file:name*.txt -> my_file_name.txt etc.
|
|
68
|
+
url_name = re.sub(r'[\\/:*?"<>|.]', '_', url_name)
|
|
69
|
+
url_name = re.sub(r'_+', '_', url_name) # Collapse multiple underscores
|
|
70
|
+
url_name = url_name.strip('_') # Remove leading/trailing underscores
|
|
71
|
+
|
|
72
|
+
# Handle empty result if all characters are invalid:
|
|
73
|
+
if not url_name:
|
|
74
|
+
return default
|
|
75
|
+
|
|
76
|
+
# Handle Windows reserved names
|
|
77
|
+
if platform.system() == "Windows" and url_name.upper() in WINDOWS_RESERVED:
|
|
78
|
+
url_name = f"_{url_name}"
|
|
79
|
+
|
|
80
|
+
return url_name[:max_length]
|
camel/verifiers/__init__.py
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
from .base import BaseVerifier
|
|
15
15
|
from .math_verifier import MathVerifier
|
|
16
16
|
from .models import VerificationOutcome
|
|
17
|
+
from .physics_verifier import PhysicsVerifier
|
|
17
18
|
from .python_verifier import PythonVerifier
|
|
18
19
|
|
|
19
20
|
__all__ = [
|
|
@@ -21,4 +22,5 @@ __all__ = [
|
|
|
21
22
|
"VerificationOutcome",
|
|
22
23
|
"PythonVerifier",
|
|
23
24
|
"MathVerifier",
|
|
25
|
+
"PhysicsVerifier",
|
|
24
26
|
]
|