updateNodeData(id, { modelId })} />
updateNodeData(id, { provider })} />
Message
{#if fileUpload.isDragging}
Drop the image here to upload
{/if}
{characterCount}
{ updateNodeData(id, { query: evt.currentTarget.value }); }} {@attach autosized.attachment} >
{#each data.imageIds ?? [] as imgKey (imgKey)} {#await images.get(imgKey)} {:then imgSrc}
previewImage(imgSrc)} >
{ e.stopPropagation(); updateNodeData(id, { imageIds: data.imageIds?.filter(i => i !== imgKey) }); images.delete(imgKey); }} class="invisible absolute -top-1 -right-1 z-20 grid size-5 place-items-center rounded-full bg-gray-800 text-xs text-white group-hover/img:visible hover:bg-gray-700" > ✕
{/await} {/each}
Shift + Enter for newline
{#if isLoading}
Stop {:else}
Send {/if}
{#if data.response || isLoading}
Response {#if isLoading}
{/if}
{#if data.response}
{@html parsedResponse}
{:else if isLoading}
Generating response...
{/if}
{/if}
{ const curr = getNode(id); const newNodeId = crypto.randomUUID(); const currentDims = getNodeDimensions(id); const preferredPos = findAvailablePosition( (curr?.position.x ?? 100) + 50, (curr?.position.y ?? 0) + 50, currentDims.width, currentDims.height, ); const newNode: Node = { id: newNodeId, position: preferredPos, data: { query: data.query, response: data.response, modelId: data.modelId, provider: data.provider, }, type: "chat", width: undefined, height: undefined, }; nodes.current.push(newNode); // Copy only incoming edges (parent connections) const incomingEdges = edges.current.filter(edge => edge.target === id); for (const edge of incomingEdges) { const newEdge: Edge = { id: crypto.randomUUID(), source: edge.source, target: newNodeId, animated: edge.animated, label: edge.label, data: edge.data, }; edges.current.push(newEdge); } }} >
Duplicate
{ const curr = getNode(id); const currentDims = getNodeDimensions(id); const preferredPos = findAvailablePosition( curr?.position.x ?? 100, (curr?.position.y ?? 0) + size.height + 40, currentDims.width, currentDims.height, true, // constrainBelow = true for Add Node ); const newNode: Node = { id: crypto.randomUUID(), position: preferredPos, data: { query: "", response: "", modelId: data.modelId, provider: data.provider }, type: "chat", width: undefined, height: undefined, }; nodes.current.push(newNode); const edge: Edge = { id: crypto.randomUUID(), source: curr!.id, target: newNode.id, animated: true, label: "", data: {}, }; edges.current.push(edge); }} >
Add Node
(nodes.current = nodes.current.filter(n => n.id !== id))} >