Refactored app.py to enhance modularity, update command-line argument parsing, and introduce new agent configurations. Moved AppConfig and GraphExecutor out of app.py, adjusted default behaviors, and added new command-line options for improved flexibility.
Files Changed
code/app.py
Code Changes
1. Removed Local AppConfig Class
Deleted the AppConfig dataclass from app.py.
Imported AppConfig from fabric_agent_action.config.
- from dataclasses import dataclass
- from typing import Optional, TextIO
- from typing_extensions import Literal
+ from typing import TextIO
+ from fabric_agent_action.config import AppConfig
agent_group.add_argument(
"--agent-preamble-enabled",
action="store_true",
help="Enable preamble in output",
)
agent_group.add_argument(
"--agent-preamble",
type=str,
default="##### (🤖 AI Generated)",
help="Preamble added to the beginning of output (default: ##### (🤖 AI Generated)",
)
Included Defaults for Fabric Patterns and Max Turns
fabric_group.add_argument(
"--fabric-patterns-included",
type=str,
default="",
help="Comma separated list of fabric patterns to include in agent",
)
fabric_group.add_argument(
"--fabric-patterns-excluded",
type=str,
default="",
help="Comma separated list of fabric patterns to exclude in agent",
)
fabric_group.add_argument(
"--fabric-max-num-turns",
type=int,
default=10,
help="Maximum number of turns to LLM when running fabric patterns (default: 10)",
)
(🤖 AI Generated)
Summary
Refactored
app.py
to enhance modularity, update command-line argument parsing, and introduce new agent configurations. MovedAppConfig
andGraphExecutor
out ofapp.py
, adjusted default behaviors, and added new command-line options for improved flexibility.Files Changed
code/app.py
Code Changes
1. Removed Local
AppConfig
ClassAppConfig
dataclass fromapp.py
.AppConfig
fromfabric_agent_action.config
.2. Modified Argument Parsing
Made
--input-file
RequiredUpdated
--agent-type
Choices and DefaultsAdded New Agent Configuration Options
Included Defaults for Fabric Patterns and Max Turns
3. Refactored Execution Flow
Moved Execution Logic to
app
FunctionSimplified
main
Function4. Removed
GraphExecutor
ClassDeleted the
GraphExecutor
class fromapp.py
.Introduced
GraphExecutorFactory
fromfabric_agent_action.graphs
.Updated execution to use the factory:
Reason for Changes
AppConfig
andGraphExecutor
to their respective modules improves code organization and reusability.app
function makesapp.py
cleaner and the execution flow more understandable.Impact of Changes
Test Plan
--agent-type
options.--agent-preamble
.--fabric-max-num-turns
.AppConfig
andGraphExecutorFactory
.Additional Notes
fabric_agent_action.config
andfabric_agent_action.graphs
modules are correctly installed and accessible.Shortlist of Changes for Reviewers
AppConfig
and its import from the config module.GraphExecutor
and the use ofGraphExecutorFactory
maintains existing functionality.End of PR Description