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.
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/MANIFEST.in +1 -1
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/PKG-INFO +1 -1
- fiddler_langgraph-0.1.1/PUBLIC.md +169 -0
- fiddler_langgraph-0.1.1/fiddler_langgraph/VERSION +1 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/callback.py +6 -2
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/PKG-INFO +1 -1
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/SOURCES.txt +1 -0
- fiddler_langgraph-0.1.0rc1/fiddler_langgraph/VERSION +0 -1
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/README.md +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/__init__.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/__init__.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/attributes.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/client.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/span_processor.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/__init__.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/instrumentation.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/jsonl_capture.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/util.py +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/dependency_links.txt +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/requires.txt +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/top_level.txt +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/pyproject.toml +0 -0
- {fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/setup.cfg +0 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# fiddler-langgraph
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/fiddler-langgraph/)
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/fiddler-langgraph/)
|
|
6
|
+
|
|
7
|
+
[](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
|
{fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/callback.py
RENAMED
|
@@ -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
|
-
|
|
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 +0,0 @@
|
|
|
1
|
-
0.1.0rc1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/core/span_processor.py
RENAMED
|
File without changes
|
{fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/__init__.py
RENAMED
|
File without changes
|
{fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/instrumentation.py
RENAMED
|
File without changes
|
{fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph/tracing/jsonl_capture.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/requires.txt
RENAMED
|
File without changes
|
{fiddler_langgraph-0.1.0rc1 → fiddler_langgraph-0.1.1}/fiddler_langgraph.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|