for assorted things

update name

+49 -38
-38
turn-off-all-the-lights
··· 1 - #!/usr/bin/env -S uv run --script --quiet 2 - # /// script 3 - # requires-python = ">=3.12" 4 - # dependencies = ["marvin@git+https://github.com/prefecthq/marvin.git"] 5 - # /// 6 - import marvin 7 - from pydantic_settings import BaseSettings, SettingsConfigDict 8 - from pydantic import Field 9 - from pydantic_ai.mcp import MCPServerStdio 10 - 11 - 12 - class Settings(BaseSettings): 13 - model_config = SettingsConfigDict(env_file=".env") 14 - 15 - hue_bridge_ip: str = Field(default=...) 16 - hue_bridge_username: str = Field(default=...) 17 - 18 - 19 - settings = Settings() 20 - 21 - hub_mcp = MCPServerStdio( 22 - command="uvx", 23 - args=[ 24 - "smart-home@git+https://github.com/jlowin/fastmcp.git#subdirectory=examples/smart_home" 25 - ], 26 - env={ 27 - "HUE_BRIDGE_IP": settings.hue_bridge_ip, 28 - "HUE_BRIDGE_USERNAME": settings.hue_bridge_username, 29 - }, 30 - ) 31 - 32 - 33 - if __name__ == "__main__": 34 - agent = marvin.Agent( 35 - model="gpt-4o", 36 - mcp_servers=[hub_mcp], 37 - ) 38 - agent.run("turn off all the lights")
+49
update-lights
··· 1 + #!/usr/bin/env -S uv run --script --quiet 2 + # /// script 3 + # requires-python = ">=3.12" 4 + # dependencies = ["marvin@git+https://github.com/prefecthq/marvin.git"] 5 + # /// 6 + import marvin 7 + import argparse 8 + from pydantic_settings import BaseSettings, SettingsConfigDict 9 + from pydantic import Field 10 + from pydantic_ai.mcp import MCPServerStdio 11 + 12 + 13 + class Settings(BaseSettings): 14 + model_config = SettingsConfigDict(env_file=".env", extra="ignore") 15 + 16 + hue_bridge_ip: str = Field(default=...) 17 + hue_bridge_username: str = Field(default=...) 18 + 19 + 20 + settings = Settings() 21 + 22 + hub_mcp = MCPServerStdio( 23 + command="uvx", 24 + args=[ 25 + "smart-home@git+https://github.com/jlowin/fastmcp.git#subdirectory=examples/smart_home" 26 + ], 27 + env={ 28 + "HUE_BRIDGE_IP": settings.hue_bridge_ip, 29 + "HUE_BRIDGE_USERNAME": settings.hue_bridge_username, 30 + }, 31 + ) 32 + 33 + 34 + if __name__ == "__main__": 35 + parser = argparse.ArgumentParser(description="Send a command to the Marvin agent.") 36 + parser.add_argument( 37 + "--message", 38 + "-m", 39 + type=str, 40 + default="turn off all the lights", 41 + help="The message to send to the agent (defaults to 'turn off all the lights').", 42 + ) 43 + args = parser.parse_args() 44 + 45 + agent = marvin.Agent( 46 + model="gpt-4o", 47 + mcp_servers=[hub_mcp], 48 + ) 49 + agent.run(args.message)