Skip to content

Commit 75c540b

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent c52bbbf commit 75c540b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

examples/cookbook/google-adk/moss_adk.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ async def ask(runner: Runner, session_id: str, question: str) -> str:
120120

121121

122122
async def main() -> None:
123-
client = MossClient(os.getenv("MOSS_PROJECT_ID"), os.getenv("MOSS_PROJECT_KEY"))
124-
await ensure_demo_index(client, INDEX_NAME)
123+
load_dotenv()
124+
project_id = os.getenv("MOSS_PROJECT_ID")
125+
project_key = os.getenv("MOSS_PROJECT_KEY")
126+
if not project_id or not project_key:
127+
raise RuntimeError("Missing MOSS_PROJECT_ID or MOSS_PROJECT_KEY environment variables.")
128+
client = MossClient(project_id, project_key)
125129

126130
search = create_moss_search_tool(client, INDEX_NAME)
127131

0 commit comments

Comments
 (0)