MeUtils 2025.2.6.19.56.59__py3-none-any.whl → 2025.2.11.18.25.28__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.
Files changed (31) hide show
  1. {MeUtils-2025.2.6.19.56.59.dist-info → MeUtils-2025.2.11.18.25.28.dist-info}/METADATA +26 -26
  2. {MeUtils-2025.2.6.19.56.59.dist-info → MeUtils-2025.2.11.18.25.28.dist-info}/RECORD +31 -26
  3. examples/_openaisdk/openai_chatfire.py +21 -9
  4. examples/_openaisdk/openai_modelscope.py +1 -1
  5. examples/_openaisdk/openai_v.py +38 -0
  6. examples/_openaisdk/openai_x.py +22 -1
  7. examples/_openaisdk/testDeepseek.py +67 -0
  8. meutils/apis/images/edits.py +6 -5
  9. meutils/apis/jimeng/images.py +6 -5
  10. meutils/apis/search/metaso.py +6 -19
  11. meutils/caches/acache.py +10 -10
  12. meutils/caches/c.py +29 -0
  13. meutils/caches/redis_.py +26 -0
  14. meutils/caches/redis_cache.py +0 -2
  15. meutils/caches/redis_mulit.py +30 -0
  16. meutils/data/VERSION +1 -1
  17. meutils/data/oneapi/NOTICE.md +11 -1
  18. meutils/llm/clients.py +19 -7
  19. meutils/llm/completions/agents/search.py +11 -7
  20. meutils/llm/completions/reasoner.py +27 -17
  21. meutils/llm/openai_utils/common.py +2 -1
  22. meutils/oss/minio_oss.py +2 -0
  23. meutils/schemas/image_types.py +1 -1
  24. meutils/schemas/metaso_types.py +16 -5
  25. meutils/schemas/oneapi/common.py +98 -25
  26. meutils/schemas/openai_types.py +19 -15
  27. meutils/serving/fastapi/exceptions/http_error.py +2 -2
  28. {MeUtils-2025.2.6.19.56.59.dist-info → MeUtils-2025.2.11.18.25.28.dist-info}/LICENSE +0 -0
  29. {MeUtils-2025.2.6.19.56.59.dist-info → MeUtils-2025.2.11.18.25.28.dist-info}/WHEEL +0 -0
  30. {MeUtils-2025.2.6.19.56.59.dist-info → MeUtils-2025.2.11.18.25.28.dist-info}/entry_points.txt +0 -0
  31. {MeUtils-2025.2.6.19.56.59.dist-info → MeUtils-2025.2.11.18.25.28.dist-info}/top_level.txt +0 -0
@@ -74,13 +74,13 @@ class ChatCompletionChunk(_ChatCompletionChunk):
74
74
 
75
75
 
76
76
  chat_completion = ChatCompletion(
77
- choices=[Choice(message=ChatCompletionMessage(content=""))]
77
+ choices=[Choice(message=ChatCompletionMessage(reasoning_content="", content=""))]
78
78
  )
79
79
  chat_completion_chunk = ChatCompletionChunk(
80
- choices=[ChunkChoice(delta=ChoiceDelta(content=""))]
80
+ choices=[ChunkChoice(delta=ChoiceDelta(reasoning_content="", content=""))]
81
81
  )
82
82
  chat_completion_chunk_stop = ChatCompletionChunk(
83
- choices=[ChunkChoice(delta=ChoiceDelta(content=""), finish_reason="stop")]
83
+ choices=[ChunkChoice(delta=ChoiceDelta(reasoning_content="", content=""), finish_reason="stop")]
84
84
  )
85
85
 
86
86
 
@@ -352,15 +352,19 @@ if __name__ == '__main__':
352
352
  #
353
353
  #
354
354
  # print(A(n=11))
355
- messages = [
356
- {
357
- "role": "user",
358
- "content": [{'role': 'user', 'content': [{"type": "image_url", "image_url": "这是个图片链接"}]}]
359
- },
360
-
361
- # {'role': 'user', 'content': [{"type": "image_url", "image_url": {"url": "这是个图片链接"}}]},
362
- ]
363
-
364
- r = ChatCompletionRequest(model="gpt-3.5-turbo", messages=messages)
365
- r.messages[-1]['content'] = [{"type": "image_url", "image_url": {"url": r.urls[-1]}}]
366
- print(r)
355
+ # messages = [
356
+ # {
357
+ # "role": "user",
358
+ # "content": [{'role': 'user', 'content': [{"type": "image_url", "image_url": "这是个图片链接"}]}]
359
+ # },
360
+ #
361
+ # # {'role': 'user', 'content': [{"type": "image_url", "image_url": {"url": "这是个图片链接"}}]},
362
+ # ]
363
+ #
364
+ # r = ChatCompletionRequest(model="gpt-3.5-turbo", messages=messages)
365
+ # r.messages[-1]['content'] = [{"type": "image_url", "image_url": {"url": r.urls[-1]}}]
366
+ # print(r)
367
+
368
+ print(chat_completion_chunk)
369
+ print(chat_completion)
370
+ print(chat_completion_chunk_stop)
@@ -42,6 +42,7 @@ async def general_exception_handler(request: Request, exc: Exception):
42
42
 
43
43
 
44
44
  async def chatfire_api_exception_handler(request: Request, exc: Exception):
45
+
45
46
  content = {
46
47
  "error":
47
48
  {
@@ -54,7 +55,6 @@ async def chatfire_api_exception_handler(request: Request, exc: Exception):
54
55
 
55
56
  # 默认值
56
57
  reps = None
57
- request_json = {"body": await request.body()}
58
58
  if isinstance(exc, (HTTPStatusError, APIStatusError)):
59
59
  status_code = exc.response.status_code or 500
60
60
 
@@ -71,7 +71,7 @@ async def chatfire_api_exception_handler(request: Request, exc: Exception):
71
71
  if any(code in content_detail for code in {'451', }):
72
72
  content_detail = ""
73
73
 
74
- send_message([request_json, content, content_detail])
74
+ send_message([content, content_detail])
75
75
 
76
76
  return reps or JSONResponse(
77
77
  content=content,