From 9b0337d1b8cfb9238b000412ae80ddb759f58399 Mon Sep 17 00:00:00 2001 From: Farouk Adeleke Date: Thu, 4 Dec 2025 15:28:21 -0500 Subject: [PATCH] With code --- README.md | 2 -- auto_classes.json | 4 ++++ config.json | 3 +++ main.py | 9 +++++++++ program.json | 9 +++++++++ pyproject.toml | 7 +++++++ src/agent.py | 19 +++++++++++++++++++ 7 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 auto_classes.json create mode 100644 config.json create mode 100644 main.py create mode 100644 program.json create mode 100644 pyproject.toml create mode 100644 src/agent.py diff --git a/README.md b/README.md index 521c11e..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,2 +0,0 @@ -# claude-code - diff --git a/auto_classes.json b/auto_classes.json new file mode 100644 index 0000000..e872032 --- /dev/null +++ b/auto_classes.json @@ -0,0 +1,4 @@ +{ + "AutoConfig": "src.agent.ClaudeCodeConfig", + "AutoProgram": "src.agent.ClaudeCodeAgent" +} \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..e52eb33 --- /dev/null +++ b/config.json @@ -0,0 +1,3 @@ +{ + "model": "claude-3-5-sonnet-20241022" +} \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..5c9e39d --- /dev/null +++ b/main.py @@ -0,0 +1,9 @@ +from src.agent import ClaudeCodeConfig, ClaudeCodeAgent + +config = ClaudeCodeConfig() +agent = ClaudeCodeAgent(config) + +if __name__ == "__main__": + result = agent("Implement a todo list application") + agent.push_to_hub("farouk1/claude-code", with_code=True, commit_message="With code") + print(result) diff --git a/program.json b/program.json new file mode 100644 index 0000000..ac56cba --- /dev/null +++ b/program.json @@ -0,0 +1,9 @@ +{ + "metadata": { + "dependency_versions": { + "python": "3.13", + "dspy": "3.0.4", + "cloudpickle": "3.1" + } + } +} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d666d8c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "claude-code" +version = "0.1.0" +description = "Claude Code SDK wrapped in a DSPy module" +readme = "README.md" +requires-python = ">=3.13" +dependencies = ["claude-agent-sdk>=0.1.12", "dspy>=3.0.4", "modaic>=0.7.0"] diff --git a/src/agent.py b/src/agent.py new file mode 100644 index 0000000..23f8e53 --- /dev/null +++ b/src/agent.py @@ -0,0 +1,19 @@ +from modaic import PrecompiledProgram, PrecompiledConfig +from dspy.primitives.prediction import Prediction + +class ClaudeCodeConfig(PrecompiledConfig): + model: str = "claude-3-5-sonnet-20241022" + +class ClaudeCodeAgent(PrecompiledProgram): + config: ClaudeCodeConfig + + def __init__(self, config: ClaudeCodeConfig): + super().__init__(config=config) + self.model = config.model + + def forward(self, task: str) -> Prediction: + # TODO: Implement the actual agent logic using self.model + # This is a placeholder - actual implementation would use the model to process the task + return Prediction(output=f"Processed task: {task} using model {self.model}") + +