local-openai2anthropic 0.2.4__tar.gz → 0.2.5__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 (33) hide show
  1. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/PKG-INFO +2 -1
  2. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/README.md +1 -0
  3. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/README_zh.md +1 -0
  4. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/pyproject.toml +1 -1
  5. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/__init__.py +1 -1
  6. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/converter.py +2 -2
  7. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/router.py +2 -2
  8. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/.github/workflows/publish.yml +0 -0
  9. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/.gitignore +0 -0
  10. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/LICENSE +0 -0
  11. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/examples/basic_chat.py +0 -0
  12. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/examples/streaming.py +0 -0
  13. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/examples/thinking_mode.py +0 -0
  14. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/examples/tool_calling.py +0 -0
  15. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/examples/vision.py +0 -0
  16. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/examples/web_search.py +0 -0
  17. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/__main__.py +0 -0
  18. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/config.py +0 -0
  19. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/daemon.py +0 -0
  20. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/daemon_runner.py +0 -0
  21. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/main.py +0 -0
  22. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/openai_types.py +0 -0
  23. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/protocol.py +0 -0
  24. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/server_tools/__init__.py +0 -0
  25. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/server_tools/base.py +0 -0
  26. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/server_tools/web_search.py +0 -0
  27. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/src/local_openai2anthropic/tavily_client.py +0 -0
  28. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/tests/__init__.py +0 -0
  29. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/tests/test_converter.py +0 -0
  30. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/tests/test_integration.py +0 -0
  31. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/tests/test_router.py +0 -0
  32. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/tests/test_upstream.sh +0 -0
  33. {local_openai2anthropic-0.2.4 → local_openai2anthropic-0.2.5}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: local-openai2anthropic
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: A lightweight proxy server that converts Anthropic Messages API to OpenAI API
5
5
  Project-URL: Homepage, https://github.com/dongfangzan/local-openai2anthropic
6
6
  Project-URL: Repository, https://github.com/dongfangzan/local-openai2anthropic
@@ -55,6 +55,7 @@ This proxy translates Claude SDK calls to OpenAI API format in real-time, enabli
55
55
  - **Offline development** without cloud API costs
56
56
  - **Privacy-first AI** - data never leaves your machine
57
57
  - **Seamless model switching** between cloud and local
58
+ - **Web Search tool** - built-in Tavily web search for local models
58
59
 
59
60
  ---
60
61
 
@@ -20,6 +20,7 @@ This proxy translates Claude SDK calls to OpenAI API format in real-time, enabli
20
20
  - **Offline development** without cloud API costs
21
21
  - **Privacy-first AI** - data never leaves your machine
22
22
  - **Seamless model switching** between cloud and local
23
+ - **Web Search tool** - built-in Tavily web search for local models
23
24
 
24
25
  ---
25
26
 
@@ -20,6 +20,7 @@
20
20
  - **离线开发** - 无需支付云 API 费用
21
21
  - **隐私优先** - 数据不出本机
22
22
  - **灵活切换** - 云端和本地模型无缝切换
23
+ - **网络搜索** - 内置 Tavily 网页搜索工具,为本地模型提供联网能力
23
24
 
24
25
  ---
25
26
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "local-openai2anthropic"
3
- version = "0.2.4"
3
+ version = "0.2.5"
4
4
  description = "A lightweight proxy server that converts Anthropic Messages API to OpenAI API"
5
5
  readme = "README.md"
6
6
  license = { text = "Apache-2.0" }
@@ -3,7 +3,7 @@
3
3
  local-openai2anthropic: A proxy server that converts Anthropic Messages API to OpenAI API.
4
4
  """
5
5
 
6
- __version__ = "0.2.4"
6
+ __version__ = "0.2.5"
7
7
 
8
8
  from local_openai2anthropic.protocol import (
9
9
  AnthropicError,
@@ -49,11 +49,11 @@ def convert_anthropic_to_openai(
49
49
  system = anthropic_params.get("system")
50
50
  stop_sequences = anthropic_params.get("stop_sequences")
51
51
  stream = anthropic_params.get("stream", False)
52
- temperature = anthropic_params.get("temperature")
52
+ temperature = anthropic_params.get("temperature", 0.6)
53
53
  tool_choice = anthropic_params.get("tool_choice")
54
54
  tools = anthropic_params.get("tools")
55
55
  top_k = anthropic_params.get("top_k")
56
- top_p = anthropic_params.get("top_p")
56
+ top_p = anthropic_params.get("top_p", 0.95)
57
57
  thinking = anthropic_params.get("thinking")
58
58
  # metadata is accepted but not forwarded to OpenAI
59
59
 
@@ -406,7 +406,7 @@ async def _handle_with_server_tools(
406
406
  async with httpx.AsyncClient(timeout=settings.request_timeout) as client:
407
407
  try:
408
408
  # Log full request for debugging
409
- logger.info(f"Request body: {json.dumps(params, indent=2, default=str)[:3000]}")
409
+ logger.debug(f"Request body: {json.dumps(params, indent=2, default=str)[:3000]}")
410
410
 
411
411
  response = await client.post(url, headers=headers, json=params)
412
412
 
@@ -421,7 +421,7 @@ async def _handle_with_server_tools(
421
421
  )
422
422
 
423
423
  completion_data = response.json()
424
- logger.info(f"OpenAI response: {json.dumps(completion_data, indent=2)[:500]}...")
424
+ logger.debug(f"OpenAI response: {json.dumps(completion_data, indent=2)[:500]}...")
425
425
  from openai.types.chat import ChatCompletion
426
426
  completion = ChatCompletion.model_validate(completion_data)
427
427