openrouter-provider 1.0.3__py3-none-any.whl → 1.0.4__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.

Potentially problematic release.


This version of openrouter-provider might be problematic. Click here for more details.

openrouter/llms.py CHANGED
@@ -34,9 +34,8 @@ claude_4_1_opus = LLMModel(name='anthropic/claude-opus-4.1', input_cost=15, outp
34
34
  # Google
35
35
  gemini_2_0_flash = LLMModel(name='google/gemini-2.0-flash-001', input_cost=0.1, output_cost=0.4)
36
36
  gemini_2_5_flash_lite = LLMModel(name='google/gemini-2.5-flash-lite', input_cost=0.1, output_cost=0.4)
37
- gemini_2_5_flash = LLMModel(name='google/gemini-2.5-flash-preview', input_cost=0.15, output_cost=0.60)
38
- gemini_2_5_flash_thinking = LLMModel(name='google/gemini-2.5-flash-preview:thinking', input_cost=0.15, output_cost=3.5)
39
- gemini_2_5_pro = LLMModel(name='google/gemini-2.5-pro-preview-03-25', input_cost=1.25, output_cost=10)
37
+ gemini_2_5_flash = LLMModel(name='google/gemini-2.5-flash', input_cost=0.3, output_cost=2.5)
38
+ gemini_2_5_pro = LLMModel(name='google/gemini-2.5-pro', input_cost=1.25, output_cost=10)
40
39
 
41
40
  # Deepseek
42
41
  deepseek_v3_free = LLMModel(name='deepseek/deepseek-chat-v3-0324:free', input_cost=0, output_cost=0)
@@ -219,11 +219,25 @@ class OpenRouterProvider:
219
219
  messages = self.make_prompt(system_prompt, querys)
220
220
  provider_dict = provider.to_dict() if provider else None
221
221
 
222
+ schema = json_schema.model_json_schema()
223
+
224
+ def add_additional_properties_false(obj):
225
+ if isinstance(obj, dict):
226
+ if "properties" in obj:
227
+ obj["additionalProperties"] = False
228
+ for value in obj.values():
229
+ add_additional_properties_false(value)
230
+ elif isinstance(obj, list):
231
+ for item in obj:
232
+ add_additional_properties_false(item)
233
+
234
+ add_additional_properties_false(schema)
235
+
222
236
  response = self.client.chat.completions.create(
223
237
  model=model.name,
224
238
  temperature=temperature,
225
239
  messages=messages,
226
- response_format={"type": "json_schema", "json_schema": {"name": json_schema.__name__, "schema": json_schema.model_json_schema()}},
240
+ response_format={"type": "json_schema", "json_schema": {"name": json_schema.__name__, "schema": schema}},
227
241
  extra_body={"provider": provider_dict},
228
242
  )
229
243
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openrouter-provider
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: This is an unofficial wrapper of OpenRouter.
5
5
  Author-email: Keisuke Miyamto <aichiboyhighschool@gmail.com>
6
6
  Requires-Python: >=3.7
@@ -0,0 +1,10 @@
1
+ openrouter/__init__.py,sha256=xuIzdm8-l3Tmc-zrNIXTicv05c9HCMxTS9xynKpWK-Q,123
2
+ openrouter/llms.py,sha256=zmujFW5BmQA0Fm6z8skuO3ipLpaUMy1VBZxYkPE9OcM,3391
3
+ openrouter/message.py,sha256=0q0OYdTl3f1TOx79TJRwPYyFuTxoYI9tSCpQN-N8G-A,2870
4
+ openrouter/openrouter.py,sha256=RK8pln0MK8sdwDCaJs1b1PsyamsmAc-E4OdFQZZaOlE,7897
5
+ openrouter/openrouter_provider.py,sha256=w6isS1VX7iMf71zwQ5tMv7v5X0yeMbLF6vqimOrB724,8567
6
+ openrouter/tool.py,sha256=tUUNLosz1XhzPIwY1zHXWNM3ePs7hcVD1a_W5hWTCWk,1975
7
+ openrouter_provider-1.0.4.dist-info/METADATA,sha256=NEYaV2tnh689pvpB08bOXX6xD3-8aSm6ihK2i-Bopuk,11503
8
+ openrouter_provider-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ openrouter_provider-1.0.4.dist-info/top_level.txt,sha256=0jnlCcRirGeYZLm5ZbWQRUonIp4tTPl_9mq-ds_1SEo,11
10
+ openrouter_provider-1.0.4.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- openrouter/__init__.py,sha256=xuIzdm8-l3Tmc-zrNIXTicv05c9HCMxTS9xynKpWK-Q,123
2
- openrouter/llms.py,sha256=IjG3WgmPDbNR8zvAOYDsZvSZNmDjYfPS4IpdtlI4OI8,3535
3
- openrouter/message.py,sha256=0q0OYdTl3f1TOx79TJRwPYyFuTxoYI9tSCpQN-N8G-A,2870
4
- openrouter/openrouter.py,sha256=RK8pln0MK8sdwDCaJs1b1PsyamsmAc-E4OdFQZZaOlE,7897
5
- openrouter/openrouter_provider.py,sha256=FWyEOM5kJfP7q3RLZdut4XNaU_I4DHrMBskwkRyj4Jg,8051
6
- openrouter/tool.py,sha256=tUUNLosz1XhzPIwY1zHXWNM3ePs7hcVD1a_W5hWTCWk,1975
7
- openrouter_provider-1.0.3.dist-info/METADATA,sha256=GhJ1RIhY2XSuK-iTD_N9XbpijF3nbHTO-kKiIR7TYHA,11503
8
- openrouter_provider-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- openrouter_provider-1.0.3.dist-info/top_level.txt,sha256=0jnlCcRirGeYZLm5ZbWQRUonIp4tTPl_9mq-ds_1SEo,11
10
- openrouter_provider-1.0.3.dist-info/RECORD,,