You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/docs/evaluation/experiments/experiments-via-sdk.mdx
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,6 +150,21 @@ Run experiments directly on datasets stored in Langfuse for automatic tracing an
150
150
{/* PYTHON SDK */}
151
151
152
152
```python
153
+
from langfuse import get_client
154
+
from langfuse.openai import OpenAI
155
+
156
+
# Initialize client
157
+
langfuse = get_client()
158
+
159
+
# Define your task function
160
+
defmy_task(*, item, **kwargs):
161
+
question = item.input # `run_experiment` passes a `DatasetItemClient` to the task function. The input of the dataset item is available as `item.input`.
0 commit comments