From 2ade83cd57d100015e1298ae20ad4a4c1d286ccf Mon Sep 17 00:00:00 2001 From: Connor Shorten Date: Wed, 26 Nov 2025 19:21:22 -0500 Subject: [PATCH] My first commit --- README.md | 1 - agent.json | 2 +- auto_classes.json | 4 ++++ hello.py | 25 +++++++++++++++++++++++++ pyproject.toml | 7 +++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 auto_classes.json create mode 100644 hello.py create mode 100644 pyproject.toml diff --git a/README.md b/README.md index fd815f3..e69de29 100644 --- a/README.md +++ b/README.md @@ -1 +0,0 @@ -# Testing Push to Modaic Hub \ No newline at end of file diff --git a/agent.json b/agent.json index bb0bb70..23da2b4 100644 --- a/agent.json +++ b/agent.json @@ -6,4 +6,4 @@ "cloudpickle": "3.1" } } -} +} \ No newline at end of file diff --git a/auto_classes.json b/auto_classes.json new file mode 100644 index 0000000..6685e21 --- /dev/null +++ b/auto_classes.json @@ -0,0 +1,4 @@ +{ + "AutoConfig": "hello.EchoConfig", + "AutoAgent": "hello.EchoAgent" +} \ No newline at end of file diff --git a/hello.py b/hello.py new file mode 100644 index 0000000..fa6cf8b --- /dev/null +++ b/hello.py @@ -0,0 +1,25 @@ +from modaic import PrecompiledAgent, PrecompiledConfig + +from dotenv import load_dotenv + +load_dotenv() + +class EchoConfig(PrecompiledConfig): + lm: str = "gpt-4o" + +class EchoAgent(PrecompiledAgent): + config: EchoConfig # ! Important: config must be annotated with the config class + + def __init__(self, config: EchoConfig): + super().__init__(config) + + def forward(self, text: str) -> str: + return f"Echo: {text}" + +agent = EchoAgent(EchoConfig()) +print(agent(text="hello")) +agent.push_to_hub( + "connor/CrossEncoderRanker", + with_code=True, + commit_message="My first commit" +) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a7d5bba --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "CrossEncoderRanker" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.11" +dependencies = ["modaic>=0.4.1", "weaviate-client>=4.18.1"]