gomyck-tools 1.3.7__py3-none-any.whl → 1.3.8__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.
- ctools/ai/llm_client.py +2 -2
- ctools/aio_web_server.py +3 -3
- {gomyck_tools-1.3.7.dist-info → gomyck_tools-1.3.8.dist-info}/METADATA +1 -1
- {gomyck_tools-1.3.7.dist-info → gomyck_tools-1.3.8.dist-info}/RECORD +7 -7
- {gomyck_tools-1.3.7.dist-info → gomyck_tools-1.3.8.dist-info}/WHEEL +0 -0
- {gomyck_tools-1.3.7.dist-info → gomyck_tools-1.3.8.dist-info}/licenses/LICENSE +0 -0
- {gomyck_tools-1.3.7.dist-info → gomyck_tools-1.3.8.dist-info}/top_level.txt +0 -0
ctools/ai/llm_client.py
CHANGED
@@ -68,7 +68,7 @@ class LLMClient:
|
|
68
68
|
try:
|
69
69
|
req_url = "chat/completions"
|
70
70
|
if self.stream:
|
71
|
-
async with httpx.AsyncClient(timeout=
|
71
|
+
async with httpx.AsyncClient(timeout=httpx.Timeout(600), base_url=url) as client:
|
72
72
|
async with client.stream("POST", req_url, headers=headers, json=payload) as response:
|
73
73
|
response.raise_for_status()
|
74
74
|
# 兼容 DS QWEN 的思维链
|
@@ -100,7 +100,7 @@ class LLMClient:
|
|
100
100
|
# 兼容 DS QWEN 的思维链
|
101
101
|
yield content
|
102
102
|
else:
|
103
|
-
async with httpx.AsyncClient(timeout=
|
103
|
+
async with httpx.AsyncClient(timeout=httpx.Timeout(600), base_url=url) as client:
|
104
104
|
response = await client.post(req_url, headers=headers, json=payload)
|
105
105
|
response.raise_for_status()
|
106
106
|
content = response.json()["choices"][0]["message"]["content"]
|
ctools/aio_web_server.py
CHANGED
@@ -23,11 +23,11 @@ async def response_wrapper_middleware(request, handler):
|
|
23
23
|
if isinstance(result, web.Response):
|
24
24
|
return result
|
25
25
|
elif isinstance(result, str):
|
26
|
-
return web.Response(text=result)
|
26
|
+
return web.Response(text=result, content_type='application/json')
|
27
27
|
else:
|
28
|
-
return web.Response(text=cjson.dumps(result))
|
28
|
+
return web.Response(text=cjson.dumps(result), content_type='application/json')
|
29
29
|
except Exception as e:
|
30
|
-
return web.json_response(text=R.error(str(e)), status=200)
|
30
|
+
return web.json_response(text=R.error(str(e)), status=200, content_type='application/json')
|
31
31
|
|
32
32
|
class AioHttpServer:
|
33
33
|
def __init__(self, port: int = DEFAULT_PORT, app: Optional[web.Application] = None, routes: Optional[web.RouteTableDef] = None, async_func = None):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
ctools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
ctools/aes_tools.py,sha256=L5Jg4QtVTdIxHe9zEpR8oMQx0IrYK68vjEYb_RmkhPA,699
|
3
|
-
ctools/aio_web_server.py,sha256=
|
3
|
+
ctools/aio_web_server.py,sha256=F6A0ZC7Crcj7SKbY4o9BhC7LBH-yywcYFluGS9knVMU,4845
|
4
4
|
ctools/api_result.py,sha256=UeQXI_zuZB-uY5qECTpz1fC7EGy82yGQqWMx20tyRTw,1572
|
5
5
|
ctools/application.py,sha256=DcuSt2m8cDuSftx6eKfJ5gA6_F9dDlzkj0K86EG4F7s,15884
|
6
6
|
ctools/b64.py,sha256=_BdhX3p3-MaSSlU2wivN5qPxQfacR3VRBr1WC456tU0,194
|
@@ -61,7 +61,7 @@ ctools/work_path.py,sha256=OmfYu-Jjg2huRY6Su8zJ_2EGFFhtBZFbobYTwbjJtG4,1817
|
|
61
61
|
ctools/ai/__init__.py,sha256=gTYAICILq48icnFbg0HCbsQO8PbU02EDOQ0JeMvfqTY,98
|
62
62
|
ctools/ai/env_config.py,sha256=hOuDVjyK00Ioq1G2z9Plf20TQha0tMV-VHWKAeCv16s,990
|
63
63
|
ctools/ai/llm_chat.py,sha256=xcjk9ALp9GfTlcHGCMOTYi7MuWoBFB73bmKAL9NedfY,8433
|
64
|
-
ctools/ai/llm_client.py,sha256=
|
64
|
+
ctools/ai/llm_client.py,sha256=T0vQrGLMsnk3cw2K3g5rMw2xp8C9AFHUpzTBV6iBJo4,5126
|
65
65
|
ctools/ai/mcp/__init__.py,sha256=gTYAICILq48icnFbg0HCbsQO8PbU02EDOQ0JeMvfqTY,98
|
66
66
|
ctools/ai/mcp/mcp_client.py,sha256=HLoGN-yCL5vMxwxcZMmXQyWof-nmp1KjrPrXQ46KGQs,11525
|
67
67
|
ctools/ai/tools/__init__.py,sha256=gPc-ViRgtFlfX7JUbk5wQZ3wkJ5Ylh14CIqPwa83VPs,98
|
@@ -69,8 +69,8 @@ ctools/ai/tools/json_extract.py,sha256=bgubZ2RwTo_R1X0CzMnvBWu61hglB1l6oO553645R
|
|
69
69
|
ctools/ai/tools/think_process.py,sha256=RGU9j3_O328Byw05ILek-aMfFBczbly2RA-QRouqUjM,257
|
70
70
|
ctools/ai/tools/tool_use_xml_parse.py,sha256=zpHKMhU5LFSpuznU_Z5w_HHp-Bney-Te8DxoU1BNHZ0,1429
|
71
71
|
ctools/ai/tools/xml_extract.py,sha256=KTzsrJZDKmpJ-92yTO6z5nJ9a183ngF6ikTb4oiIjW4,246
|
72
|
-
gomyck_tools-1.3.
|
73
|
-
gomyck_tools-1.3.
|
74
|
-
gomyck_tools-1.3.
|
75
|
-
gomyck_tools-1.3.
|
76
|
-
gomyck_tools-1.3.
|
72
|
+
gomyck_tools-1.3.8.dist-info/licenses/LICENSE,sha256=X25ypfH9E6VTht2hcO8k7LCSdHUcoG_ALQt80jdYZfY,547
|
73
|
+
gomyck_tools-1.3.8.dist-info/METADATA,sha256=GeMbxUCQWbsNI2suCHGrlrTufe4Rm4lWTXbH52i8quI,1595
|
74
|
+
gomyck_tools-1.3.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
75
|
+
gomyck_tools-1.3.8.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
|
76
|
+
gomyck_tools-1.3.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|