vectorvein 0.1.21__py3-none-any.whl → 0.1.22__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.
@@ -59,6 +59,7 @@ class BaseChatClient(ABC):
59
59
  max_tokens: int | None = None,
60
60
  tools: list | NotGiven = NOT_GIVEN,
61
61
  tool_choice: str | NotGiven = NOT_GIVEN,
62
+ response_format: dict | None = None,
62
63
  **kwargs,
63
64
  ) -> ChatCompletionMessage | Generator[ChatCompletionDeltaMessage, Any, None]:
64
65
  pass
@@ -130,6 +131,7 @@ class BaseAsyncChatClient(ABC):
130
131
  max_tokens: int | None = None,
131
132
  tools: list | NotGiven = NOT_GIVEN,
132
133
  tool_choice: str | NotGiven = NOT_GIVEN,
134
+ response_format: dict | None = None,
133
135
  **kwargs,
134
136
  ) -> ChatCompletionMessage | AsyncGenerator[ChatCompletionDeltaMessage, None]:
135
137
  pass
@@ -52,6 +52,7 @@ class GeminiChatClient(BaseChatClient):
52
52
  max_tokens: int | None = None,
53
53
  tools: list | None = None,
54
54
  tool_choice: str | None = None,
55
+ response_format: dict | None = None,
55
56
  **kwargs,
56
57
  ):
57
58
  if model is not None:
@@ -82,6 +83,11 @@ class GeminiChatClient(BaseChatClient):
82
83
  else:
83
84
  tools_params = {}
84
85
 
86
+ if response_format:
87
+ response_format_params = {"generationConfig": {"response_mime_type": "application/json"}}
88
+ else:
89
+ response_format_params = {}
90
+
85
91
  if self.random_endpoint:
86
92
  self.random_endpoint = True
87
93
  self.endpoint_id = random.choice(self.backend_settings.models[self.model].endpoints)
@@ -100,6 +106,7 @@ class GeminiChatClient(BaseChatClient):
100
106
  "maxOutputTokens": max_tokens,
101
107
  },
102
108
  **tools_params,
109
+ **response_format_params,
103
110
  **kwargs,
104
111
  }
105
112
  if system_prompt:
@@ -228,6 +235,7 @@ class AsyncGeminiChatClient(BaseAsyncChatClient):
228
235
  max_tokens: int | None = None,
229
236
  tools: list | None = None,
230
237
  tool_choice: str | None = None,
238
+ response_format: dict | None = None,
231
239
  **kwargs,
232
240
  ):
233
241
  if model is not None:
@@ -258,6 +266,11 @@ class AsyncGeminiChatClient(BaseAsyncChatClient):
258
266
  else:
259
267
  tools_params = {}
260
268
 
269
+ if response_format:
270
+ response_format_params = {"generationConfig": {"response_mime_type": "application/json"}}
271
+ else:
272
+ response_format_params = {}
273
+
261
274
  if self.random_endpoint:
262
275
  self.random_endpoint = True
263
276
  self.endpoint_id = random.choice(self.backend_settings.models[self.model].endpoints)
@@ -276,6 +289,7 @@ class AsyncGeminiChatClient(BaseAsyncChatClient):
276
289
  "maxOutputTokens": max_tokens,
277
290
  },
278
291
  **tools_params,
292
+ **response_format_params,
279
293
  **kwargs,
280
294
  }
281
295
  if system_prompt:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.1.21
3
+ Version: 0.1.22
4
4
  Summary: Default template for PDM package
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -1,13 +1,13 @@
1
- vectorvein-0.1.21.dist-info/METADATA,sha256=1jVHDXn7ri6Lgs7uuS8lVLYF6xvKDIrJ0U3fV7flZQQ,502
2
- vectorvein-0.1.21.dist-info/WHEEL,sha256=Yaoh9rlmnhBUmykFXwmFW_cmVAW3ZIWH8QkQVngJtyw,90
3
- vectorvein-0.1.21.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.1.22.dist-info/METADATA,sha256=v0yHxvMOOfloUCUb-CtgrqCXeTnd6zf1V6tVOlzENWA,502
2
+ vectorvein-0.1.22.dist-info/WHEEL,sha256=Yaoh9rlmnhBUmykFXwmFW_cmVAW3ZIWH8QkQVngJtyw,90
3
+ vectorvein-0.1.22.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
4
  vectorvein/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  vectorvein/chat_clients/__init__.py,sha256=lOGrIEBGN-EoxJ-dF5uMsO6viNCIFIeNL8whDwE6x3g,4657
6
6
  vectorvein/chat_clients/anthropic_client.py,sha256=VJQi7cKLbbLkJtmEFN9M41JUaGjwEuJaXIuQLK-3rdw,20332
7
7
  vectorvein/chat_clients/baichuan_client.py,sha256=CVMvpgjdrZGv0BWnTOBD-f2ufZ3wq3496wqukumsAr4,526
8
- vectorvein/chat_clients/base_client.py,sha256=AnzEmNfT4XW4lKcwf8fv2NlSk1EHK0evr4-1EH0KkwI,5018
8
+ vectorvein/chat_clients/base_client.py,sha256=nGml8rGyKc71Wl2nMbqt_5L9gbX-MCRU2jvHJvxF4AY,5108
9
9
  vectorvein/chat_clients/deepseek_client.py,sha256=3qWu01NlJAP2N-Ff62d5-CZXZitlizE1fzb20LNetig,526
10
- vectorvein/chat_clients/gemini_client.py,sha256=nabhddX_0jO0rb1M39GF8X0g6i-wnoy49XI7Id8-1iQ,14663
10
+ vectorvein/chat_clients/gemini_client.py,sha256=sb7YvnkTy0n-GCK49PDUkQ8xE6jqiCV61GjOYKW-YyI,15213
11
11
  vectorvein/chat_clients/groq_client.py,sha256=Uow4pgdmFi93ZQSoOol2-0PhhqkW-S0XuSldvppz5U4,498
12
12
  vectorvein/chat_clients/local_client.py,sha256=55nOsxzqUf79q3Y14MKROA71zxhsT7p7FsDZ89rts2M,422
13
13
  vectorvein/chat_clients/minimax_client.py,sha256=xykptVg0qzOrJKuswHLG3M7r8H37jEMOb0gAnYAUdKQ,13947
@@ -25,4 +25,4 @@ vectorvein/types/enums.py,sha256=PNK_pTIyjJFy-yAG2PHaMIO1ey3W6fReMCkH8M8VRW4,159
25
25
  vectorvein/types/llm_parameters.py,sha256=mmJjJZz4bPRi0nHzYNUNdWsQLHa9lbf3-MNVnU78vaY,3608
26
26
  vectorvein/utilities/media_processing.py,sha256=BujciRmw1GMmc3ELRvafL8STcy6r5b2rVnh27-uA7so,2256
27
27
  vectorvein/utilities/retry.py,sha256=9ePuJdeUUGx-qMWfaFxmlOvG_lQPwCQ4UB1z3Edlo34,993
28
- vectorvein-0.1.21.dist-info/RECORD,,
28
+ vectorvein-0.1.22.dist-info/RECORD,,