Skip to content

Commit a740311

Browse files
committed
Fix types and keys on GithubAgent
1 parent 584a853 commit a740311

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

patchwork/steps/GitHubAgent/GitHubAgent.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, inputs):
2121
model="claude-3-5-sonnet-latest",
2222
llm_client=AioLlmClient.create_aio_client(inputs),
2323
template_data=dict(),
24-
system_prompt_template=f"""\
24+
system_prompt_template="""\
2525
Please summarise the conversation given and provide the result in the structure that is asked of you.
2626
""",
2727
user_prompt_template=f"""\
@@ -34,15 +34,17 @@ def __init__(self, inputs):
3434
AgentConfig(
3535
name="Assistant",
3636
model="gemini-2.0-flash",
37-
tool_set=dict(github_tool=GitHubTool(base_path, inputs["github_api_token"])),
37+
tool_set=dict(github_tool=GitHubTool(base_path, inputs["github_api_key"])),
3838
system_prompt="""\
39-
You are a senior software developer helping the program manager to obtain some data from GitHub.
40-
You can access github through the `gh` CLI app.
39+
You are a senior software developer helping the program manager to obtain some data from GitHub.
40+
You can access github through the `gh` CLI app.
4141
Your `gh` app has already been authenticated.
4242
""",
4343
)
4444
],
45-
example_json=inputs.get("example_json"),
45+
example_json=inputs.get(
46+
"example_json", '{"summary_of_actions": "1. Retrieved the list of repositories. 2. ..."}'
47+
),
4648
)
4749

4850
def run(self) -> dict:

patchwork/steps/GitHubAgent/typed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing_extensions import Annotated, Any, Dict, TypedDict
1+
from typing_extensions import Annotated, Any, Dict, Optional, TypedDict
22

33
from patchwork.common.utils.step_typing import StepTypeConfig
44

@@ -11,6 +11,8 @@ class GitHubAgentInputs(__GitHubAgentRequiredInputs, total=False):
1111
base_path: str
1212
prompt_value: Dict[str, Any]
1313
max_llm_calls: Annotated[int, StepTypeConfig(is_config=True)]
14+
github_api_key: str
15+
example_json: Optional[Dict]
1416
openai_api_key: Annotated[
1517
str,
1618
StepTypeConfig(

0 commit comments

Comments
 (0)