From d5bd45cae968bb4624e6ec71b038fc3caa13bd96 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 00:32:24 +0000 Subject: [PATCH] Fix Agent Tool API key display Fixes the Agent Tool node to correctly display the LlamaCloud API key when configured in settings. --- src/components/nodes/AgentToolNode.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/nodes/AgentToolNode.tsx b/src/components/nodes/AgentToolNode.tsx index 6d0e02a..45e2e9b 100644 --- a/src/components/nodes/AgentToolNode.tsx +++ b/src/components/nodes/AgentToolNode.tsx @@ -28,8 +28,21 @@ const AgentToolNode = memo(({ data, selected }: AgentToolNodeProps) => { const [pipelines, setPipelines] = useState([]); const [loading, setLoading] = useState(false); - // Mock API key - in a real app this would come from settings/env - const apiKey = localStorage.getItem('llamacloud_api_key'); + // Get API key from settings + const getApiKey = () => { + try { + const savedSettings = localStorage.getItem('agent-builder-settings'); + if (savedSettings) { + const settings = JSON.parse(savedSettings); + return settings.llamaCloudApiKey || ''; + } + } catch (error) { + console.error('Error loading settings:', error); + } + return ''; + }; + + const apiKey = getApiKey(); const fetchLlamaCloudData = async () => { if (!apiKey || toolType !== 'llamacloud-index') return;