Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion patchwork/steps/GitHubAgent/GitHubAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
AgenticStrategyV2,
)
from patchwork.common.tools.github_tool import GitHubTool
from patchwork.common.utils.utils import mustache_render
from patchwork.step import Step
from patchwork.steps.GitHubAgent.typed import GitHubAgentInputs, GitHubAgentOutputs

Expand All @@ -14,7 +15,8 @@ class GitHubAgent(Step, input_class=GitHubAgentInputs, output_class=GitHubAgentO
def __init__(self, inputs):
super().__init__(inputs)
base_path = inputs.get("base_path", str(Path.cwd()))
task = inputs["task"]
data = inputs.get("prompt_value", {})
task = mustache_render(inputs["task"], data)
self.agentic_strategy = AgenticStrategyV2(
model="claude-3-7-sonnet-latest",
llm_client=AioLlmClient.create_aio_client(inputs),
Expand Down
7 changes: 4 additions & 3 deletions patchwork/steps/GitHubAgent/typed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from patchwork.common.utils.step_typing import StepTypeConfig


class GitHubAgentInputs(TypedDict, total=False):
class __GitHubAgentRequiredInputs(TypedDict):
task: str

class GitHubAgentInputs(__GitHubAgentRequiredInputs, total=False):
base_path: str
prompt_value: Dict[str, Any]
system_prompt: str
user_prompt: str
max_llm_calls: Annotated[int, StepTypeConfig(is_config=True)]
openai_api_key: Annotated[
str, StepTypeConfig(is_config=True, or_op=["patched_api_key", "google_api_key", "anthropic_api_key"])
Expand Down