diff --git a/patchwork/steps/GitHubAgent/README.md b/patchwork/steps/GitHubAgent/README.md new file mode 100644 index 000000000..8e1d23413 --- /dev/null +++ b/patchwork/steps/GitHubAgent/README.md @@ -0,0 +1,48 @@ +# GitHubAgent Module Documentation + +## Overview + +The `GitHubAgent` module is part of a larger codebase named Patchwork, specifically located in the `patchwork/steps/GitHubAgent/` directory. This module contains tools and configuration for creating a GitHub-supported task runner using pre-trained models to assist in data extraction and task automation through GitHub's CLI. It leverages components like `AioLlmClient`, `AgenticStrategyV2`, and a `GitHubTool` for execution, configuration, and API interaction, respectively. + +## Files + +### 1. GitHubAgent.py + +This file defines the `GitHubAgent` class, which serves as a controller for initiating tasks on GitHub using the command-line interface. It incorporates agentic strategy with messaging models for instruction following and execution planning. + +#### **Inputs** + +- **base_path**: A string specifying the working directory path, defaults to the current working directory. +- **prompt_value**: A dictionary containing additional data for rendering task templates. +- **github_api_key**: A required string for authenticating GitHub API requests. +- **task**: Required task description, typically a string formatted with Mustache templating. +- **example_json**: JSON-formatted string with example output structure. +- Optionally, keys for major LLM API platforms (`openai`, `anthropic`, `google`) as annotations for client configuration. + +#### **Outputs** + +- **result**: Dictionary combining the execution result and usage metrics, such as token counts. + +#### **Usage** + +To use `GitHubAgent`, instantiate it with the necessary input parameters and invoke `run()`. It operates through LLM models to facilitate data retrieval tasks on GitHub without performing extraneous actions beyond the specified task. + +### 2. typed.py + +This file provides input and output type definitions for the `GitHubAgent` using TypedDict, enabling structured input validation and documentation. + +#### **Inputs** + +- **GitHubAgentInputs**: Extends required inputs, annotating key fields for configuration support and API key validation. + +#### **Outputs** + +- **GitHubAgentOutputs**: Includes `request_tokens` and `response_tokens` for reporting on API usage. + +### 3. \_\_init\_\_.py + +This file initializes the GitHubAgent module, currently empty but reserved for future package-level imports or configurations. + +## Conclusion + +The `GitHubAgent` module is ideally suited for developers needing to automate GitHub data fetching tasks. By configuring and deploying these classes, users can harness pre-trained LLMs to interact with GitHub’s architecture efficiently. This module embodies the intersection of LLM application within traditional command-line interfaces, augmenting software task automation.