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
* Helper to emit run_start event with available metadata
24
+
*/
25
+
functionemitRunStart(
26
+
tracer: Tracer,
27
+
agentType?: string,
28
+
llmModel?: string,
29
+
goal?: string,
30
+
startUrl?: string
31
+
): void{
32
+
try{
33
+
constconfig: Record<string,string>={};
34
+
if(goal){
35
+
config.goal=goal;
36
+
}
37
+
if(startUrl){
38
+
config.start_url=startUrl;
39
+
}
40
+
41
+
tracer.emitRunStart(
42
+
agentType||'SentienceAgent',
43
+
llmModel,
44
+
Object.keys(config).length>0 ? config : undefined
45
+
);
46
+
}catch{
47
+
// Tracing must be non-fatal
48
+
}
49
+
}
50
+
22
51
/**
23
52
* Sentience API base URL (constant)
24
53
*/
@@ -198,6 +227,7 @@ function httpPost(
198
227
* @param options.llmModel - LLM model used (e.g., "gpt-4-turbo", "claude-3-5-sonnet")
199
228
* @param options.startUrl - Starting URL of the agent run (e.g., "https://amazon.com")
200
229
* @param options.screenshotProcessor - Optional function to process screenshots before upload. Takes base64 string, returns processed base64 string. Useful for PII redaction or custom image processing.
230
+
* @param options.autoEmitRunStart - If true (default), automatically emit run_start event with provided metadata. This ensures traces have complete structure for Studio visualization.
201
231
* @returns Tracer configured with appropriate sink
0 commit comments