Skip to content

Commit d96b234

Browse files
authored
Merge pull request #1391 from patched-codes/gh-agent-render
Add mustache render to GitHubAgent
2 parents 2a19579 + ccb5532 commit d96b234

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
from patchwork.common.utils.step_typing import StepTypeConfig
44

55

6-
class GitHubAgentInputs(TypedDict, total=False):
6+
class __GitHubAgentRequiredInputs(TypedDict):
7+
task: str
8+
9+
class GitHubAgentInputs(__GitHubAgentRequiredInputs, total=False):
710
base_path: str
811
prompt_value: Dict[str, Any]
9-
system_prompt: str
10-
user_prompt: str
1112
max_llm_calls: Annotated[int, StepTypeConfig(is_config=True)]
1213
openai_api_key: Annotated[
1314
str, StepTypeConfig(is_config=True, or_op=["patched_api_key", "google_api_key", "anthropic_api_key"])

0 commit comments

Comments
 (0)