openrouter-haystack 2.1.0__tar.gz → 3.0.0__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 (17) hide show
  1. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/CHANGELOG.md +11 -0
  2. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/PKG-INFO +1 -1
  3. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/src/haystack_integrations/components/generators/openrouter/chat/chat_generator.py +2 -2
  4. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/tests/test_openrouter_chat_generator.py +26 -25
  5. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/tests/test_openrouter_chat_generator_async.py +1 -1
  6. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/.gitignore +0 -0
  7. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/LICENSE.txt +0 -0
  8. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/README.md +0 -0
  9. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/examples/openrouter_with_structured_outputs.py +0 -0
  10. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/examples/openrouter_with_tools_example.py +0 -0
  11. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/pydoc/config_docusaurus.yml +0 -0
  12. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/pyproject.toml +0 -0
  13. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/src/haystack_integrations/components/generators/openrouter/__init__.py +0 -0
  14. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/src/haystack_integrations/components/generators/openrouter/chat/__init__.py +0 -0
  15. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/src/haystack_integrations/components/generators/py.typed +0 -0
  16. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/tests/__init__.py +0 -0
  17. {openrouter_haystack-2.1.0 → openrouter_haystack-3.0.0}/tests/conftest.py +0 -0
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/openrouter-v2.1.0] - 2026-11-19
4
+
5
+ ### 🐛 Bug Fixes
6
+
7
+ - OpenRouter - respect an empty runtime tools list (#4223)
8
+
9
+ ### 🚜 Refactor
10
+
11
+ - Simplify `OpenRouterChatGenerator` (#4287)
12
+
13
+
3
14
  ## [integrations/openrouter-v2.0.0] - 2026-10-16
4
15
 
5
16
  ### 🧪 Testing
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: openrouter-haystack
3
- Version: 2.1.0
3
+ Version: 3.0.0
4
4
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/openrouter#readme
5
5
  Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
6
6
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/openrouter
@@ -190,7 +190,7 @@ class OpenRouterChatGenerator(OpenAIChatGenerator):
190
190
  messages = [ChatMessage.from_user("What's Natural Language Processing?")]
191
191
 
192
192
  client = OpenRouterChatGenerator(
193
- model="deepseek/deepseek-r1",
193
+ model="deepseek/deepseek-r1-0528",
194
194
  generation_kwargs={"reasoning": {"effort": "high"}},
195
195
  )
196
196
  response = client.run(messages)
@@ -203,7 +203,7 @@ class OpenRouterChatGenerator(OpenAIChatGenerator):
203
203
  self,
204
204
  *,
205
205
  api_key: Secret = Secret.from_env_var("OPENROUTER_API_KEY"),
206
- model: str = "openai/gpt-5-mini",
206
+ model: str = "openai/gpt-6.1-terra",
207
207
  streaming_callback: StreamingCallbackT | None = None,
208
208
  api_base_url: str | None = "https://openrouter.ai/api/v1",
209
209
  generation_kwargs: dict[str, Any] | None = None,
@@ -87,7 +87,7 @@ class TestOpenRouterChatGeneratorUnit:
87
87
  monkeypatch.setenv("OPENROUTER_API_KEY", "test-api-key")
88
88
  component = OpenRouterChatGenerator()
89
89
  assert component.api_key.resolve_value() == "test-api-key"
90
- assert component.model == "openai/gpt-5-mini"
90
+ assert component.model == "openai/gpt-6.1-terra"
91
91
  assert component.api_base_url == "https://openrouter.ai/api/v1"
92
92
  assert component.streaming_callback is None
93
93
  assert not component.generation_kwargs
@@ -117,7 +117,7 @@ class TestOpenRouterChatGeneratorUnit:
117
117
 
118
118
  expected_params = {
119
119
  "api_key": {"env_vars": ["OPENROUTER_API_KEY"], "strict": True, "type": "env_var"},
120
- "model": "openai/gpt-5-mini",
120
+ "model": "openai/gpt-6.1-terra",
121
121
  "streaming_callback": None,
122
122
  "api_base_url": "https://openrouter.ai/api/v1",
123
123
  "generation_kwargs": {},
@@ -176,7 +176,7 @@ class TestOpenRouterChatGeneratorUnit:
176
176
  ),
177
177
  "init_parameters": {
178
178
  "api_key": {"env_vars": ["OPENROUTER_API_KEY"], "strict": True, "type": "env_var"},
179
- "model": "openai/gpt-5-mini",
179
+ "model": "openai/gpt-6.1-terra",
180
180
  "api_base_url": "test-base-url",
181
181
  "streaming_callback": "haystack.components.generators.utils.print_streaming_chunk",
182
182
  "generation_kwargs": {"max_tokens": 10, "some_test_param": "test-params"},
@@ -188,7 +188,7 @@ class TestOpenRouterChatGeneratorUnit:
188
188
  },
189
189
  }
190
190
  component = OpenRouterChatGenerator.from_dict(data)
191
- assert component.model == "openai/gpt-5-mini"
191
+ assert component.model == "openai/gpt-6.1-terra"
192
192
  assert component.streaming_callback is print_streaming_chunk
193
193
  assert component.api_base_url == "test-base-url"
194
194
  assert component.generation_kwargs == {"max_tokens": 10, "some_test_param": "test-params"}
@@ -246,7 +246,7 @@ class TestOpenRouterChatGeneratorUnit:
246
246
  ),
247
247
  "init_parameters": {
248
248
  "api_key": {"type": "env_var", "env_vars": ["OPENROUTER_API_KEY"], "strict": True},
249
- "model": "openai/gpt-5-mini",
249
+ "model": "openai/gpt-6.1-terra",
250
250
  "streaming_callback": "haystack.components.generators.utils.print_streaming_chunk",
251
251
  "api_base_url": "https://openrouter.ai/api/v1",
252
252
  "generation_kwargs": {"temperature": 0.7},
@@ -294,7 +294,7 @@ class TestOpenRouterChatGeneratorIntegration:
294
294
  assert len(results["replies"]) == 1
295
295
  message: ChatMessage = results["replies"][0]
296
296
  assert "Paris" in message.text
297
- assert "openai/gpt-5-mini" in message.meta["model"]
297
+ assert "openai/gpt-6.1-terra" in message.meta["model"]
298
298
  assert message.meta["finish_reason"] == "stop"
299
299
 
300
300
  if streaming:
@@ -366,7 +366,7 @@ class TestOpenRouterChatGeneratorIntegration:
366
366
  callback = CollectorCallback() if streaming else None
367
367
  chat_messages = [ChatMessage.from_user("If x + 3 = 7, what is x?")]
368
368
  component = OpenRouterChatGenerator(
369
- model="deepseek/deepseek-r1",
369
+ model="deepseek/deepseek-r1-0528",
370
370
  streaming_callback=callback,
371
371
  generation_kwargs={"reasoning": {"effort": "high"}, "max_tokens": 1000},
372
372
  )
@@ -403,7 +403,8 @@ class TestOpenRouterChatGeneratorIntegration:
403
403
  }
404
404
 
405
405
  # Use a more explicit prompt that emphasizes JSON structure requirement
406
- # gpt-5-mini is very rarely flaky but to harden CI we'll be more explicit
406
+ # Model switched from gpt-5-mini to gpt-6.1-terra on 2026-11-30;
407
+ # this prompt is explicit to harden CI against flakiness
407
408
  chat_messages = [
408
409
  ChatMessage.from_user(
409
410
  "What's the capital of France? "
@@ -411,7 +412,7 @@ class TestOpenRouterChatGeneratorIntegration:
411
412
  )
412
413
  ]
413
414
  comp = OpenRouterChatGenerator(
414
- model="openai/gpt-5-mini", generation_kwargs={"response_format": response_schema, "max_tokens": 1000}
415
+ model="openai/gpt-6.1-terra", generation_kwargs={"response_format": response_schema, "max_tokens": 1000}
415
416
  )
416
417
  results = comp.run(chat_messages)
417
418
  assert len(results["replies"]) == 1
@@ -443,7 +444,7 @@ class TestOpenRouterChatGeneratorIntegration:
443
444
  )
444
445
  ]
445
446
  component = OpenRouterChatGenerator(
446
- model="openai/gpt-5-mini", generation_kwargs={"response_format": CalendarEvent, "max_tokens": 1000}
447
+ model="openai/gpt-6.1-terra", generation_kwargs={"response_format": CalendarEvent, "max_tokens": 1000}
447
448
  )
448
449
  results = component.run(chat_messages)
449
450
  assert len(results["replies"]) == 1
@@ -538,7 +539,7 @@ class TestChatCompletionChunkConversion:
538
539
  ChoiceChunk(delta=ChoiceDelta(content="", role="assistant"), index=0, native_finish_reason=None)
539
540
  ],
540
541
  created=1750162525,
541
- model="openai/gpt-5-mini",
542
+ model="openai/gpt-6.1-terra",
542
543
  object="chat.completion.chunk",
543
544
  system_fingerprint="fp_34a54ae93c",
544
545
  provider="OpenAI",
@@ -563,7 +564,7 @@ class TestChatCompletionChunkConversion:
563
564
  )
564
565
  ],
565
566
  created=1750162525,
566
- model="openai/gpt-5-mini",
567
+ model="openai/gpt-6.1-terra",
567
568
  object="chat.completion.chunk",
568
569
  system_fingerprint="fp_34a54ae93c",
569
570
  provider="OpenAI",
@@ -587,7 +588,7 @@ class TestChatCompletionChunkConversion:
587
588
  )
588
589
  ],
589
590
  created=1750162525,
590
- model="openai/gpt-5-mini",
591
+ model="openai/gpt-6.1-terra",
591
592
  object="chat.completion.chunk",
592
593
  system_fingerprint="fp_34a54ae93c",
593
594
  provider="OpenAI",
@@ -611,7 +612,7 @@ class TestChatCompletionChunkConversion:
611
612
  )
612
613
  ],
613
614
  created=1750162525,
614
- model="openai/gpt-5-mini",
615
+ model="openai/gpt-6.1-terra",
615
616
  object="chat.completion.chunk",
616
617
  system_fingerprint="fp_34a54ae93c",
617
618
  provider="OpenAI",
@@ -635,7 +636,7 @@ class TestChatCompletionChunkConversion:
635
636
  )
636
637
  ],
637
638
  created=1750162525,
638
- model="openai/gpt-5-mini",
639
+ model="openai/gpt-6.1-terra",
639
640
  object="chat.completion.chunk",
640
641
  system_fingerprint="fp_34a54ae93c",
641
642
  provider="OpenAI",
@@ -659,7 +660,7 @@ class TestChatCompletionChunkConversion:
659
660
  )
660
661
  ],
661
662
  created=1750162525,
662
- model="openai/gpt-5-mini",
663
+ model="openai/gpt-6.1-terra",
663
664
  object="chat.completion.chunk",
664
665
  system_fingerprint="fp_34a54ae93c",
665
666
  provider="OpenAI",
@@ -684,7 +685,7 @@ class TestChatCompletionChunkConversion:
684
685
  )
685
686
  ],
686
687
  created=1750162525,
687
- model="openai/gpt-5-mini",
688
+ model="openai/gpt-6.1-terra",
688
689
  object="chat.completion.chunk",
689
690
  service_tier=None,
690
691
  system_fingerprint="fp_34a54ae93c",
@@ -711,7 +712,7 @@ class TestChatCompletionChunkConversion:
711
712
  )
712
713
  ],
713
714
  created=1750162525,
714
- model="openai/gpt-5-mini",
715
+ model="openai/gpt-6.1-terra",
715
716
  object="chat.completion.chunk",
716
717
  system_fingerprint="fp_34a54ae93c",
717
718
  provider="OpenAI",
@@ -735,7 +736,7 @@ class TestChatCompletionChunkConversion:
735
736
  )
736
737
  ],
737
738
  created=1750162525,
738
- model="openai/gpt-5-mini",
739
+ model="openai/gpt-6.1-terra",
739
740
  object="chat.completion.chunk",
740
741
  system_fingerprint="fp_34a54ae93c",
741
742
  provider="OpenAI",
@@ -759,7 +760,7 @@ class TestChatCompletionChunkConversion:
759
760
  )
760
761
  ],
761
762
  created=1750162525,
762
- model="openai/gpt-5-mini",
763
+ model="openai/gpt-6.1-terra",
763
764
  object="chat.completion.chunk",
764
765
  system_fingerprint="fp_34a54ae93c",
765
766
  provider="OpenAI",
@@ -783,7 +784,7 @@ class TestChatCompletionChunkConversion:
783
784
  )
784
785
  ],
785
786
  created=1750162525,
786
- model="openai/gpt-5-mini",
787
+ model="openai/gpt-6.1-terra",
787
788
  object="chat.completion.chunk",
788
789
  system_fingerprint="fp_34a54ae93c",
789
790
  provider="OpenAI",
@@ -799,7 +800,7 @@ class TestChatCompletionChunkConversion:
799
800
  )
800
801
  ],
801
802
  created=1750162525,
802
- model="openai/gpt-5-mini",
803
+ model="openai/gpt-6.1-terra",
803
804
  object="chat.completion.chunk",
804
805
  system_fingerprint="fp_34a54ae93c",
805
806
  provider="OpenAI",
@@ -814,7 +815,7 @@ class TestChatCompletionChunkConversion:
814
815
  )
815
816
  ],
816
817
  created=1750162525,
817
- model="openai/gpt-5-mini",
818
+ model="openai/gpt-6.1-terra",
818
819
  object="chat.completion.chunk",
819
820
  usage=CompletionUsage(
820
821
  completion_tokens=42,
@@ -844,7 +845,7 @@ class TestChatCompletionChunkConversion:
844
845
  assert result.tool_calls[1].arguments == {"city": "Berlin"}
845
846
 
846
847
  # Verify meta information
847
- assert result.meta["model"] == "openai/gpt-5-mini"
848
+ assert result.meta["model"] == "openai/gpt-6.1-terra"
848
849
  assert result.meta["finish_reason"] == "tool_calls"
849
850
  assert result.meta["index"] == 0
850
851
  assert result.meta["completion_start_time"] is not None
@@ -993,7 +994,7 @@ class TestReasoningSupport:
993
994
  def test_convert_completion_without_reasoning(self):
994
995
  completion = ChatCompletion(
995
996
  id="test-no-reasoning",
996
- model="openai/gpt-5-mini",
997
+ model="openai/gpt-6.1-terra",
997
998
  object="chat.completion",
998
999
  choices=[
999
1000
  Choice(
@@ -134,7 +134,7 @@ class TestOpenRouterChatGeneratorAsyncIntegration:
134
134
  assert len(results["replies"]) == 1
135
135
  message: ChatMessage = results["replies"][0]
136
136
  assert "Paris" in message.text
137
- assert "openai/gpt-5-mini" in message.meta["model"]
137
+ assert "openai/gpt-6.1-terra" in message.meta["model"]
138
138
  assert message.meta["finish_reason"] == "stop"
139
139
 
140
140
  if streaming: