LLM-Bridge 2.4.2__tar.gz → 2.4.4__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.
Files changed (106) hide show
  1. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/PKG-INFO +1 -1
  2. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/gemini/gemini_response_handler.py +1 -1
  3. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/model_client/gemini_client.py +0 -2
  4. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_client_factory/gemini_client_factory.py +14 -27
  5. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/message_process/message_processor.py +12 -1
  6. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/resources/model_prices.json +9 -21
  7. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/pyproject.toml +1 -1
  8. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/single/config.py +4 -5
  9. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/uv.lock +1 -1
  10. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/.gitattributes +0 -0
  11. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/.github/workflows/pypi-publish.yaml +0 -0
  12. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/.github/workflows/python-test.yaml +0 -0
  13. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/.gitignore +0 -0
  14. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/.run/batch.run.xml +0 -0
  15. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/.run/pytest.run.xml +0 -0
  16. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/.run/single.run.xml +0 -0
  17. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/LICENSE +0 -0
  18. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/README.md +0 -0
  19. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/__init__.py +0 -0
  20. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/__init__.py +0 -0
  21. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/chat_client.py +0 -0
  22. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/__init__.py +0 -0
  23. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/claude/__init__.py +0 -0
  24. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/claude/claude_response_handler.py +0 -0
  25. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/claude/claude_token_counter.py +0 -0
  26. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/claude/non_stream_claude_client.py +2 -2
  27. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/claude/stream_claude_client.py +2 -2
  28. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/gemini/__init__.py +0 -0
  29. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/gemini/gemini_token_counter.py +0 -0
  30. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/gemini/non_stream_gemini_client.py +0 -0
  31. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/gemini/stream_gemini_client.py +0 -0
  32. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/http_error.py +0 -0
  33. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/openai_completion/__init__.py +0 -0
  34. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/openai_completion/non_stream_openai_completion_client.py +0 -0
  35. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/openai_completion/stream_openai_completion_client.py +0 -0
  36. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/openai_responses/__init__.py +0 -0
  37. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/openai_responses/non_stream_openai_responses_client.py +0 -0
  38. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/openai_responses/openai_responses_response_handler.py +0 -0
  39. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/openai_responses/stream_openai_responses_client.py +0 -0
  40. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/xai/__init__.py +0 -0
  41. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/xai/non_stream_xai_client.py +0 -0
  42. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/implementations/xai/stream_xai_client.py +0 -0
  43. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/model_client/__init__.py +0 -0
  44. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/model_client/claude_client.py +4 -4
  45. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/model_client/openai_completion_client.py +0 -0
  46. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/model_client/openai_responses_client.py +0 -0
  47. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/client/model_client/xai_client.py +0 -0
  48. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/__init__.py +0 -0
  49. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/__init__.py +0 -0
  50. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/chat_client_factory.py +0 -0
  51. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/chat_message_converter.py +0 -0
  52. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/media_processor.py +0 -0
  53. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_client_factory/__init__.py +0 -0
  54. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_client_factory/claude_client_factory.py +4 -4
  55. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_client_factory/openai_completion_client_factory.py +0 -0
  56. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_client_factory/openai_responses_client_factory.py +0 -0
  57. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_client_factory/xai_client_factory.py +0 -0
  58. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_message_converter/__init__.py +0 -0
  59. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_message_converter/claude_message_converter.py +0 -0
  60. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_message_converter/gemini_message_converter.py +0 -0
  61. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_message_converter/gemini_mime_types.py +0 -0
  62. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_message_converter/openai_completion_message_converter.py +0 -0
  63. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_message_converter/openai_responses_message_converter.py +0 -0
  64. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/chat_generate/model_message_converter/xai_message_converter.py +0 -0
  65. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/file_fetch.py +0 -0
  66. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/message_process/__init__.py +0 -0
  67. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/message_process/code_file_extensions.py +0 -0
  68. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/message_process/document_processor.py +0 -0
  69. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/message_process/file_type_checker.py +0 -0
  70. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/logic/model_prices.py +0 -0
  71. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/resources/__init__.py +0 -0
  72. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/__init__.py +0 -0
  73. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/chat_response.py +0 -0
  74. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/message.py +0 -0
  75. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/model_message/__init__.py +0 -0
  76. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/model_message/claude_message.py +0 -0
  77. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/model_message/gemini_message.py +0 -0
  78. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/model_message/openai_completion_message.py +0 -0
  79. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/model_message/openai_responses_message.py +0 -0
  80. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/model_message/xai_message.py +0 -0
  81. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/llm_bridge/type/serializer.py +0 -0
  82. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/__init__.py +0 -0
  83. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/__init__.py +0 -0
  84. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/chat_generate/__init__.py +0 -0
  85. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/chat_generate/model_message_converter/__init__.py +0 -0
  86. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/chat_generate/model_message_converter/claude_message_converter_test.py +0 -0
  87. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/chat_generate/model_message_converter/gemini_message_converter_test.py +0 -0
  88. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/chat_generate/model_message_converter/openai_completion_message_converter_test.py +0 -0
  89. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/chat_generate/model_message_converter/openai_responses_message_converter_test.py +0 -0
  90. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/chat_generate/model_message_converter/xai_message_converter_test.py +0 -0
  91. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/message_factory.py +0 -0
  92. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/message_process/__init__.py +0 -0
  93. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/message_process/file_type_checker_test.py +0 -0
  94. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/message_process/message_processor_test.py +0 -0
  95. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/tests/logic/model_prices_test.py +0 -0
  96. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/.env.example +0 -0
  97. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/__init__.py +0 -0
  98. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/batch/__init__.py +0 -0
  99. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/batch/batch.py +0 -0
  100. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/batch/config.py +0 -0
  101. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/example_file_urls.py +0 -0
  102. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/keys.py +0 -0
  103. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/messages.py +0 -0
  104. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/single/__init__.py +0 -0
  105. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/single/single.py +0 -0
  106. {llm_bridge-2.4.2 → llm_bridge-2.4.4}/usage/workflow.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: LLM-Bridge
3
- Version: 2.4.2
3
+ Version: 2.4.4
4
4
  Summary: A library that wraps multiple LLM providers into a consistent API while using each provider's native SDK internally, supporting multimodal I/O, file processing, and stream output.
5
5
  Author-email: windsnow1025 <windsnow1025@gmail.com>
6
6
  License-Expression: MIT
@@ -45,7 +45,7 @@ class GeminiResponseHandler:
45
45
  if part.code_execution_result is not None:
46
46
  code_output += part.code_execution_result.output
47
47
  # File
48
- if part.inline_data is not None:
48
+ if part.inline_data is not None and not part.thought:
49
49
  mime_type = part.inline_data.mime_type
50
50
  extension = mimetypes.guess_extension(mime_type) or ""
51
51
  file = File(
@@ -13,13 +13,11 @@ class GeminiClient(ChatClient):
13
13
  self,
14
14
  model: str,
15
15
  messages: list[GeminiMessage],
16
- temperature: float,
17
16
  client: genai.Client,
18
17
  config: types.GenerateContentConfig,
19
18
  ):
20
19
  self.model = model
21
20
  self.messages = messages
22
- self.temperature = temperature
23
21
  self.client = client
24
22
  self.config = config
25
23
 
@@ -7,20 +7,8 @@ from google.genai.types import Modality, MediaResolution
7
7
  from llm_bridge.client.implementations.gemini.non_stream_gemini_client import NonStreamGeminiClient
8
8
  from llm_bridge.client.implementations.gemini.stream_gemini_client import StreamGeminiClient
9
9
  from llm_bridge.logic.chat_generate.chat_message_converter import convert_messages_to_gemini
10
- from llm_bridge.logic.message_process.file_type_checker import get_file_type
11
- from llm_bridge.logic.message_process.message_processor import extract_system_message
12
- from llm_bridge.type.message import Message, ContentType
13
-
14
-
15
- async def contains_audio_or_video(messages: list[Message]) -> bool:
16
- for message in messages:
17
- for content_item in message.contents:
18
- if content_item.type != ContentType.File:
19
- continue
20
- file_type, _ = await get_file_type(content_item.data)
21
- if file_type in ("audio", "video"):
22
- return True
23
- return False
10
+ from llm_bridge.logic.message_process.message_processor import extract_system_message, contains_audio_or_video
11
+ from llm_bridge.type.message import Message
24
12
 
25
13
 
26
14
  async def create_gemini_client(
@@ -84,7 +72,6 @@ async def create_gemini_client(
84
72
 
85
73
  config = types.GenerateContentConfig(
86
74
  system_instruction=system_instruction,
87
- temperature=temperature,
88
75
  safety_settings=[
89
76
  types.SafetySetting(
90
77
  category=types.HarmCategory.HARM_CATEGORY_HATE_SPEECH,
@@ -112,19 +99,21 @@ async def create_gemini_client(
112
99
  response_modalities=response_modalities,
113
100
  )
114
101
 
102
+ if "image" in model:
103
+ config.temperature = temperature
104
+
115
105
  if "pro-image" not in model:
116
106
  config.media_resolution = MediaResolution.MEDIA_RESOLUTION_HIGH
117
107
 
118
- if model in ["gemini-3.1-pro-preview", "gemini-3.8-flash", "gemini-3.6-flash", "gemini-3-flash-preview", "gemini-3-pro-image", "gemini-3.1-flash-image"]:
119
- if vertexai:
120
- config.http_options = types.HttpOptions(
121
- headers={
122
- "X-Vertex-AI-LLM-Request-Type": "shared",
123
- "X-Vertex-AI-LLM-Shared-Request-Type": "priority",
124
- }
125
- )
126
- elif not free_tier:
127
- config.service_tier = types.ServiceTier.PRIORITY
108
+ if vertexai:
109
+ config.http_options = types.HttpOptions(
110
+ headers={
111
+ "X-Vertex-AI-LLM-Request-Type": "shared",
112
+ "X-Vertex-AI-LLM-Shared-Request-Type": "priority",
113
+ }
114
+ )
115
+ elif not free_tier:
116
+ config.service_tier = types.ServiceTier.PRIORITY
128
117
 
129
118
  if structured_output_schema:
130
119
  config.response_mime_type = "application/json"
@@ -136,7 +125,6 @@ async def create_gemini_client(
136
125
  return StreamGeminiClient(
137
126
  model=model,
138
127
  messages=gemini_messages,
139
- temperature=temperature,
140
128
  client=client,
141
129
  config=config,
142
130
  )
@@ -144,7 +132,6 @@ async def create_gemini_client(
144
132
  return NonStreamGeminiClient(
145
133
  model=model,
146
134
  messages=gemini_messages,
147
- temperature=temperature,
148
135
  client=client,
149
136
  config=config,
150
137
  )
@@ -1,5 +1,5 @@
1
1
  from llm_bridge.logic.message_process import document_processor
2
- from llm_bridge.logic.message_process.file_type_checker import get_filename_without_timestamp
2
+ from llm_bridge.logic.message_process.file_type_checker import get_file_type, get_filename_without_timestamp
3
3
  from llm_bridge.type.message import Message, Role, ContentType
4
4
 
5
5
 
@@ -26,3 +26,14 @@ def extract_system_message(messages: list[Message]) -> str:
26
26
  del messages[0]
27
27
 
28
28
  return system_message
29
+
30
+
31
+ async def contains_audio_or_video(messages: list[Message]) -> bool:
32
+ for message in messages:
33
+ for content_item in message.contents:
34
+ if content_item.type != ContentType.File:
35
+ continue
36
+ file_type, _ = await get_file_type(content_item.data)
37
+ if file_type in ("audio", "video"):
38
+ return True
39
+ return False
@@ -13,9 +13,9 @@
13
13
  },
14
14
  {
15
15
  "apiType": "Google AI Studio",
16
- "model": "gemini-3.1-pro-preview",
17
- "input": 7.2,
18
- "output": 32.4
16
+ "model": "gemini-4-hydrogen",
17
+ "input": 2.7,
18
+ "output": 13.5
19
19
  },
20
20
  {
21
21
  "apiType": "Google AI Studio",
@@ -35,12 +35,6 @@
35
35
  "input": 2.7,
36
36
  "output": 13.5
37
37
  },
38
- {
39
- "apiType": "Google AI Studio",
40
- "model": "gemini-3-flash-preview",
41
- "input": 1.8,
42
- "output": 5.4
43
- },
44
38
  {
45
39
  "apiType": "Google AI Studio",
46
40
  "model": "gemini-3-pro-image",
@@ -175,9 +169,9 @@
175
169
  },
176
170
  {
177
171
  "apiType": "Vertex AI",
178
- "model": "gemini-3.1-pro-preview",
179
- "input": 7.2,
180
- "output": 32.4
172
+ "model": "gemini-4-hydrogen",
173
+ "input": 2.7,
174
+ "output": 13.5
181
175
  },
182
176
  {
183
177
  "apiType": "Vertex AI",
@@ -197,12 +191,6 @@
197
191
  "input": 2.7,
198
192
  "output": 13.5
199
193
  },
200
- {
201
- "apiType": "Vertex AI",
202
- "model": "gemini-3-flash-preview",
203
- "input": 1.8,
204
- "output": 5.4
205
- },
206
194
  {
207
195
  "apiType": "Vertex AI",
208
196
  "model": "gemini-3-pro-image",
@@ -217,19 +205,19 @@
217
205
  },
218
206
  {
219
207
  "apiType": "Google AI Studio Free Tier",
220
- "model": "gemini-3.8-flash",
208
+ "model": "gemini-4-hydrogen",
221
209
  "input": 0,
222
210
  "output": 0
223
211
  },
224
212
  {
225
213
  "apiType": "Google AI Studio Free Tier",
226
- "model": "gemini-3.6-flash",
214
+ "model": "gemini-3.8-flash",
227
215
  "input": 0,
228
216
  "output": 0
229
217
  },
230
218
  {
231
219
  "apiType": "Google AI Studio Free Tier",
232
- "model": "gemini-3-flash-preview",
220
+ "model": "gemini-3.6-flash",
233
221
  "input": 0,
234
222
  "output": 0
235
223
  },
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "LLM-Bridge"
7
- version = "2.4.2"
7
+ version = "2.4.4"
8
8
  dependencies = [
9
9
  "fastapi",
10
10
  "httpx",
@@ -178,20 +178,19 @@ messages = [
178
178
  # model = "gpt-audio-1.5"
179
179
  # model = "gemini-4-carbon"
180
180
  # model = "gemini-4-argon"
181
- # model = "gemini-3.1-pro-preview"
181
+ model = "gemini-4-hydrogen"
182
182
  # model = "gemini-3-pro-image"
183
183
  # model = "gemini-3.1-flash-image"
184
- # model = "gemini-3.5-flash"
185
- model = "claude-fable-5-2"
184
+ # model = "claude-fable-5-2"
186
185
  # model = "claude-opus-4-6"
187
186
  # model = "grok-4.6"
188
187
 
189
- # api_type = "Vertex AI"
188
+ api_type = "Vertex AI"
190
189
  # api_type = "Google AI Studio Free Tier"
191
190
  # api_type = "Google AI Studio"
192
191
  # api_type = "OpenAI"
193
192
  # api_type = "OpenAI-Azure"
194
- api_type = "Claude"
193
+ # api_type = "Claude"
195
194
  # api_type = "Grok"
196
195
 
197
196
  temperature = 0
@@ -798,7 +798,7 @@ wheels = [
798
798
 
799
799
  [[package]]
800
800
  name = "llm-bridge"
801
- version = "2.4.2"
801
+ version = "2.4.4"
802
802
  source = { editable = "." }
803
803
  dependencies = [
804
804
  { name = "anthropic" },
File without changes
File without changes
File without changes
File without changes
@@ -14,9 +14,9 @@ class NonStreamClaudeClient(ClaudeClient):
14
14
 
15
15
  message = await self.client.beta.messages.create(
16
16
  model=self.model,
17
- messages=serialize(self.messages),
18
- system=self.system,
19
17
  max_tokens=self.max_tokens,
18
+ system=self.system,
19
+ messages=serialize(self.messages),
20
20
  betas=self.betas,
21
21
  tools=self.tools,
22
22
  cache_control=self.cache_control,
@@ -34,9 +34,9 @@ class StreamClaudeClient(ClaudeClient):
34
34
 
35
35
  stream: AsyncStream[BetaRawMessageStreamEvent] = await self.client.beta.messages.create(
36
36
  model=self.model,
37
- messages=serialize(self.messages),
38
- system=self.system,
39
37
  max_tokens=self.max_tokens,
38
+ system=self.system,
39
+ messages=serialize(self.messages),
40
40
  stream=True,
41
41
  betas=self.betas,
42
42
  tools=self.tools,
@@ -16,9 +16,9 @@ class ClaudeClient(ChatClient):
16
16
  def __init__(
17
17
  self,
18
18
  model: str,
19
- messages: list[ClaudeMessage],
20
- system: str,
21
19
  max_tokens: int,
20
+ system: str,
21
+ messages: list[ClaudeMessage],
22
22
  client: anthropic.AsyncAnthropic,
23
23
  betas: list[AnthropicBetaParam] | Omit,
24
24
  tools: list[BetaToolUnionParam],
@@ -28,9 +28,9 @@ class ClaudeClient(ChatClient):
28
28
  output_config: BetaOutputConfigParam | Omit,
29
29
  ):
30
30
  self.model = model
31
- self.messages = messages
32
- self.system = system
33
31
  self.max_tokens = max_tokens
32
+ self.system = system
33
+ self.messages = messages
34
34
  self.client = client
35
35
  self.betas = betas
36
36
  self.tools = tools
@@ -99,9 +99,9 @@ async def create_claude_client(
99
99
  if stream:
100
100
  return StreamClaudeClient(
101
101
  model=model,
102
- messages=claude_messages,
103
- system=system,
104
102
  max_tokens=max_tokens,
103
+ system=system,
104
+ messages=claude_messages,
105
105
  client=client,
106
106
  betas=betas,
107
107
  tools=tools,
@@ -113,9 +113,9 @@ async def create_claude_client(
113
113
  else:
114
114
  return NonStreamClaudeClient(
115
115
  model=model,
116
- messages=claude_messages,
117
- system=system,
118
116
  max_tokens=max_tokens,
117
+ system=system,
118
+ messages=claude_messages,
119
119
  client=client,
120
120
  betas=betas,
121
121
  tools=tools,
File without changes
File without changes
File without changes
File without changes
File without changes