from dotenv import load_dotenv from modaic import PrecompiledAgent, PrecompiledConfig import weaviate load_dotenv() class EchoConfig(PrecompiledConfig): lm: str = "gpt-4o" class EchoAgent(PrecompiledAgent): config: EchoConfig def __init__(self, config: EchoConfig, **kwargs): super().__init__(config, **kwargs) def forward(self, text: str) -> str: return f"Echo: {text}" if __name__ == "__main__": agent = EchoAgent(EchoConfig()) print(agent(text="hello")) agent.push_to_hub( "connor/CrossEncoderRanker", with_code=True, commit_message="Fix init to accept kwargs" )