Skip to content

Commit 803bc48

Browse files
committed
fix apikey missing issuse of video_generator
1 parent ddc61c5 commit 803bc48

File tree

1 file changed

+5
-5
lines changed
  • 02-use-cases/data_analysis_with_datalake

1 file changed

+5
-5
lines changed

02-use-cases/data_analysis_with_datalake/agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
from veadk import Agent, Runner # noqa: E402
1818
from veadk.auth.veauth.ark_veauth import get_ark_token # noqa: E402
1919
from veadk.memory.short_term_memory import ShortTermMemory # noqa: E402
20+
21+
# Check if MODEL_AGENT_API_KEY environment variable exists and is not empty
22+
if "MODEL_AGENT_API_KEY" not in os.environ or not os.environ["MODEL_AGENT_API_KEY"]:
23+
os.environ["MODEL_AGENT_API_KEY"] = get_ark_token()
24+
2025
from veadk.tools.builtin_tools.video_generate import video_generate # noqa: E402
2126
from agentkit.apps import AgentkitAgentServerApp # noqa: E402
2227

@@ -26,11 +31,6 @@
2631
from tools.lancedb_hybrid_execution import lancedb_hybrid_execution # noqa: E402
2732
from prompts import SYSTEM_PROMPT # noqa: E402
2833

29-
# Check if MODEL_AGENT_API_KEY environment variable exists and is not empty
30-
if "MODEL_AGENT_API_KEY" not in os.environ or not os.environ["MODEL_AGENT_API_KEY"]:
31-
os.environ["MODEL_AGENT_API_KEY"] = get_ark_token()
32-
# Optionally assign to a variable for easier use in the file
33-
MODEL_AGENT_API_KEY = os.environ["MODEL_AGENT_API_KEY"]
3434

3535
short_term_memory = ShortTermMemory(backend="local")
3636

0 commit comments

Comments
 (0)