aient 1.1.39__tar.gz → 1.1.41__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.
- {aient-1.1.39/src/aient.egg-info → aient-1.1.41}/PKG-INFO +1 -1
- {aient-1.1.39 → aient-1.1.41}/setup.py +1 -1
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/request.py +11 -17
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/response.py +9 -12
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/utils.py +1 -0
- {aient-1.1.39 → aient-1.1.41/src/aient.egg-info}/PKG-INFO +1 -1
- {aient-1.1.39 → aient-1.1.41}/LICENSE +0 -0
- {aient-1.1.39 → aient-1.1.41}/MANIFEST.in +0 -0
- {aient-1.1.39 → aient-1.1.41}/README.md +0 -0
- {aient-1.1.39 → aient-1.1.41}/setup.cfg +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/__init__.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/.git +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/.gitignore +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/__init__.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/log_config.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/models.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/test/test_base_api.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/test/test_geminimask.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/test/test_image.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/core/test/test_payload.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/__init__.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/audio.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/base.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/chatgpt.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/claude.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/duckduckgo.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/gemini.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/groq.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/models/vertex.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/__init__.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/arXiv.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/config.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/excute_command.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/get_time.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/image.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/list_directory.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/read_file.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/read_image.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/readonly.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/registry.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/run_python.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/websearch.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/plugins/write_file.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/utils/__init__.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/utils/prompt.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient/utils/scripts.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient.egg-info/SOURCES.txt +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient.egg-info/dependency_links.txt +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient.egg-info/requires.txt +0 -0
- {aient-1.1.39 → aient-1.1.41}/src/aient.egg-info/top_level.txt +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_API.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_Deepbricks.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_Web_crawler.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_aiwaves.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_aiwaves_arxiv.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_ask_gemini.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_class.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_claude.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_claude_zh_char.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_ddg_search.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_download_pdf.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_gemini.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_get_token_dict.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_google_search.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_jieba.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_json.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_logging.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_ollama.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_plugin.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_py_run.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_requests.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_search.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_tikitoken.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_token.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_url.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_whisper.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_wildcard.py +0 -0
- {aient-1.1.39 → aient-1.1.41}/test/test_yjh.py +0 -0
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
|
|
4
4
|
|
5
5
|
setup(
|
6
6
|
name="aient",
|
7
|
-
version="1.1.
|
7
|
+
version="1.1.41",
|
8
8
|
description="Aient: The Awakening of Agent.",
|
9
9
|
long_description=Path.open(Path("README.md"), encoding="utf-8").read(),
|
10
10
|
long_description_content_type="text/markdown",
|
@@ -10,6 +10,7 @@ from .utils import (
|
|
10
10
|
c3o,
|
11
11
|
c3h,
|
12
12
|
c35s,
|
13
|
+
c4,
|
13
14
|
gemini1,
|
14
15
|
gemini2,
|
15
16
|
gemini2_5_pro_exp,
|
@@ -240,6 +241,10 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
|
|
240
241
|
val = int(m.group(1))
|
241
242
|
if val < 0:
|
242
243
|
val = 0
|
244
|
+
elif val > 32768 and "gemini-2.5-pro" in original_model:
|
245
|
+
val = 32768
|
246
|
+
elif val < 128 and "gemini-2.5-pro" in original_model:
|
247
|
+
val = 128
|
243
248
|
elif val > 24576:
|
244
249
|
val = 24576
|
245
250
|
payload["generationConfig"]["thinkingConfig"]["thinkingBudget"] = val
|
@@ -532,6 +537,10 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
|
|
532
537
|
val = int(m.group(1))
|
533
538
|
if val < 0:
|
534
539
|
val = 0
|
540
|
+
elif val > 32768 and "gemini-2.5-pro" in original_model:
|
541
|
+
val = 32768
|
542
|
+
elif val < 128 and "gemini-2.5-pro" in original_model:
|
543
|
+
val = 128
|
535
544
|
elif val > 24576:
|
536
545
|
val = 24576
|
537
546
|
payload["generationConfig"]["thinkingConfig"]["thinkingBudget"] = val
|
@@ -568,6 +577,8 @@ async def get_vertex_claude_payload(request, engine, provider, api_key=None):
|
|
568
577
|
location = c35s
|
569
578
|
elif "claude-3-opus" in original_model:
|
570
579
|
location = c3o
|
580
|
+
elif "claude-sonnet-4" in original_model or "claude-opus-4" in original_model:
|
581
|
+
location = c4
|
571
582
|
elif "claude-3-sonnet" in original_model:
|
572
583
|
location = c3s
|
573
584
|
elif "claude-3-haiku" in original_model:
|
@@ -790,23 +801,6 @@ async def get_aws_payload(request, engine, provider, api_key=None):
|
|
790
801
|
# url = f"{base_url}/model/{original_model}/invoke"
|
791
802
|
url = f"{base_url}/model/{original_model}/invoke-with-response-stream"
|
792
803
|
|
793
|
-
# if "claude-3-5-sonnet" in original_model or "claude-3-7-sonnet" in original_model:
|
794
|
-
# location = c35s
|
795
|
-
# elif "claude-3-opus" in original_model:
|
796
|
-
# location = c3o
|
797
|
-
# elif "claude-3-sonnet" in original_model:
|
798
|
-
# location = c3s
|
799
|
-
# elif "claude-3-haiku" in original_model:
|
800
|
-
# location = c3h
|
801
|
-
|
802
|
-
# claude_stream = "streamRawPredict"
|
803
|
-
# url = "https://{LOCATION}-aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/anthropic/models/{MODEL}:{stream}".format(
|
804
|
-
# LOCATION=await location.next(),
|
805
|
-
# PROJECT_ID=project_id,
|
806
|
-
# MODEL=original_model,
|
807
|
-
# stream=claude_stream
|
808
|
-
# )
|
809
|
-
|
810
804
|
messages = []
|
811
805
|
system_prompt = None
|
812
806
|
tool_id = None
|
@@ -568,6 +568,7 @@ async def fetch_response(client, url, headers, payload, engine, model):
|
|
568
568
|
|
569
569
|
elif engine == "gemini" or engine == "vertex-gemini" or engine == "aws":
|
570
570
|
response_json = response.json()
|
571
|
+
# print("response_json", json.dumps(response_json, indent=4, ensure_ascii=False))
|
571
572
|
|
572
573
|
if isinstance(response_json, str):
|
573
574
|
import ast
|
@@ -579,7 +580,7 @@ async def fetch_response(client, url, headers, payload, engine, model):
|
|
579
580
|
else:
|
580
581
|
logger.error(f"error fetch_response: Unknown response_json type: {type(response_json)}")
|
581
582
|
parsed_data = response_json
|
582
|
-
|
583
|
+
|
583
584
|
content = ""
|
584
585
|
reasoning_content = ""
|
585
586
|
image_base64 = ""
|
@@ -596,15 +597,6 @@ async def fetch_response(client, url, headers, payload, engine, model):
|
|
596
597
|
reasoning_content += chunk
|
597
598
|
else:
|
598
599
|
content += chunk
|
599
|
-
# for item in parsed_data:
|
600
|
-
# chunk = safe_get(item, "candidates", 0, "content", "parts", 0, "text")
|
601
|
-
# is_think = safe_get(item, "candidates", 0, "content", "parts", 0, "thought", default=False)
|
602
|
-
# # logger.info(f"chunk: {repr(chunk)}")
|
603
|
-
# if chunk:
|
604
|
-
# if is_think:
|
605
|
-
# reasoning_content += chunk
|
606
|
-
# else:
|
607
|
-
# content += chunk
|
608
600
|
|
609
601
|
usage_metadata = safe_get(parsed_data, -1, "usageMetadata")
|
610
602
|
prompt_tokens = safe_get(usage_metadata, "promptTokenCount", default=0)
|
@@ -618,8 +610,13 @@ async def fetch_response(client, url, headers, payload, engine, model):
|
|
618
610
|
logger.error(f"Unknown role: {role}, parsed_data: {parsed_data}")
|
619
611
|
role = "assistant"
|
620
612
|
|
621
|
-
|
622
|
-
|
613
|
+
has_think = safe_get(parsed_data, 0, "candidates", 0, "content", "parts", 0, "thought", default=False)
|
614
|
+
if has_think:
|
615
|
+
function_message_parts_index = -1
|
616
|
+
else:
|
617
|
+
function_message_parts_index = 0
|
618
|
+
function_call_name = safe_get(parsed_data, -1, "candidates", 0, "content", "parts", function_message_parts_index, "functionCall", "name", default=None)
|
619
|
+
function_call_content = safe_get(parsed_data, -1, "candidates", 0, "content", "parts", function_message_parts_index, "functionCall", "args", default=None)
|
623
620
|
|
624
621
|
timestamp = int(datetime.timestamp(datetime.now()))
|
625
622
|
yield await generate_no_stream_response(timestamp, model, content=content, tools_id=None, function_call_name=function_call_name, function_call_content=function_call_content, role=role, total_tokens=total_tokens, prompt_tokens=prompt_tokens, completion_tokens=candidates_tokens, reasoning_content=reasoning_content, image_base64=image_base64)
|
@@ -436,6 +436,7 @@ provider_api_circular_list = defaultdict(ThreadSafeCircularList)
|
|
436
436
|
c35s = ThreadSafeCircularList(["us-east5", "europe-west1"])
|
437
437
|
c3s = ThreadSafeCircularList(["us-east5", "us-central1", "asia-southeast1"])
|
438
438
|
c3o = ThreadSafeCircularList(["us-east5"])
|
439
|
+
c4 = ThreadSafeCircularList(["us-east5", "us-central1", "europe-west4", "asia-southeast1"])
|
439
440
|
c3h = ThreadSafeCircularList(["us-east5", "us-central1", "europe-west1", "europe-west4"])
|
440
441
|
gemini1 = ThreadSafeCircularList(["us-central1", "us-east4", "us-west1", "us-west4", "europe-west1", "europe-west2"])
|
441
442
|
gemini2 = ThreadSafeCircularList(["us-central1"])
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|