diff --git a/src/components/FlowComponents/apiKey.jsx b/src/components/FlowComponents/apiKey.jsx index f4338bf..b37dc53 100644 --- a/src/components/FlowComponents/apiKey.jsx +++ b/src/components/FlowComponents/apiKey.jsx @@ -68,6 +68,15 @@ function ApiKeyNode({ id }) { const onChange = (e) => { setApiKey(e.target.value); + if (e.target.value.length === 0) { + store((state) => { + state.openAIInstance = null; + }); + } + + if (e.target.value.length > 0) { + createOpenAIInstance(); + } }; useEffect(() => {