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
Fixed per-item request context being dropped for inline experiment data. When running an experiment with inline `data`, each item's `requestContext` is now passed to the agent or workflow and merged over the global request context (per-item values win on key collisions), matching the behavior of storage-backed datasets.
Wire request context into dataset experiments in Studio.
6
+
7
+
You can now define a dataset's `requestContextSchema` when creating or editing a dataset. You can set per-item `requestContext` values on dataset items. You can also provide run-level request context when triggering an experiment.
8
+
9
+
The run dialog renders a schema-driven form when the dataset declares a `requestContextSchema`, and falls back to a raw JSON editor otherwise. This lets values like `clinicId` flow from Studio through to agent/workflow experiment runs.
10
+
11
+
```ts
12
+
// 1. Dataset declares the request context it expects
* - clinicSupervisorAgent: delegates to clinicSpecialistAgent, which calls clinicLookupTool
12
+
*
13
+
* The tool throws if clinicId is missing from requestContext, so experiment
14
+
* items fail visibly instead of hanging silently.
15
+
*/
16
+
17
+
exportconstclinicDirectAgent=newAgent({
18
+
id: 'clinic-direct-agent',
19
+
name: 'Clinic Direct Agent',
20
+
description: 'Looks up patient records directly. Requires clinicId in requestContext.',
21
+
instructions: `You are a clinic assistant that looks up patient records.
22
+
Always use the clinic-lookup tool to retrieve patient information.
23
+
Include the clinicId and patientId in your response so the caller can verify tenant isolation.`,
24
+
model: 'openai/gpt-5.4-mini',
25
+
tools: {
26
+
clinicLookupTool,
27
+
},
28
+
});
29
+
30
+
exportconstclinicSpecialistAgent=newAgent({
31
+
id: 'clinic-specialist-agent',
32
+
name: 'Clinic Specialist Agent',
33
+
description: 'Specialist sub-agent that looks up patient records. Requires clinicId in requestContext.',
34
+
instructions: `You are a clinical specialist. When asked to look up patient data, use the clinic-lookup tool.
35
+
Always include the clinicId and patientId in your response.`,
36
+
model: 'openai/gpt-5.4-mini',
37
+
tools: {
38
+
clinicLookupTool,
39
+
},
40
+
});
41
+
42
+
exportconstclinicSupervisorAgent=newAgent({
43
+
id: 'clinic-supervisor-agent',
44
+
name: 'Clinic Supervisor Agent',
45
+
description: 'Supervisor agent that delegates patient lookups to the specialist sub-agent. Tests requestContext propagation through agent delegation.',
46
+
instructions: `You are a clinic supervisor. When a user asks you to look up patient data, delegate the task to the clinic-specialist-agent.
47
+
Do not look up records yourself — always hand off to the specialist.
48
+
Report back the specialist's response, including the clinicId they used.`,
0 commit comments