LLM-Bridge 1.12.5__py3-none-any.whl → 1.12.6__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.
@@ -16,6 +16,7 @@ async def create_chat_client(
16
16
  stream: bool,
17
17
  thought: bool,
18
18
  code_execution: bool,
19
+ structured_output_schema: dict | None = None,
19
20
  ) -> ChatClient:
20
21
  if api_type == 'OpenAI':
21
22
  return await create_openai_client(
@@ -74,6 +75,7 @@ async def create_chat_client(
74
75
  stream=stream,
75
76
  thought=thought,
76
77
  code_execution=code_execution,
78
+ structured_output_schema=structured_output_schema,
77
79
  )
78
80
  elif api_type == 'Gemini-Paid':
79
81
  return await create_gemini_client(
@@ -85,6 +87,7 @@ async def create_chat_client(
85
87
  stream=stream,
86
88
  thought=thought,
87
89
  code_execution=code_execution,
90
+ structured_output_schema=structured_output_schema,
88
91
  )
89
92
  elif api_type == 'Gemini-Vertex':
90
93
  return await create_gemini_client(
@@ -96,6 +99,7 @@ async def create_chat_client(
96
99
  thought=thought,
97
100
  code_execution=code_execution,
98
101
  vertexai=True,
102
+ structured_output_schema=structured_output_schema,
99
103
  )
100
104
  elif api_type == 'Claude':
101
105
  return await create_claude_client(
@@ -18,6 +18,7 @@ async def create_gemini_client(
18
18
  stream: bool,
19
19
  thought: bool,
20
20
  code_execution: bool,
21
+ structured_output_schema: dict | None = None,
21
22
  ):
22
23
  client = genai.Client(
23
24
  vertexai=vertexai,
@@ -86,6 +87,10 @@ async def create_gemini_client(
86
87
  response_modalities=response_modalities,
87
88
  )
88
89
 
90
+ if structured_output_schema is not None:
91
+ config.response_mime_type = "application/json"
92
+ config.response_json_schema = structured_output_schema
93
+
89
94
  gemini_messages = await convert_messages_to_gemini(messages)
90
95
 
91
96
  if stream:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LLM-Bridge
3
- Version: 1.12.5
3
+ Version: 1.12.6
4
4
  Summary: A Bridge for LLMs
5
5
  Author-email: windsnow1025 <windsnow1025@gmail.com>
6
6
  License-Expression: MIT
@@ -52,12 +52,12 @@ PyPI: [https://pypi.org/project/LLM-Bridge/](https://pypi.org/project/LLM-Bridge
52
52
 
53
53
  The features listed represent the maximum capabilities of each API type supported by LLM Bridge.
54
54
 
55
- | API Type | Input Format | Capabilities | Output Format |
56
- |----------|--------------------------------|--------------------------------------------------|-------------------|
57
- | OpenAI | Text, Image, PDF | Thinking, Web Search, Code Execution | Text |
58
- | Gemini | Text, Image, Video, Audio, PDF | Thinking, Web Search + Citations, Code Execution | Text, Image, File |
59
- | Claude | Text, Image, PDF | Thinking, Web Search, Code Execution | Text |
60
- | Grok | Text, Image | | Text |
55
+ | API Type | Input Format | Capabilities | Output Format |
56
+ |----------|--------------------------------|---------------------------------------------------------------------|-------------------|
57
+ | OpenAI | Text, Image, PDF | Thinking, Web Search, Code Execution | Text |
58
+ | Gemini | Text, Image, Video, Audio, PDF | Thinking, Web Search + Citations, Code Execution, Structured Output | Text, Image, File |
59
+ | Claude | Text, Image, PDF | Thinking, Web Search, Code Execution | Text |
60
+ | Grok | Text, Image | | Text |
61
61
 
62
62
  #### Planned Features
63
63
 
@@ -27,12 +27,12 @@ llm_bridge/logic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
27
27
  llm_bridge/logic/file_fetch.py,sha256=Q8PGNj76E25sKD70TmlnSIdPgAxpNlb89syk87DbAGg,1341
28
28
  llm_bridge/logic/model_prices.py,sha256=hiXVbki3004Rrm5LQrmVfdm0lLABeygxtFB-Qn9_mm0,1219
29
29
  llm_bridge/logic/chat_generate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- llm_bridge/logic/chat_generate/chat_client_factory.py,sha256=i2Lefytc2Sc6Ownjq7obgCkjdCFe9oFuozf96J9wHzs,3800
30
+ llm_bridge/logic/chat_generate/chat_client_factory.py,sha256=x1x5rYUCSMvK2r7lbtwBEHI_-jAcBfoOQbuUY4kZano,4043
31
31
  llm_bridge/logic/chat_generate/chat_message_converter.py,sha256=40VTBOPXg_ocrEZMdt1ObYlm-mhRL35zWzzxv8m2xRc,1538
32
32
  llm_bridge/logic/chat_generate/media_processor.py,sha256=ZR8G24EHwZZr2T9iFDRmScDGyJ_kvThApABzSzK0CL0,702
33
33
  llm_bridge/logic/chat_generate/model_client_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  llm_bridge/logic/chat_generate/model_client_factory/claude_client_factory.py,sha256=bdO-4LBSwe1x8_5kamVg6dpRkxGB8_FXgRaaNH53qUs,3059
35
- llm_bridge/logic/chat_generate/model_client_factory/gemini_client_factory.py,sha256=Yj-xwpSMckQOQXhH4TyW7FFs2AOweA1iECCEJK-q5AM,3448
35
+ llm_bridge/logic/chat_generate/model_client_factory/gemini_client_factory.py,sha256=KjxU3NkHRvQS4G8FXDRlKRM0Kdunol-gTZhUakBwngQ,3666
36
36
  llm_bridge/logic/chat_generate/model_client_factory/openai_client_factory.py,sha256=EoU5kyccnwOKjGdFi5yTozNVPrq402jRtWPjSmBJs7M,4517
37
37
  llm_bridge/logic/chat_generate/model_message_converter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  llm_bridge/logic/chat_generate/model_message_converter/claude_message_converter.py,sha256=SfDhQXR7L5nCPHS4MIjwgzK_wER7qOUCc8gh-K77kKY,2441
@@ -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.12.5.dist-info/licenses/LICENSE,sha256=m6uon-6P_CaiqcBfApMfjG9YRtDxcr40Z52JcqUCEAE,1069
59
- llm_bridge-1.12.5.dist-info/METADATA,sha256=aY62utDSsEkUItzAWAAjG1_ujWG5suk3XxwdY9e29xs,3388
60
- llm_bridge-1.12.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
61
- llm_bridge-1.12.5.dist-info/top_level.txt,sha256=PtxyrgNX1lSa1Ab_qswg0sekSXejG5zrS6b_v3Po05g,11
62
- llm_bridge-1.12.5.dist-info/RECORD,,
58
+ llm_bridge-1.12.6.dist-info/licenses/LICENSE,sha256=m6uon-6P_CaiqcBfApMfjG9YRtDxcr40Z52JcqUCEAE,1069
59
+ llm_bridge-1.12.6.dist-info/METADATA,sha256=4izHWE6c6BYkFoMPjsJaTW6SxpqOsjT3ZCFAONCZVtE,3502
60
+ llm_bridge-1.12.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
61
+ llm_bridge-1.12.6.dist-info/top_level.txt,sha256=PtxyrgNX1lSa1Ab_qswg0sekSXejG5zrS6b_v3Po05g,11
62
+ llm_bridge-1.12.6.dist-info/RECORD,,