litellm-haystack 1.1.0__tar.gz → 1.1.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.
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ ## [integrations/litellm-v1.1.1] - 2026-07-15
4
+
5
+ ### 🧹 Chores
6
+
7
+ - Support sync streaming callbacks in async contexts for Haystack 2.x/3.x compatibility (#3534)
8
+ - Update litellm dependency version in pyproject.toml (#3599)
9
+
10
+
11
+ ## [integrations/litellm-v1.1.0] - 2026-06-04
12
+
13
+ ### 🚀 Features
14
+
15
+ - LiteLLM - accept str as ChatGenerator input (#3393)
16
+
17
+
18
+ ## [integrations/litellm-v1.0.0] - 2026-05-29
19
+
20
+ ### 🚀 Features
21
+
22
+ - Add LiteLLM integration with LiteLLMChatGenerator component (#3257)
23
+
24
+ <!-- generated by git-cliff -->
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: litellm-haystack
3
- Version: 1.1.0
3
+ Version: 1.1.2
4
4
  Summary: An integration of LiteLLM AI gateway into the Haystack framework, routing to 100+ LLM providers.
5
5
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/litellm#readme
6
6
  Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.14
20
20
  Classifier: Programming Language :: Python :: Implementation :: CPython
21
21
  Requires-Python: >=3.10
22
22
  Requires-Dist: haystack-ai>=2.30.0
23
- Requires-Dist: litellm!=1.82.7,!=1.82.8,<2.0,>=1.60.0
23
+ Requires-Dist: litellm<1.92.0,>=1.84.0
24
24
  Description-Content-Type: text/markdown
25
25
 
26
26
  # litellm-haystack
@@ -22,8 +22,9 @@ classifiers = [
22
22
  "Programming Language :: Python :: 3.14",
23
23
  "Programming Language :: Python :: Implementation :: CPython",
24
24
  ]
25
- # litellm 1.82.7 and 1.82.8 were malicious releases and are excluded.
26
- dependencies = ["haystack-ai>=2.30.0", "litellm>=1.60.0,<2.0,!=1.82.7,!=1.82.8"]
25
+ # litellm capped below 1.92.0: that release ships cp310-cp313-only compiled wheels
26
+ # (source build fails on Python 3.14) and imports fastapi (proxy extra) on any tool call
27
+ dependencies = ["haystack-ai>=2.30.0", "litellm>=1.84.0,<1.92.0"]
27
28
 
28
29
  [project.urls]
29
30
  Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/litellm#readme"
@@ -2,6 +2,7 @@
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
 
5
+ import inspect
5
6
  import json
6
7
  from typing import Any
7
8
 
@@ -9,7 +10,6 @@ from haystack import component, default_from_dict, default_to_dict, logging
9
10
  from haystack.components.generators.utils import _convert_streaming_chunks_to_chat_message, _normalize_messages
10
11
  from haystack.dataclasses import ChatMessage, ToolCall
11
12
  from haystack.dataclasses.streaming_chunk import (
12
- AsyncStreamingCallbackT,
13
13
  ComponentInfo,
14
14
  FinishReason,
15
15
  StreamingCallbackT,
@@ -218,13 +218,16 @@ class LiteLLMChatGenerator:
218
218
  callback(stream_chunk)
219
219
  return [_convert_streaming_chunks_to_chat_message(chunks=chunks)]
220
220
 
221
- async def _ahandle_streaming(self, stream_response: Any, callback: AsyncStreamingCallbackT) -> list[ChatMessage]:
221
+ async def _ahandle_streaming(self, stream_response: Any, callback: StreamingCallbackT) -> list[ChatMessage]:
222
222
  component_info = ComponentInfo.from_component(self)
223
223
  chunks: list[StreamingChunk] = []
224
224
  async for chunk in stream_response:
225
225
  stream_chunk = _convert_litellm_chunk_to_streaming_chunk(chunk, chunks, component_info)
226
226
  chunks.append(stream_chunk)
227
- await callback(stream_chunk)
227
+ # sync callbacks are allowed in async contexts with Haystack >= 3.0, so only await async ones
228
+ callback_result = callback(stream_chunk)
229
+ if inspect.isawaitable(callback_result):
230
+ await callback_result
228
231
  return [_convert_streaming_chunks_to_chat_message(chunks=chunks)]
229
232
 
230
233
  def to_dict(self) -> dict[str, Any]:
@@ -1,9 +0,0 @@
1
- # Changelog
2
-
3
- ## [integrations/litellm-v1.0.0] - 2026-05-29
4
-
5
- ### 🚀 Features
6
-
7
- - Add LiteLLM integration with LiteLLMChatGenerator component (#3257)
8
-
9
- <!-- generated by git-cliff -->