LLM-Bridge 2.4.1__tar.gz → 2.4.2__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.1 → llm_bridge-2.4.2}/PKG-INFO +1 -1
  2. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/openai_responses/openai_responses_response_handler.py +2 -2
  3. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/media_processor.py +3 -3
  4. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_message_converter/claude_message_converter.py +4 -4
  5. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_message_converter/openai_completion_message_converter.py +4 -4
  6. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_message_converter/openai_responses_message_converter.py +6 -6
  7. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/resources/model_prices.json +12 -0
  8. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/pyproject.toml +1 -1
  9. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/single/config.py +1 -0
  10. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/uv.lock +1 -1
  11. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/.gitattributes +0 -0
  12. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/.github/workflows/pypi-publish.yaml +0 -0
  13. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/.github/workflows/python-test.yaml +0 -0
  14. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/.gitignore +0 -0
  15. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/.run/batch.run.xml +0 -0
  16. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/.run/pytest.run.xml +0 -0
  17. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/.run/single.run.xml +0 -0
  18. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/LICENSE +0 -0
  19. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/README.md +0 -0
  20. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/__init__.py +0 -0
  21. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/__init__.py +0 -0
  22. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/chat_client.py +0 -0
  23. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/__init__.py +0 -0
  24. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/claude/__init__.py +0 -0
  25. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/claude/claude_response_handler.py +0 -0
  26. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/claude/claude_token_counter.py +0 -0
  27. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/claude/non_stream_claude_client.py +0 -0
  28. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/claude/stream_claude_client.py +0 -0
  29. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/gemini/__init__.py +0 -0
  30. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/gemini/gemini_response_handler.py +0 -0
  31. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/gemini/gemini_token_counter.py +0 -0
  32. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/gemini/non_stream_gemini_client.py +0 -0
  33. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/gemini/stream_gemini_client.py +0 -0
  34. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/http_error.py +0 -0
  35. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/openai_completion/__init__.py +0 -0
  36. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/openai_completion/non_stream_openai_completion_client.py +0 -0
  37. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/openai_completion/stream_openai_completion_client.py +0 -0
  38. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/openai_responses/__init__.py +0 -0
  39. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/openai_responses/non_stream_openai_responses_client.py +0 -0
  40. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/openai_responses/stream_openai_responses_client.py +0 -0
  41. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/xai/__init__.py +0 -0
  42. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/xai/non_stream_xai_client.py +0 -0
  43. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/implementations/xai/stream_xai_client.py +0 -0
  44. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/model_client/__init__.py +0 -0
  45. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/model_client/claude_client.py +0 -0
  46. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/model_client/gemini_client.py +0 -0
  47. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/model_client/openai_completion_client.py +0 -0
  48. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/model_client/openai_responses_client.py +0 -0
  49. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/client/model_client/xai_client.py +0 -0
  50. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/__init__.py +0 -0
  51. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/__init__.py +0 -0
  52. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/chat_client_factory.py +0 -0
  53. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/chat_message_converter.py +0 -0
  54. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_client_factory/__init__.py +0 -0
  55. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_client_factory/claude_client_factory.py +0 -0
  56. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_client_factory/gemini_client_factory.py +0 -0
  57. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_client_factory/openai_completion_client_factory.py +0 -0
  58. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_client_factory/openai_responses_client_factory.py +0 -0
  59. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_client_factory/xai_client_factory.py +0 -0
  60. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_message_converter/__init__.py +0 -0
  61. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_message_converter/gemini_message_converter.py +0 -0
  62. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_message_converter/gemini_mime_types.py +0 -0
  63. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/chat_generate/model_message_converter/xai_message_converter.py +0 -0
  64. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/file_fetch.py +0 -0
  65. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/message_process/__init__.py +0 -0
  66. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/message_process/code_file_extensions.py +0 -0
  67. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/message_process/document_processor.py +0 -0
  68. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/message_process/file_type_checker.py +0 -0
  69. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/message_process/message_processor.py +0 -0
  70. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/logic/model_prices.py +0 -0
  71. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/resources/__init__.py +0 -0
  72. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/__init__.py +0 -0
  73. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/chat_response.py +0 -0
  74. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/message.py +0 -0
  75. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/model_message/__init__.py +0 -0
  76. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/model_message/claude_message.py +0 -0
  77. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/model_message/gemini_message.py +0 -0
  78. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/model_message/openai_completion_message.py +0 -0
  79. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/model_message/openai_responses_message.py +0 -0
  80. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/model_message/xai_message.py +0 -0
  81. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/llm_bridge/type/serializer.py +0 -0
  82. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/__init__.py +0 -0
  83. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/__init__.py +0 -0
  84. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/chat_generate/__init__.py +0 -0
  85. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/chat_generate/model_message_converter/__init__.py +0 -0
  86. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/chat_generate/model_message_converter/claude_message_converter_test.py +0 -0
  87. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/chat_generate/model_message_converter/gemini_message_converter_test.py +0 -0
  88. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/chat_generate/model_message_converter/openai_completion_message_converter_test.py +0 -0
  89. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/chat_generate/model_message_converter/openai_responses_message_converter_test.py +0 -0
  90. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/chat_generate/model_message_converter/xai_message_converter_test.py +0 -0
  91. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/message_factory.py +0 -0
  92. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/message_process/__init__.py +0 -0
  93. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/message_process/file_type_checker_test.py +0 -0
  94. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/message_process/message_processor_test.py +0 -0
  95. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/tests/logic/model_prices_test.py +0 -0
  96. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/.env.example +0 -0
  97. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/__init__.py +0 -0
  98. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/batch/__init__.py +0 -0
  99. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/batch/batch.py +0 -0
  100. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/batch/config.py +0 -0
  101. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/example_file_urls.py +0 -0
  102. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/keys.py +0 -0
  103. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/messages.py +0 -0
  104. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/single/__init__.py +0 -0
  105. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/single/single.py +0 -0
  106. {llm_bridge-2.4.1 → llm_bridge-2.4.2}/usage/workflow.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: LLM-Bridge
3
- Version: 2.4.1
3
+ Version: 2.4.2
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
@@ -18,10 +18,10 @@ async def process_code_interpreter_outputs(interpreter_outputs: list[Output]) ->
18
18
  if isinstance(interpreter_output, OutputLogs):
19
19
  code_output += interpreter_output.logs
20
20
  if isinstance(interpreter_output, OutputImage):
21
- data, _ = await get_base64_content_from_url(interpreter_output.url)
21
+ base64_data, _ = await get_base64_content_from_url(interpreter_output.url)
22
22
  file = File(
23
23
  name="code_interpreter_call_output.png",
24
- data=data,
24
+ data=base64_data,
25
25
  type="image/png",
26
26
  )
27
27
  files.append(file)
@@ -13,6 +13,6 @@ async def get_bytes_content_from_url(req_url: str) -> tuple[bytes, str]:
13
13
 
14
14
 
15
15
  async def get_base64_content_from_url(req_url: str) -> tuple[str, str]:
16
- media_data, media_type = await get_bytes_content_from_url(req_url)
17
- base64_media = bytes_to_base64(media_data)
18
- return base64_media, media_type
16
+ file_data, media_type = await get_bytes_content_from_url(req_url)
17
+ base64_data = bytes_to_base64(file_data)
18
+ return base64_data, media_type
@@ -35,28 +35,28 @@ async def convert_message_to_claude(message: Message) -> ClaudeMessage:
35
35
  file_url = content_item.data
36
36
  file_type, sub_type = await get_file_type(file_url)
37
37
  if file_type == "image":
38
- base64_image, media_type = await media_processor.get_base64_content_from_url(file_url)
38
+ base64_data, media_type = await media_processor.get_base64_content_from_url(file_url)
39
39
  if media_type in ("image/jpeg", "image/png", "image/gif", "image/webp"):
40
40
  image_content = ImageBlockParam(
41
41
  type="image",
42
42
  source=Base64ImageSourceParam(
43
43
  type="base64",
44
44
  media_type=media_type,
45
- data=base64_image
45
+ data=base64_data
46
46
  )
47
47
  )
48
48
  claude_content.append(image_content)
49
49
  else:
50
50
  claude_content.append(create_unsupported_content(file_url, file_type, sub_type))
51
51
  elif sub_type == "pdf":
52
- file_data, media_type = await media_processor.get_base64_content_from_url(file_url)
52
+ base64_data, media_type = await media_processor.get_base64_content_from_url(file_url)
53
53
  if media_type == "application/pdf":
54
54
  pdf_content = DocumentBlockParam(
55
55
  type="document",
56
56
  source=Base64PDFSourceParam(
57
57
  type="base64",
58
58
  media_type=media_type,
59
- data=file_data
59
+ data=base64_data
60
60
  ),
61
61
  )
62
62
  claude_content.append(pdf_content)
@@ -33,8 +33,8 @@ async def convert_message_to_openai_completion(message: Message) -> OpenAIComple
33
33
  file_url = content_item.data
34
34
  file_type, sub_type = await get_file_type(file_url)
35
35
  if file_type == "image":
36
- base64_image, media_type = await media_processor.get_base64_content_from_url(file_url)
37
- image_url = f"data:{media_type};base64,{base64_image}"
36
+ base64_data, media_type = await media_processor.get_base64_content_from_url(file_url)
37
+ image_url = f"data:{media_type};base64,{base64_data}"
38
38
  image_content = ChatCompletionContentPartImageParam(
39
39
  type="image_url",
40
40
  image_url=ImageURL(url=image_url)
@@ -43,10 +43,10 @@ async def convert_message_to_openai_completion(message: Message) -> OpenAIComple
43
43
  elif file_type == "audio":
44
44
  audio_format = get_file_extension(file_url)
45
45
  if audio_format in ("wav", "mp3"):
46
- encoded_string, _ = await media_processor.get_base64_content_from_url(file_url)
46
+ base64_data, _ = await media_processor.get_base64_content_from_url(file_url)
47
47
  audio_content = ChatCompletionContentPartInputAudioParam(
48
48
  type="input_audio",
49
- input_audio=InputAudio(data=encoded_string, format=audio_format)
49
+ input_audio=InputAudio(data=base64_data, format=audio_format)
50
50
  )
51
51
  content.append(audio_content)
52
52
  else:
@@ -30,8 +30,8 @@ async def convert_input_content(message: Message) -> tuple[list[OpenAIResponsesC
30
30
  file_url = content_item.data
31
31
  file_type, sub_type = await get_file_type(file_url)
32
32
  if file_type == "image":
33
- base64_image, media_type = await media_processor.get_base64_content_from_url(file_url)
34
- image_url = f"data:{media_type};base64,{base64_image}"
33
+ base64_data, media_type = await media_processor.get_base64_content_from_url(file_url)
34
+ image_url = f"data:{media_type};base64,{base64_data}"
35
35
  content.append(ResponseInputImageParam(
36
36
  type="input_image",
37
37
  image_url=image_url,
@@ -39,20 +39,20 @@ async def convert_input_content(message: Message) -> tuple[list[OpenAIResponsesC
39
39
  ))
40
40
  elif sub_type == "pdf":
41
41
  contains_pdf = True
42
- file_data, _ = await media_processor.get_base64_content_from_url(file_url)
42
+ base64_data, _ = await media_processor.get_base64_content_from_url(file_url)
43
43
  content.append(ResponseInputFileParam(
44
44
  type="input_file",
45
45
  filename=get_filename_without_timestamp(file_url),
46
- file_data=f"data:application/pdf;base64,{file_data}",
46
+ file_data=f"data:application/pdf;base64,{base64_data}",
47
47
  ))
48
48
  # Audio Input not supported in Responses API
49
49
  # elif file_type == "audio":
50
50
  # audio_format = get_file_extension(file_url)
51
51
  # if audio_format in ("wav", "mp3"):
52
- # file_data, _ = await media_processor.get_base64_content_from_url(file_url)
52
+ # base64_data, _ = await media_processor.get_base64_content_from_url(file_url)
53
53
  # audio_content = ResponseInputAudioParam(
54
54
  # type="input_audio",
55
- # input_audio=InputAudio(data=file_data, format=audio_format)
55
+ # input_audio=InputAudio(data=base64_data, format=audio_format)
56
56
  # )
57
57
  # content.append(audio_content)
58
58
  # else:
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "apiType": "Google AI Studio",
4
+ "model": "gemini-4-carbon",
5
+ "input": 7.2,
6
+ "output": 36
7
+ },
2
8
  {
3
9
  "apiType": "Google AI Studio",
4
10
  "model": "gemini-4-argon",
@@ -155,6 +161,12 @@
155
161
  "input": 0.5,
156
162
  "output": 2.5
157
163
  },
164
+ {
165
+ "apiType": "Vertex AI",
166
+ "model": "gemini-4-carbon",
167
+ "input": 7.2,
168
+ "output": 36
169
+ },
158
170
  {
159
171
  "apiType": "Vertex AI",
160
172
  "model": "gemini-4-argon",
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "LLM-Bridge"
7
- version = "2.4.1"
7
+ version = "2.4.2"
8
8
  dependencies = [
9
9
  "fastapi",
10
10
  "httpx",
@@ -176,6 +176,7 @@ messages = [
176
176
  # model = "gpt-5.6-luna"
177
177
  # model = "gpt-4.1"
178
178
  # model = "gpt-audio-1.5"
179
+ # model = "gemini-4-carbon"
179
180
  # model = "gemini-4-argon"
180
181
  # model = "gemini-3.1-pro-preview"
181
182
  # model = "gemini-3-pro-image"
@@ -798,7 +798,7 @@ wheels = [
798
798
 
799
799
  [[package]]
800
800
  name = "llm-bridge"
801
- version = "2.4.1"
801
+ version = "2.4.2"
802
802
  source = { editable = "." }
803
803
  dependencies = [
804
804
  { name = "anthropic" },
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