vectorvein 0.2.51__py3-none-any.whl → 0.2.52__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.
@@ -331,11 +331,6 @@ class OpenAICompatibleChatClient(BaseChatClient):
331
331
  else:
332
332
  max_tokens = self.model_setting.context_length - token_counts - 64
333
333
 
334
- if response_format and self.model_setting.response_format_available:
335
- self.response_format = {"response_format": response_format}
336
- else:
337
- self.response_format = {}
338
-
339
334
  self._acquire_rate_limit(self.endpoint, self.model, messages)
340
335
 
341
336
  if self.stream:
@@ -797,16 +792,6 @@ class AsyncOpenAICompatibleChatClient(BaseAsyncChatClient):
797
792
  else:
798
793
  tools_params = {}
799
794
 
800
- if response_format and self.model_setting.response_format_available:
801
- self.response_format = {"response_format": response_format}
802
- else:
803
- self.response_format = {}
804
-
805
- if stream_options:
806
- _stream_options_params = {"stream_options": stream_options}
807
- else:
808
- _stream_options_params = {}
809
-
810
795
  if max_tokens is None:
811
796
  max_output_tokens = self.model_setting.max_output_tokens
812
797
  token_counts = get_message_token_counts(messages=messages, tools=tools, model=self.model)
@@ -55,30 +55,29 @@ class ToolCallContentProcessor:
55
55
  return {}
56
56
  tool_calls_matches = re.findall(self.tool_use_re, self.content)
57
57
  if tool_calls_matches:
58
- tool_call_data = {}
59
- for match in tool_calls_matches:
58
+ tool_calls = []
59
+ for idx, match in enumerate(tool_calls_matches):
60
60
  try:
61
61
  tool_call_data = json.loads(match)
62
+ arguments = json.dumps(tool_call_data["arguments"], ensure_ascii=False)
63
+ tool_calls.append(
64
+ {
65
+ "index": idx,
66
+ "id": f"call_{idx}",
67
+ "function": {
68
+ "arguments": arguments,
69
+ "name": tool_call_data["name"],
70
+ },
71
+ "type": "function",
72
+ }
73
+ )
62
74
  except json.JSONDecodeError:
63
75
  print(f"Failed to parse tool call data:\nContent: {self.content}\nMatch: {match}")
64
76
 
65
- if not tool_call_data:
77
+ if not tool_calls:
66
78
  return {}
67
79
 
68
- arguments = json.dumps(tool_call_data["arguments"], ensure_ascii=False)
69
- return {
70
- "tool_calls": [
71
- {
72
- "index": 0,
73
- "id": "call_0",
74
- "function": {
75
- "arguments": arguments,
76
- "name": tool_call_data["name"],
77
- },
78
- "type": "function",
79
- }
80
- ]
81
- }
80
+ return {"tool_calls": tool_calls}
82
81
  else:
83
82
  return {}
84
83
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.2.51
3
+ Version: 0.2.52
4
4
  Summary: VectorVein Python SDK
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
- vectorvein-0.2.51.dist-info/METADATA,sha256=N4nBBY1TFDSERO5aA57Gys1IGVCcZYGqtML8KRVMjdY,4570
2
- vectorvein-0.2.51.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- vectorvein-0.2.51.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.2.52.dist-info/METADATA,sha256=duh92n055q4yiufJHbzO9O1LFwwrxyhIWOkAkkbMgUw,4570
2
+ vectorvein-0.2.52.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.2.52.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
4
  vectorvein/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  vectorvein/api/__init__.py,sha256=lfY-XA46fgD2iIZTU0VYP8i07AwA03Egj4Qua0vUKrQ,738
6
6
  vectorvein/api/client.py,sha256=xF-leKDQzVyyy9FnIRaz0k4eElYW1XbbzeRLcpnyk90,33047
@@ -19,11 +19,11 @@ vectorvein/chat_clients/minimax_client.py,sha256=YOILWcsHsN5tihLTMbKJIyJr9TJREMI
19
19
  vectorvein/chat_clients/mistral_client.py,sha256=1aKSylzBDaLYcFnaBIL4-sXSzWmXfBeON9Q0rq-ziWw,534
20
20
  vectorvein/chat_clients/moonshot_client.py,sha256=gbu-6nGxx8uM_U2WlI4Wus881rFRotzHtMSoYOcruGU,526
21
21
  vectorvein/chat_clients/openai_client.py,sha256=Nz6tV45pWcsOupxjnsRsGTicbQNJWIZyxuJoJ5DGMpg,527
22
- vectorvein/chat_clients/openai_compatible_client.py,sha256=HOL7sgWCBgwYdiAnNPCbODqg9lhZ_IsBUqc8uQG6kRw,48572
22
+ vectorvein/chat_clients/openai_compatible_client.py,sha256=3MEyKqlf1BtzbNpmqAHQq0JcYwlWxEzM0pOn0XNauas,47999
23
23
  vectorvein/chat_clients/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  vectorvein/chat_clients/qwen_client.py,sha256=-ryh-m9PgsO0fc4ulcCmPTy1155J8YUy15uPoJQOHA0,513
25
25
  vectorvein/chat_clients/stepfun_client.py,sha256=zsD2W5ahmR4DD9cqQTXmJr3txrGuvxbRWhFlRdwNijI,519
26
- vectorvein/chat_clients/utils.py,sha256=gpayOz5rfoINCAZRiKof5k4z_P2iW2XUxz6DQaheyRU,29393
26
+ vectorvein/chat_clients/utils.py,sha256=k9Y-sZvBSqZvWhN7oGIYeE7xV2cGRvgITB_DUtB04_4,29474
27
27
  vectorvein/chat_clients/xai_client.py,sha256=eLFJJrNRJ-ni3DpshODcr3S1EJQLbhVwxyO1E54LaqM,491
28
28
  vectorvein/chat_clients/yi_client.py,sha256=RNf4CRuPJfixrwLZ3-DEc3t25QDe1mvZeb9sku2f8Bc,484
29
29
  vectorvein/chat_clients/zhipuai_client.py,sha256=Ys5DSeLCuedaDXr3PfG1EW2zKXopt-awO2IylWSwY0s,519
@@ -64,4 +64,4 @@ vectorvein/workflow/nodes/web_crawlers.py,sha256=BhJBX1AZH7-22Gu95Ox4qJqmH5DU-m4
64
64
  vectorvein/workflow/utils/check.py,sha256=BJ-Di_6UROoeu_1KQB1AaBi0xdegSBT93VdB-RqI5eY,6085
65
65
  vectorvein/workflow/utils/json_to_code.py,sha256=F7dhDy8kGc8ndOeihGLRLGFGlquoxVlb02ENtxnQ0C8,5914
66
66
  vectorvein/workflow/utils/layout.py,sha256=j0bRD3uaXu40xCS6U6BGahBI8FrHa5MiF55GbTrZ1LM,4565
67
- vectorvein-0.2.51.dist-info/RECORD,,
67
+ vectorvein-0.2.52.dist-info/RECORD,,