@@ -88,6 +88,7 @@ router.post("/sdk/robots", requireAPIKey, async (req: AuthenticatedRequest, res:
|
|||||||
type,
|
type,
|
||||||
url: extractedUrl,
|
url: extractedUrl,
|
||||||
formats: (workflowFile.meta as any).formats || [],
|
formats: (workflowFile.meta as any).formats || [],
|
||||||
|
isLLM: (workflowFile.meta as any).isLLM,
|
||||||
};
|
};
|
||||||
|
|
||||||
const robot = await Robot.create({
|
const robot = await Robot.create({
|
||||||
@@ -102,10 +103,14 @@ router.post("/sdk/robots", requireAPIKey, async (req: AuthenticatedRequest, res:
|
|||||||
const eventName = robotMeta.isLLM
|
const eventName = robotMeta.isLLM
|
||||||
? "maxun-oss-llm-robot-created"
|
? "maxun-oss-llm-robot-created"
|
||||||
: "maxun-oss-robot-created";
|
: "maxun-oss-robot-created";
|
||||||
capture(eventName, {
|
const telemetryData: any = {
|
||||||
robot_meta: robot.recording_meta,
|
robot_meta: robot.recording_meta,
|
||||||
recording: robot.recording,
|
recording: robot.recording,
|
||||||
});
|
};
|
||||||
|
if (robotMeta.isLLM && (workflowFile.meta as any).prompt) {
|
||||||
|
telemetryData.prompt = (workflowFile.meta as any).prompt;
|
||||||
|
}
|
||||||
|
capture(eventName, telemetryData);
|
||||||
|
|
||||||
return res.status(201).json({
|
return res.status(201).json({
|
||||||
data: robot,
|
data: robot,
|
||||||
@@ -698,6 +703,7 @@ router.post("/sdk/extract/llm", requireAPIKey, async (req: AuthenticatedRequest,
|
|||||||
capture("maxun-oss-llm-robot-created", {
|
capture("maxun-oss-llm-robot-created", {
|
||||||
robot_meta: robot.recording_meta,
|
robot_meta: robot.recording_meta,
|
||||||
recording: robot.recording,
|
recording: robot.recording,
|
||||||
|
prompt: prompt,
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
|
|||||||
@@ -589,6 +589,7 @@ router.post('/recordings/llm', requireSignIn, async (req: AuthenticatedRequest,
|
|||||||
robot_meta: newRobot.recording_meta,
|
robot_meta: newRobot.recording_meta,
|
||||||
recording: newRobot.recording,
|
recording: newRobot.recording,
|
||||||
llm_provider: llmProvider || 'ollama',
|
llm_provider: llmProvider || 'ollama',
|
||||||
|
prompt: prompt,
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.status(201).json({
|
return res.status(201).json({
|
||||||
|
|||||||
Reference in New Issue
Block a user