MCPcopy
hub / github.com/ModelEngine-Group/nexent / getOrCreateCurrentStep

Function getOrCreateCurrentStep

frontend/lib/chatMessageExtractor.ts:43–59  ·  view source on GitHub ↗
(
  steps: AgentStep[],
  fallbackTitle: string
)

Source from the content-addressed store, hash-verified

41});
42
43const getOrCreateCurrentStep = (
44 steps: AgentStep[],
45 fallbackTitle: string
46): AgentStep => {
47 const currentStep = steps[steps.length - 1];
48 if (currentStep) {
49 return currentStep;
50 }
51
52 const recoveredStep = createAgentStep(
53 `step-history-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,
54 fallbackTitle,
55 true
56 );
57 steps.push(recoveredStep);
58 return recoveredStep;
59};
60
61export function extractAssistantMsgFromResponse(
62 dialog_msg: ApiMessage,

Callers 1

Calls 4

createAgentStepFunction · 0.85
nowMethod · 0.80
toStringMethod · 0.80
randomMethod · 0.80

Tested by

no test coverage detected