langfuse-haystack 0.6.1__tar.gz → 0.6.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.
Files changed (18) hide show
  1. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/CHANGELOG.md +42 -5
  2. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/PKG-INFO +4 -3
  3. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/src/haystack_integrations/tracing/langfuse/tracer.py +16 -3
  4. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/.gitignore +0 -0
  5. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/LICENSE.txt +0 -0
  6. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/README.md +0 -0
  7. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/example/basic_rag.py +0 -0
  8. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/example/chat.py +0 -0
  9. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/example/requirements.txt +0 -0
  10. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/pydoc/config.yml +0 -0
  11. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/pyproject.toml +0 -0
  12. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/src/haystack_integrations/components/connectors/langfuse/__init__.py +0 -0
  13. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/src/haystack_integrations/components/connectors/langfuse/langfuse_connector.py +0 -0
  14. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/src/haystack_integrations/tracing/langfuse/__init__.py +0 -0
  15. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/tests/__init__.py +0 -0
  16. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/tests/test_langfuse_span.py +0 -0
  17. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/tests/test_tracer.py +0 -0
  18. {langfuse_haystack-0.6.1 → langfuse_haystack-0.6.2}/tests/test_tracing.py +0 -0
@@ -1,23 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## [unreleased]
4
+
5
+ ### 🚀 Features
6
+
7
+ - Warn if LangfuseTracer initialized without tracing enabled (#1231)
8
+
9
+ ### 🧹 Chores
10
+
11
+ - Use text instead of content for ChatMessage in Llama.cpp, Langfuse and Mistral (#1238)
12
+
13
+ ### 🌀 Miscellaneous
14
+
15
+ - Chore: Fix tracing_context_var lint errors (#1220)
16
+
3
17
  ## [integrations/langfuse-v0.6.0] - 2024-11-18
4
18
 
5
19
  ### 🚀 Features
6
20
 
7
21
  - Add support for ttft (#1161)
8
22
 
9
- ### ⚙️ Miscellaneous Tasks
23
+ ### ⚙️ CI
10
24
 
11
25
  - Adopt uv as installer (#1142)
12
26
 
27
+ ### 🌀 Miscellaneous
28
+
29
+ - Fixed TypeError in LangfuseTrace (#1184)
30
+
13
31
  ## [integrations/langfuse-v0.5.0] - 2024-10-01
14
32
 
15
- ### ⚙️ Miscellaneous Tasks
33
+ ### 🧹 Chores
16
34
 
17
35
  - Update ruff linting scripts and settings (#1105)
18
36
 
19
- ### Langfuse
37
+ ### 🌀 Miscellaneous
20
38
 
39
+ - Fix: Add delay to flush the Langfuse traces (#1091)
21
40
  - Add invocation_context to identify traces (#1089)
22
41
 
23
42
  ## [integrations/langfuse-v0.4.0] - 2024-09-17
@@ -38,14 +57,27 @@
38
57
 
39
58
  - Do not retry tests in `hatch run test` command (#954)
40
59
 
41
- ### ⚙️ Miscellaneous Tasks
60
+ ### ⚙️ CI
42
61
 
43
62
  - Retry tests to reduce flakyness (#836)
63
+
64
+ ### 🧹 Chores
65
+
44
66
  - `Langfuse` - replace DynamicChatPromptBuilder with ChatPromptBuilder (#925)
45
67
  - Remove all `DynamicChatPromptBuilder` references in Langfuse integration (#931)
46
68
 
69
+ ### 🌀 Miscellaneous
70
+
71
+ - Ci: install `pytest-rerunfailures` where needed; add retry config to `test-cov` script (#845)
72
+ - Chore: Update Langfuse README to avoid common initialization issues (#952)
73
+ - Chore: langfuse - ruff update, don't ruff tests (#992)
74
+
47
75
  ## [integrations/langfuse-v0.2.0] - 2024-06-18
48
76
 
77
+ ### 🌀 Miscellaneous
78
+
79
+ - Feat: add support for Azure generators (#815)
80
+
49
81
  ## [integrations/langfuse-v0.1.0] - 2024-06-13
50
82
 
51
83
  ### 🚀 Features
@@ -56,8 +88,13 @@
56
88
 
57
89
  - Performance optimizations and value error when streaming in langfuse (#798)
58
90
 
59
- ### ⚙️ Miscellaneous Tasks
91
+ ### 🧹 Chores
60
92
 
61
93
  - Use ChatMessage to_openai_format, update unit tests, pydocs (#725)
62
94
 
95
+ ### 🌀 Miscellaneous
96
+
97
+ - Chore: change the pydoc renderer class (#718)
98
+ - Docs: add missing api references (#728)
99
+
63
100
  <!-- generated by git-cliff -->
@@ -1,11 +1,12 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: langfuse-haystack
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/langfuse#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/langfuse
7
7
  Author-email: deepset GmbH <info@deepset.ai>
8
- License: Apache-2.0
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE.txt
9
10
  Classifier: Development Status :: 4 - Beta
10
11
  Classifier: Programming Language :: Python
11
12
  Classifier: Programming Language :: Python :: 3.8
@@ -5,14 +5,17 @@ from datetime import datetime
5
5
  from typing import Any, Dict, Iterator, List, Optional, Union
6
6
 
7
7
  from haystack import logging
8
- from haystack.components.generators.openai_utils import _convert_message_to_openai_format
9
8
  from haystack.dataclasses import ChatMessage
9
+ from haystack.lazy_imports import LazyImport
10
10
  from haystack.tracing import Span, Tracer
11
11
  from haystack.tracing import tracer as proxy_tracer
12
12
  from haystack.tracing import utils as tracing_utils
13
13
 
14
14
  import langfuse
15
15
 
16
+ with LazyImport("") as openai_utils_import:
17
+ from haystack.components.generators.openai_utils import _convert_message_to_openai_format
18
+
16
19
  logger = logging.getLogger(__name__)
17
20
 
18
21
  HAYSTACK_LANGFUSE_ENFORCE_FLUSH_ENV_VAR = "HAYSTACK_LANGFUSE_ENFORCE_FLUSH"
@@ -83,14 +86,24 @@ class LangfuseSpan(Span):
83
86
  return
84
87
  if key.endswith(".input"):
85
88
  if "messages" in value:
86
- messages = [_convert_message_to_openai_format(m) for m in value["messages"]]
89
+ if openai_utils_import.is_successful():
90
+ # Haystack < 2.9.0
91
+ messages = [_convert_message_to_openai_format(m) for m in value["messages"]]
92
+ else:
93
+ # Haystack >= 2.9.0
94
+ messages = [m.to_openai_dict_format() for m in value["messages"]]
87
95
  self._span.update(input=messages)
88
96
  else:
89
97
  self._span.update(input=value)
90
98
  elif key.endswith(".output"):
91
99
  if "replies" in value:
92
100
  if all(isinstance(r, ChatMessage) for r in value["replies"]):
93
- replies = [_convert_message_to_openai_format(m) for m in value["replies"]]
101
+ if openai_utils_import.is_successful():
102
+ # Haystack < 2.9.0
103
+ replies = [_convert_message_to_openai_format(m) for m in value["replies"]]
104
+ else:
105
+ # Haystack >= 2.9.0
106
+ replies = [m.to_openai_dict_format() for m in value["replies"]]
94
107
  else:
95
108
  replies = value["replies"]
96
109
  self._span.update(output=replies)