fiddler-langgraph 0.1.0rc1__tar.gz → 0.1.1__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 (23) hide show
  1. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/MANIFEST.in +1 -1
  2. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/PKG-INFO +1 -1
  3. fiddler_langgraph-0.1.1/PUBLIC.md +169 -0
  4. fiddler_langgraph-0.1.1/fiddler_langgraph/VERSION +1 -0
  5. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/callback.py +6 -2
  6. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/PKG-INFO +1 -1
  7. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/SOURCES.txt +1 -0
  8. fiddler_langgraph-0.1.0rc1/fiddler_langgraph/VERSION +0 -1
  9. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/README.md +0 -0
  10. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/__init__.py +0 -0
  11. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/__init__.py +0 -0
  12. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/attributes.py +0 -0
  13. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/client.py +0 -0
  14. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/span_processor.py +0 -0
  15. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/__init__.py +0 -0
  16. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/instrumentation.py +0 -0
  17. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/jsonl_capture.py +0 -0
  18. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/util.py +0 -0
  19. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/dependency_links.txt +0 -0
  20. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/requires.txt +0 -0
  21. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/top_level.txt +0 -0
  22. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/pyproject.toml +0 -0
  23. {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/setup.cfg +0 -0
@@ -1,5 +1,5 @@
1
1
  include LICENSE
2
- include README.md
2
+ include PUBLIC.md
3
3
  include fiddler_langgraph/VERSION
4
4
  recursive-include fiddler_langgraph *.py
5
5
  recursive-exclude tests *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fiddler-langgraph
3
- Version: 0.1.0rc1
3
+ Version: 0.1.1
4
4
  Summary: Python SDK for instrumenting GenAI Applications with Fiddler
5
5
  Home-page: https://fiddler.ai
6
6
  Author: Fiddler AI
@@ -0,0 +1,169 @@
1
+ # fiddler-langgraph
2
+
3
+ [![Python Version](https://img.shields.io/pypi/pyversions/fiddler-langgraph.svg)](https://pypi.org/project/fiddler-langgraph/)
4
+
5
+ [![PyPI Version](https://img.shields.io/pypi/v/fiddler-langgraph.svg)](https://pypi.org/project/fiddler-langgraph/)
6
+
7
+ [![License](https://img.shields.io/pypi/l/fiddler-langgraph.svg)](https://pypi.org/project/fiddler-langgraph/)
8
+
9
+ The official Python SDK for instrumenting GenAI Applications with [Fiddler](https://www.fiddler.ai) using OpenTelemetry and LangGraph. Monitor, analyze, and protect your LangGraph workflows, LLMs, and AI Agents in production.
10
+
11
+ ## Platform Features
12
+
13
+ - 🚀 **Easy Integration** - Simple Python API for LangGraph application instrumentation
14
+ - 📊 **OpenTelemetry Tracing** - Full distributed tracing support with configurable span limits
15
+ - 🔍 **Automatic Instrumentation** - Zero-config tracing for LangGraph workflows, chains, and tools
16
+ - 🎯 **LLM Context Management** - Set additional context for LLM processing with `set_llm_context()`
17
+ - 💬 **Conversation Tracking** - Track multi-turn conversations with `set_conversation_id()`
18
+ - 📈 **Performance Metrics** - Automatic tracking of timing, token usage, and model information
19
+ - 🛡️ **Error Handling** - Comprehensive error tracking with detailed stack traces
20
+ - 🔄 **Flexible Configuration** - Custom span limits, sampling strategies, and batch processing
21
+ - 📊 **Resource Management** - Conservative defaults to prevent resource exhaustion
22
+ - 🎨 **Message Serialization** - Smart handling of complex message content (lists, dicts)
23
+ - 🔔 **Attribute Truncation** - Automatic truncation of long attribute values to prevent oversized spans
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ pip install fiddler-langgraph
29
+ ```
30
+
31
+ ## Requirements
32
+
33
+ - Python 3.10, 3.11, 3.12, 3.13 or 3.14
34
+ - LangGraph >= 0.3.28 and <= 1.0.2 or Langchain >= 0.3.28 and <= 1.0.2
35
+
36
+ ### With Example Dependencies
37
+
38
+ To run the example scripts:
39
+
40
+ ```bash
41
+ pip install fiddler-langgraph[examples]
42
+ ```
43
+
44
+ ## Quick Start
45
+
46
+ ```python
47
+ from fiddler_langgraph import FiddlerClient
48
+ from fiddler_langgraph.tracing.instrumentation import LangGraphInstrumentor, set_llm_context, set_conversation_id
49
+
50
+ # Initialize the FiddlerClient
51
+ client = FiddlerClient(
52
+ url="https://api.fiddler.ai",
53
+ api_key="your-api-key",
54
+ application_id="your-application-id" # Must be a valid UUID4
55
+ )
56
+
57
+ # Instrument LangGraph applications
58
+ LangGraphInstrumentor(client).instrument()
59
+
60
+ # Set additional context for LLM processing
61
+ from langchain_openai import ChatOpenAI
62
+ model = ChatOpenAI(model='gpt-4o-mini')
63
+ set_llm_context(model, "Previous conversation context")
64
+
65
+ # Set conversation ID for multi-turn conversations
66
+ from langgraph.graph import StateGraph
67
+ workflow = StateGraph(state_schema=State)
68
+ app = workflow.compile()
69
+ set_conversation_id("conversation_123")
70
+ app.invoke({"messages": [{"role": "user", "content": "Write a novel"}]})
71
+ ```
72
+
73
+ ## Documentation
74
+
75
+ * 📚 [Complete Documentation](https://docs.fiddler.ai/)
76
+ * 🚀 [Getting Started with LangGraph](https://docs.fiddler.ai/)
77
+ * 📖 [API Reference](https://docs.fiddler.ai/)
78
+ * 💡 [Example Notebooks](https://github.com/fiddler-labs/fiddler-examples)
79
+
80
+ ## Example Usage
81
+
82
+ ### Basic Instrumentation
83
+
84
+ ```python
85
+ from fiddler_langgraph.tracing.instrumentation import LangGraphInstrumentor
86
+
87
+ # Initialize and instrument
88
+ instrumentor = LangGraphInstrumentor(client)
89
+ instrumentor.instrument()
90
+ ```
91
+
92
+ ### Setting LLM Context
93
+
94
+ ```python
95
+ from fiddler_langgraph.tracing.instrumentation import set_llm_context
96
+ from langchain_openai import ChatOpenAI
97
+
98
+ model = ChatOpenAI(model='gpt-4o-mini')
99
+ set_llm_context(model, "User prefers concise responses")
100
+ ```
101
+
102
+ ### Conversation Tracking
103
+
104
+ ```python
105
+ from fiddler_langgraph.tracing.instrumentation import set_conversation_id
106
+ import uuid
107
+
108
+ # Set conversation ID for tracking multi-turn conversations
109
+ conversation_id = str(uuid.uuid4())
110
+ set_conversation_id(conversation_id)
111
+ ```
112
+
113
+ ### Advanced Configuration
114
+
115
+ ```python
116
+ from opentelemetry.sdk.trace import SpanLimits, sampling
117
+ from opentelemetry.exporter.otlp.proto.http.trace_exporter import Compression
118
+
119
+ # Custom span limits for high-volume applications
120
+ custom_limits = SpanLimits(
121
+ max_events=64,
122
+ max_links=64,
123
+ max_span_attributes=64,
124
+ max_event_attributes=64,
125
+ max_link_attributes=64,
126
+ max_span_attribute_length=4096,
127
+ )
128
+
129
+ # Sampling strategy for production
130
+ sampler = sampling.TraceIdRatioBased(0.1) # Sample 10% of traces
131
+
132
+ client = FiddlerClient(
133
+ api_key="your-api-key",
134
+ application_id="your-app-id",
135
+ span_limits=custom_limits,
136
+ sampler=sampler,
137
+ console_tracer=False, # Set to True for debugging
138
+ compression=Compression.Gzip, # Enable gzip compression (default)
139
+ )
140
+ ```
141
+
142
+ ## Example Notebooks
143
+
144
+ Check out our [GitHub repository](https://github.com/fiddler-labs/fiddler-sdk/tree/main/examples) for example scripts demonstrating:
145
+
146
+ - Basic LangGraph instrumentation
147
+ - LLM context management
148
+ - Conversation tracking
149
+ - Multi-agent workflows
150
+ - Travel agent applications
151
+ - Chatbot implementations
152
+
153
+ ## Version History
154
+
155
+ See our [release notes](https://docs.fiddler.ai/history/python-client-history) for detailed version history.
156
+
157
+ ## Support
158
+
159
+ - 📧 Email: [support@fiddler.ai](mailto:support@fiddler.ai)
160
+ - 💬 Community: [Join our Slack](https://www.fiddler.ai/slack)
161
+ - 🐛 Issues: [GitHub Issues](https://github.com/fiddler-labs/fiddler-sdk/issues)
162
+
163
+ ## License
164
+
165
+ Apache License 2.0 - see LICENSE file for details
166
+
167
+ ---
168
+
169
+ **Want to see Fiddler in action?** [Request a demo](https://www.fiddler.ai/demo)
@@ -0,0 +1 @@
1
+ 0.1.1
@@ -208,7 +208,12 @@ class _CallbackHandler(BaseCallbackHandler):
208
208
  if metadata is not None:
209
209
  fiddler_attributes = metadata.get(FIDDLER_METADATA_KEY, {})
210
210
  for key, value in fiddler_attributes.items():
211
- fdl_key = FIDDLER_USER_SPAN_ATTRIBUTE_TEMPLATE.format(key=key)
211
+ # FiddlerSpanAttributes keys should not be prefixed with fiddler.span.user.
212
+ fdl_key = (
213
+ key
214
+ if key in vars(FiddlerSpanAttributes).values()
215
+ else FIDDLER_USER_SPAN_ATTRIBUTE_TEMPLATE.format(key=key)
216
+ )
212
217
  span.set_attribute(fdl_key, value)
213
218
 
214
219
  def _update_root_span_agent_name(self, agent_name: str) -> None:
@@ -626,7 +631,6 @@ class _CallbackHandler(BaseCallbackHandler):
626
631
  system_message = [m for m in messages[0] if isinstance(m, SystemMessage)]
627
632
  user_message = [m for m in messages[0] if isinstance(m, HumanMessage)]
628
633
 
629
- # breakpoint()
630
634
  if metadata is not None:
631
635
  _set_agent_name(child_span, metadata)
632
636
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fiddler-langgraph
3
- Version: 0.1.0rc1
3
+ Version: 0.1.1
4
4
  Summary: Python SDK for instrumenting GenAI Applications with Fiddler
5
5
  Home-page: https://fiddler.ai
6
6
  Author: Fiddler AI
@@ -1,4 +1,5 @@
1
1
  MANIFEST.in
2
+ PUBLIC.md
2
3
  README.md
3
4
  pyproject.toml
4
5
  fiddler_langgraph/VERSION
@@ -1 +0,0 @@
1
- 0.1.0rc1