feat: refactoring rendering
This commit is contained in:
@@ -20,5 +20,6 @@ export function getAgentNodeDescriptor(): NodeTypeDescriptor {
|
||||
.connectionLabel('prompt/context')
|
||||
.withFullscreen()
|
||||
.sourceRenderingLogic(agentRenderingLogic)
|
||||
.outputMenuContent(() => null)
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* Agent node rendering logic: when the Rendering node runs, it calls the agent API
|
||||
* and updates the agent node's output. Update mode is manual (user clicks Run on the renderer).
|
||||
* Agent node rendering logic: implements the "Resolve" step for agent sources.
|
||||
* Calls the agent API and updates the agent node's output. Update mode is manual.
|
||||
* See lib/graph/rendering.ts (IRenderingSource).
|
||||
*/
|
||||
|
||||
import { getConfigContent } from '@/lib/graph/configTypes'
|
||||
import type { ResolvedContentResult, SourceRenderingLogicContext } from '@/lib/graph/sourceRenderingLogic'
|
||||
import { getConfigContent } from '@/lib/graph/rendering'
|
||||
import type { ResolvedContentResult, SourceRenderingLogicContext } from '@/lib/graph/rendering'
|
||||
import type { AiConnection } from '@/app/kosmos/KosmosContext'
|
||||
|
||||
function serializeNodeForContext(
|
||||
@@ -69,7 +70,6 @@ function parseReasoningAndOutput(fullMarkdown: string): { reasoning?: string; ou
|
||||
|
||||
export const agentRenderingLogic = {
|
||||
defaultUpdateMode: 'manual' as const,
|
||||
getOutputMenuDescriptor: (): null => null,
|
||||
getResolvedContent: async (context: SourceRenderingLogicContext): Promise<ResolvedContentResult> => {
|
||||
const { nodes, sourceNodeId, setNodes, aiConnection, onStreamingStart, onStreamingChunk } = context
|
||||
const sourceNode = nodes.find((n) => n.id === sourceNodeId)
|
||||
|
||||
Reference in New Issue
Block a user