Skip to content

Commit 0bf79b5

Browse files
committed
Update generate_answer_from_image_node.py
1 parent 79fa3f6 commit 0bf79b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scrapegraphai/nodes/generate_answer_from_image_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ def execute(self, state: dict) -> dict:
3232
images = state.get('screenshots', [])
3333
analyses = []
3434

35-
api_key = self.node_config.get("config", {}).get("llm", {}).get("api_key", "")
36-
3735
supported_models = ("gpt-4o", "gpt-4o-mini", "gpt-4-turbo")
3836

3937
if self.node_config["config"]["llm"]["model"] not in supported_models:
@@ -42,6 +40,8 @@ def execute(self, state: dict) -> dict:
4240
{', '.join(supported_models)}.""")
4341

4442
if self.node_config["config"]["llm"]["model"].startswith("gpt"):
43+
api_key = self.node_config.get("config", {}).get("llm", {}).get("api_key", "")
44+
4545
for image_data in images:
4646
base64_image = base64.b64encode(image_data).decode('utf-8')
4747

0 commit comments

Comments
 (0)