LLM-Bridge 1.10.0a2__py3-none-any.whl → 1.10.0a4__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.
@@ -1,4 +1,5 @@
1
1
  import base64
2
+ import mimetypes
2
3
  from typing import Optional
3
4
 
4
5
  from google.genai import types
@@ -40,18 +41,20 @@ class GeminiResponseHandler:
40
41
  elif not part.thought:
41
42
  printing_status = PrintingStatus.Response
42
43
  text += part.text
43
- # Code (Causing Error)
44
- # if part.executable_code is not None:
45
- # code += part.executable_code.code
44
+ # Code
45
+ if part.executable_code is not None:
46
+ code += part.executable_code.code
46
47
  # Code Output
47
48
  if part.code_execution_result is not None:
48
49
  code_output += part.code_execution_result.output
49
50
  # File
50
51
  if part.inline_data is not None:
52
+ mime_type = part.inline_data.mime_type
53
+ extension = mimetypes.guess_extension(mime_type) or ""
51
54
  file = File(
52
- name="generated_file",
55
+ name=f"generated_file{extension}",
53
56
  data=base64.b64encode(part.inline_data.data).decode('utf-8'),
54
- type=part.inline_data.mime_type,
57
+ type=mime_type,
55
58
  )
56
59
  files.append(file)
57
60
 
@@ -44,7 +44,7 @@ def process_openai_responses_non_stream_response(
44
44
  # Image Generation untestable due to organization verification requirement
45
45
  # if output.type == "image_generation_call":
46
46
  # file = File(
47
- # name="generated_image",
47
+ # name="generated_image.png",
48
48
  # data=output.result,
49
49
  # type="image/png",
50
50
  # )
@@ -29,7 +29,7 @@ def process_delta(event: ResponseStreamEvent) -> ChatResponse:
29
29
  # Image Generation untestable due to organization verification requirement
30
30
  # if event.type == "response.image_generation_call.partial_image":
31
31
  # file = File(
32
- # name="generated_image",
32
+ # name="generated_image.png",
33
33
  # data=event.partial_image_b64,
34
34
  # type="image/png",
35
35
  # )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LLM-Bridge
3
- Version: 1.10.0a2
3
+ Version: 1.10.0a4
4
4
  Summary: A Bridge for LLMs
5
5
  Author-email: windsnow1025 <windsnow1025@gmail.com>
6
6
  License-Expression: MIT
@@ -9,15 +9,15 @@ llm_bridge/client/implementations/claude/claude_token_counter.py,sha256=g8M7BFY2
9
9
  llm_bridge/client/implementations/claude/non_stream_claude_client.py,sha256=xnge1J-j_Er4K4L1UxhjuxAs_Pl6vralxTKk9yItwjI,2500
10
10
  llm_bridge/client/implementations/claude/stream_claude_client.py,sha256=q4w1UYc1yZJw5UFOtnxCoeg8MFp5soc1d57YiCTCCGE,2109
11
11
  llm_bridge/client/implementations/gemini/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- llm_bridge/client/implementations/gemini/gemini_response_handler.py,sha256=mDQ7Twv-LVr1-NyE1s9QYgFqOwFwM53Ml-EOIpYgvp4,4254
12
+ llm_bridge/client/implementations/gemini/gemini_response_handler.py,sha256=LADXq5h_bbuCclp4RTf70YtQ0_9JFRRzo7j4V5Ts7y4,4388
13
13
  llm_bridge/client/implementations/gemini/gemini_token_counter.py,sha256=M_mlrtu_dZTgEG9JgRaPDVyXqFtHSSVAIhsknhOaVrs,504
14
14
  llm_bridge/client/implementations/gemini/non_stream_gemini_client.py,sha256=JGNNpeln42SoXg2vGIC9xG5GGlBh6dIhz4BzYIkgraA,1302
15
15
  llm_bridge/client/implementations/gemini/stream_gemini_client.py,sha256=vqPhQdr-jaHXzn-_1PSZfpo96zM-_89XOEXIx7UBBIw,1545
16
16
  llm_bridge/client/implementations/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  llm_bridge/client/implementations/openai/non_stream_openai_client.py,sha256=aceJm6FF6VdzVRECzJyTY8-aQjCekhhbrMPEcUN24fo,2171
18
- llm_bridge/client/implementations/openai/non_stream_openai_responses_client.py,sha256=5yINbwCHu5MTOPod32HTG8ewHl-21UaoSnPsXMcIGxo,3752
18
+ llm_bridge/client/implementations/openai/non_stream_openai_responses_client.py,sha256=mP4N6UuyWKrJPwh4GzzAZYzIaaSPWNeULFKpVCqgpt4,3756
19
19
  llm_bridge/client/implementations/openai/openai_token_couter.py,sha256=twGl3-VvbvyrfgJBYJxL-g6OjvQvJMRp03mfOK_0bW0,1442
20
- llm_bridge/client/implementations/openai/steam_openai_responses_client.py,sha256=x_M1plb0l0qHv1lSWQD9Iiu2CWalcdG3n7ENDi1iP_c,3697
20
+ llm_bridge/client/implementations/openai/steam_openai_responses_client.py,sha256=z7r35pUzMXuM1n9B5WjlKQCX-jtZL8jbiTe0t1P1Xco,3701
21
21
  llm_bridge/client/implementations/openai/stream_openai_client.py,sha256=Izq4xH9EuLjUCBJsuSr6U4Kj6FN5c7w_oHf9wmQatXE,2988
22
22
  llm_bridge/client/model_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  llm_bridge/client/model_client/claude_client.py,sha256=cuYORseQY8HVt-COh2J0C_mhqPehDB3A4G4vrunoSFA,1352
@@ -55,8 +55,8 @@ llm_bridge/type/model_message/claude_message.py,sha256=gYJUTbLUeifQMva3Axarc-VFe
55
55
  llm_bridge/type/model_message/gemini_message.py,sha256=mh8pf929g7_NkBzSOwnLXyrwSzTT4yt2FmyX7NZn0sM,4302
56
56
  llm_bridge/type/model_message/openai_message.py,sha256=xFaLY-cZoSwNd7E9BSWQjBNcRfCVH11X9s2yxXlctR0,453
57
57
  llm_bridge/type/model_message/openai_responses_message.py,sha256=be1q2euA0ybjj4NO6NxOGIRB9eJuXSb4ssUm_bM4Ocs,1529
58
- llm_bridge-1.10.0a2.dist-info/licenses/LICENSE,sha256=m6uon-6P_CaiqcBfApMfjG9YRtDxcr40Z52JcqUCEAE,1069
59
- llm_bridge-1.10.0a2.dist-info/METADATA,sha256=MVPICosooiGtxzdPdj1JYM2lbyzpwV8etf8rBKBGthc,7851
60
- llm_bridge-1.10.0a2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
61
- llm_bridge-1.10.0a2.dist-info/top_level.txt,sha256=PtxyrgNX1lSa1Ab_qswg0sekSXejG5zrS6b_v3Po05g,11
62
- llm_bridge-1.10.0a2.dist-info/RECORD,,
58
+ llm_bridge-1.10.0a4.dist-info/licenses/LICENSE,sha256=m6uon-6P_CaiqcBfApMfjG9YRtDxcr40Z52JcqUCEAE,1069
59
+ llm_bridge-1.10.0a4.dist-info/METADATA,sha256=DfkeSM-dLaAyKS2FsmU0GH7Ar4-DLD8Y50oSYpPI1vM,7851
60
+ llm_bridge-1.10.0a4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
61
+ llm_bridge-1.10.0a4.dist-info/top_level.txt,sha256=PtxyrgNX1lSa1Ab_qswg0sekSXejG5zrS6b_v3Po05g,11
62
+ llm_bridge-1.10.0a4.dist-info/RECORD,,