From 9cb6365914d11ca33909d1d3c5f56565c91fc16b Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 9 Jul 2025 04:58:04 +1000 Subject: [PATCH] docs: update file paths to make the examples more robust (#5382) * cli: update file paths to make the examples more robust * fix: fix the prompt path --- libs/cli/examples/graphs_reqs_a/graphs_submod/agent.py | 2 +- libs/cli/examples/graphs_reqs_b/graphs_submod/agent.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/cli/examples/graphs_reqs_a/graphs_submod/agent.py b/libs/cli/examples/graphs_reqs_a/graphs_submod/agent.py index 5ab615871..1073110cb 100644 --- a/libs/cli/examples/graphs_reqs_a/graphs_submod/agent.py +++ b/libs/cli/examples/graphs_reqs_a/graphs_submod/agent.py @@ -17,7 +17,7 @@ model_oai = ChatOpenAI(temperature=0) model_anth = model_anth.bind_tools(tools) model_oai = model_oai.bind_tools(tools) -prompt = open("prompt.txt").read() +prompt = open(Path(__file__).parent.parent / "prompt.txt").read() subprompt = open(Path(__file__).parent / "subprompt.txt").read() diff --git a/libs/cli/examples/graphs_reqs_b/graphs_submod/agent.py b/libs/cli/examples/graphs_reqs_b/graphs_submod/agent.py index 5ab615871..1073110cb 100644 --- a/libs/cli/examples/graphs_reqs_b/graphs_submod/agent.py +++ b/libs/cli/examples/graphs_reqs_b/graphs_submod/agent.py @@ -17,7 +17,7 @@ model_oai = ChatOpenAI(temperature=0) model_anth = model_anth.bind_tools(tools) model_oai = model_oai.bind_tools(tools) -prompt = open("prompt.txt").read() +prompt = open(Path(__file__).parent.parent / "prompt.txt").read() subprompt = open(Path(__file__).parent / "subprompt.txt").read()