Skip to content

Commit a4678c7

Browse files
committed
add mustache render to gh-agent
1 parent dfc3386 commit a4678c7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

patchwork/steps/GitHubAgent/GitHubAgent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
AgenticStrategyV2,
77
)
88
from patchwork.common.tools.github_tool import GitHubTool
9+
from patchwork.common.utils.utils import mustache_render
910
from patchwork.step import Step
1011
from patchwork.steps.GitHubAgent.typed import GitHubAgentInputs, GitHubAgentOutputs
1112

@@ -14,7 +15,8 @@ class GitHubAgent(Step, input_class=GitHubAgentInputs, output_class=GitHubAgentO
1415
def __init__(self, inputs):
1516
super().__init__(inputs)
1617
base_path = inputs.get("base_path", str(Path.cwd()))
17-
task = inputs["task"]
18+
data = inputs.get("prompt_value", {})
19+
task = mustache_render(inputs["task"], data)
1820
self.agentic_strategy = AgenticStrategyV2(
1921
model="claude-3-7-sonnet-latest",
2022
llm_client=AioLlmClient.create_aio_client(inputs),

patchwork/steps/GitHubAgent/typed.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
class GitHubAgentInputs(TypedDict, total=False):
77
base_path: str
88
prompt_value: Dict[str, Any]
9-
system_prompt: str
10-
user_prompt: str
9+
task: str
1110
max_llm_calls: Annotated[int, StepTypeConfig(is_config=True)]
1211
openai_api_key: Annotated[
1312
str, StepTypeConfig(is_config=True, or_op=["patched_api_key", "google_api_key", "anthropic_api_key"])

0 commit comments

Comments
 (0)