remove parameter in textprompt block (#3079)
This commit is contained in:
@@ -1,19 +1,9 @@
|
|||||||
import { HelpTooltip } from "@/components/HelpTooltip";
|
import { HelpTooltip } from "@/components/HelpTooltip";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
import {
|
import { Handle, NodeProps, Position, useReactFlow } from "@xyflow/react";
|
||||||
Handle,
|
|
||||||
NodeProps,
|
|
||||||
Position,
|
|
||||||
useEdges,
|
|
||||||
useNodes,
|
|
||||||
useReactFlow,
|
|
||||||
} from "@xyflow/react";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { AppNode } from "..";
|
|
||||||
import { helpTooltips } from "../../helpContent";
|
import { helpTooltips } from "../../helpContent";
|
||||||
import { getAvailableOutputParameterKeys } from "../../workflowEditorUtils";
|
|
||||||
import { ParametersMultiSelect } from "../TaskNode/ParametersMultiSelect";
|
|
||||||
import { type TextPromptNode } from "./types";
|
import { type TextPromptNode } from "./types";
|
||||||
import { WorkflowBlockInputTextarea } from "@/components/WorkflowBlockInputTextarea";
|
import { WorkflowBlockInputTextarea } from "@/components/WorkflowBlockInputTextarea";
|
||||||
import { WorkflowDataSchemaInputGroup } from "@/components/DataSchemaInputGroup/WorkflowDataSchemaInputGroup";
|
import { WorkflowDataSchemaInputGroup } from "@/components/DataSchemaInputGroup/WorkflowDataSchemaInputGroup";
|
||||||
@@ -39,10 +29,6 @@ function TextPromptNode({ id, data }: NodeProps<TextPromptNode>) {
|
|||||||
model: data.model,
|
model: data.model,
|
||||||
});
|
});
|
||||||
|
|
||||||
const nodes = useNodes<AppNode>();
|
|
||||||
const edges = useEdges();
|
|
||||||
const outputParameterKeys = getAvailableOutputParameterKeys(nodes, edges, id);
|
|
||||||
|
|
||||||
function handleChange(key: string, value: unknown) {
|
function handleChange(key: string, value: unknown) {
|
||||||
if (!editable) {
|
if (!editable) {
|
||||||
return;
|
return;
|
||||||
@@ -108,15 +94,6 @@ function TextPromptNode({ id, data }: NodeProps<TextPromptNode>) {
|
|||||||
className="nopan text-xs"
|
className="nopan text-xs"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
|
||||||
<ParametersMultiSelect
|
|
||||||
availableOutputParameters={outputParameterKeys}
|
|
||||||
parameters={data.parameterKeys}
|
|
||||||
onParametersChange={(parameterKeys) => {
|
|
||||||
updateNodeData(id, { parameterKeys });
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<Separator />
|
<Separator />
|
||||||
<ModelSelector
|
<ModelSelector
|
||||||
className="nopan w-52 text-xs"
|
className="nopan w-52 text-xs"
|
||||||
|
|||||||
Reference in New Issue
Block a user