Back to prompt library
Implement Tactical Commander with GPT-5 Pro and Tool Use
Linked challenge: Battlefield AI Decision Support Agent
Prompt source
implementation5 lines1 sectionsNo variables1 code block
Implement the 'Tactical Commander' agent using the Claude Agents SDK. This agent should primarily use GPT-5 Pro for high-level strategic reasoning and planning. Define custom tools for this agent to interact with 'Featherless AI' (e.g., to request fast object detection from a drone feed) and 'Replicate' (e.g., to invoke a specialized weather prediction model). Show the Claude Agents SDK agent definition including tool invocation. ```python
import anthropic # Assuming an Anthropic client setup and GPT-5 Pro tool definition
# For demonstration, a simplified 'tool' interface def call_gpt5_pro(prompt: str) -> str: # Placeholder for actual GPT-5 Pro API call return f"GPT-5 Pro response to: {prompt[:50]}..." def get_object_detection_from_featherless(image_url: str) -> str: # Placeholder for Featherless AI integration return f"Featherless AI detected objects in {image_url}." def get_weather_prediction_from_replicate(coords: str) -> str: # Placeholder for Replicate integration return f"Replicate weather prediction for {coords}." # In Claude Agents SDK, tool definitions would be more formal
# This is a conceptual snippet for prompt guidance class TacticalCommanderAgent: def __init__(self, client: anthropic.Anthropic): self.client = client self.tools = { "plan_strategy": call_gpt5_pro, "detect_objects": get_object_detection_from_featherless, "predict_weather": get_weather_prediction_from_replicate, } async def process_threat(self, threat_data: str): # Logic for the agent to call tools and use Claude models pass # ... (actual Claude Agents SDK implementation would follow)
```