We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13e29a9 commit 2782c8cCopy full SHA for 2782c8c
pkg/provider/modelmgr/requesters/anthropicmsgs.py
@@ -4,6 +4,8 @@
4
import json
5
import traceback
6
import base64
7
+import platform
8
+import socket
9
10
import anthropic
11
import httpx
@@ -23,6 +25,12 @@ class AnthropicMessages(requester.LLMAPIRequester):
23
25
client: anthropic.AsyncAnthropic
24
26
27
async def initialize(self):
28
+ # 兼容 Windows 缺失 TCP_KEEPINTVL 和 TCP_KEEPCNT 的问题
29
+ if platform.system() == "Windows":
30
+ if not hasattr(socket, "TCP_KEEPINTVL"):
31
+ socket.TCP_KEEPINTVL = 0
32
+ if not hasattr(socket, "TCP_KEEPCNT"):
33
+ socket.TCP_KEEPCNT = 0
34
35
httpx_client = anthropic._base_client.AsyncHttpxClientWrapper(
36
base_url=self.ap.provider_cfg.data['requester']['anthropic-messages']['base-url'].replace(' ', ''),
0 commit comments