aient 1.1.14__py3-none-any.whl → 1.1.16__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.
- aient/core/request.py +11 -2
- aient/prompt/agent.py +1 -0
- {aient-1.1.14.dist-info → aient-1.1.16.dist-info}/METADATA +1 -1
- {aient-1.1.14.dist-info → aient-1.1.16.dist-info}/RECORD +7 -7
- {aient-1.1.14.dist-info → aient-1.1.16.dist-info}/WHEEL +0 -0
- {aient-1.1.14.dist-info → aient-1.1.16.dist-info}/licenses/LICENSE +0 -0
- {aient-1.1.14.dist-info → aient-1.1.16.dist-info}/top_level.txt +0 -0
aient/core/request.py
CHANGED
@@ -1510,9 +1510,10 @@ async def get_claude_payload(request, engine, provider, api_key=None):
|
|
1510
1510
|
payload = {
|
1511
1511
|
"model": original_model,
|
1512
1512
|
"messages": messages,
|
1513
|
-
"system": system_prompt or "You are Claude, a large language model trained by Anthropic.",
|
1514
1513
|
"max_tokens": max_tokens,
|
1515
1514
|
}
|
1515
|
+
if system_prompt:
|
1516
|
+
payload["system"] = system_prompt
|
1516
1517
|
|
1517
1518
|
if request.max_tokens:
|
1518
1519
|
payload["max_tokens"] = int(request.max_tokens)
|
@@ -1560,7 +1561,7 @@ async def get_claude_payload(request, engine, provider, api_key=None):
|
|
1560
1561
|
payload.pop("tools", None)
|
1561
1562
|
payload.pop("tool_choice", None)
|
1562
1563
|
|
1563
|
-
if "think" in request.model:
|
1564
|
+
if "think" in request.model.lower():
|
1564
1565
|
payload["thinking"] = {
|
1565
1566
|
"budget_tokens": 4096,
|
1566
1567
|
"type": "enabled"
|
@@ -1586,6 +1587,14 @@ async def get_claude_payload(request, engine, provider, api_key=None):
|
|
1586
1587
|
payload.pop("top_k", None)
|
1587
1588
|
# print("payload", json.dumps(payload, indent=2, ensure_ascii=False))
|
1588
1589
|
|
1590
|
+
if safe_get(provider, "preferences", "post_body_parameter_overrides", default=None):
|
1591
|
+
for key, value in safe_get(provider, "preferences", "post_body_parameter_overrides", default={}).items():
|
1592
|
+
if key == request.model:
|
1593
|
+
for k, v in value.items():
|
1594
|
+
payload[k] = v
|
1595
|
+
elif all(_model not in request.model.lower() for _model in ["gemini", "gpt", "claude"]):
|
1596
|
+
payload[key] = value
|
1597
|
+
|
1589
1598
|
return url, headers, payload
|
1590
1599
|
|
1591
1600
|
async def get_dalle_payload(request, engine, provider, api_key=None):
|
aient/prompt/agent.py
CHANGED
@@ -44,6 +44,7 @@ system_prompt = """
|
|
44
44
|
2. Always respond in 中文。
|
45
45
|
3. 尽力满足user的请求,如果 user 要求你使用工具,请自行根据工具的参数要求,组织参数,将工具调用组织成xml格式,即可触发工具执行流程。如果user提供了明确的xml工具调用,请直接复述user的xml工具调用。你必须复述user的xml工具调用才能真正调用工具。
|
46
46
|
4. 禁止要求user调用工具,当你需要调用工具时,请自行组织参数,将工具调用组织成xml格式,即可触发工具执行流程。禁止自己没有使用xml格式调用工具就假定工具已经调用。
|
47
|
+
5. 仔细阅读并理解 user 的任务描述和当前指令。user 会根据任务描述分步骤让你执行,因此请严格遵循 user 指令按步骤操作,并请勿自行完成 user 未指定的步骤。在 user 明确给出下一步指令前,绝不擅自行动或推测、执行任何未明确要求的后续步骤。完成当前 user 指定的步骤后,必须主动向 user 汇报该步骤的完成情况,并明确请求 user 提供下一步的操作指令。
|
47
48
|
</communication>
|
48
49
|
|
49
50
|
<making_code_changes>
|
@@ -4,7 +4,7 @@ aient/core/.gitignore,sha256=5JRRlYYsqt_yt6iFvvzhbqh2FTUQMqwo6WwIuFzlGR8,13
|
|
4
4
|
aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
|
5
5
|
aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
|
6
6
|
aient/core/models.py,sha256=kF-HLi1I2k_G5r153ZHuiGH8_NmpTlFMfK0_myB28YQ,7366
|
7
|
-
aient/core/request.py,sha256=
|
7
|
+
aient/core/request.py,sha256=2u_vPJjoIqRsKOPOkPilGzM4iZXUpsx5xtouQy87Z4E,65693
|
8
8
|
aient/core/response.py,sha256=Z0Bjl_QvpUguyky1LIcsVks4BKKqT0eYEpDmKa_cwpQ,31978
|
9
9
|
aient/core/utils.py,sha256=-naFCv8V-qhnqvDUd8BNbW1HR9CVAPxISrXoAz464Qg,26580
|
10
10
|
aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
|
@@ -34,12 +34,12 @@ aient/plugins/run_python.py,sha256=dgcUwBunMuDkaSKR5bToudVzSdrXVewktDDFUz_iIOQ,4
|
|
34
34
|
aient/plugins/websearch.py,sha256=llxy1U0vJiNMiKvamMr4p7IruLb3nnDR4YErz8TYimc,15215
|
35
35
|
aient/plugins/write_file.py,sha256=YRvQKMvV-5lwohxlvwt9hjfxz2dRJP85AJWAMUIqbBY,3804
|
36
36
|
aient/prompt/__init__.py,sha256=GBtn6-JDT8KHFCcuPpfSNE_aGddg5p4FEyMCy4BfwGs,20
|
37
|
-
aient/prompt/agent.py,sha256=
|
37
|
+
aient/prompt/agent.py,sha256=ZNsbgXRyvYzAFTRRziAnNVqcTyAnxrGcsGfGrt72j6k,25427
|
38
38
|
aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
39
|
aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
|
40
40
|
aient/utils/scripts.py,sha256=LD8adnfuRrJoY2tWKseXOPJXaxbrUmz4czsnUvHswNY,29096
|
41
|
-
aient-1.1.
|
42
|
-
aient-1.1.
|
43
|
-
aient-1.1.
|
44
|
-
aient-1.1.
|
45
|
-
aient-1.1.
|
41
|
+
aient-1.1.16.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
|
42
|
+
aient-1.1.16.dist-info/METADATA,sha256=EACbilSjnciPgk_kcFWFTX-n2J6FcJj6Byh_JQkdICI,4968
|
43
|
+
aient-1.1.16.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
44
|
+
aient-1.1.16.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
|
45
|
+
aient-1.1.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|