|
#!/usr/bin/env python3 |
|
"""Multi-assistant ACPS integration example.""" |
|
|
|
import asyncio |
|
from enum import Enum |
|
|
|
class AIAssistant(Enum): |
|
CLAUDE = "claude" |
|
COPILOT = "copilot" |
|
WINDSURF = "windsurf" |
|
|
|
class MultiAssistantACPS: |
|
"""Manage context across multiple AI assistants.""" |
|
|
|
async def get_optimal_assistant(self, task_type: str) -> AIAssistant: |
|
"""Choose the best assistant for the task.""" |
|
task_mapping = { |
|
"coding": AIAssistant.COPILOT, |
|
"explanation": AIAssistant.CLAUDE, |
|
"project_analysis": AIAssistant.WINDSURF |
|
} |
|
|
|
return task_mapping.get(task_type, AIAssistant.CLAUDE) |
|
|
|
async def process_with_context(self, query: str, task_type: str): |
|
"""Process query with optimal assistant and context.""" |
|
assistant = await self.get_optimal_assistant(task_type) |
|
|
|
print(f"Using {assistant.value} for {task_type}: {query}") |
|
|
|
# Load assistant-specific context |
|
context = await self.load_assistant_context(assistant, query) |
|
|
|
return { |
|
"assistant": assistant.value, |
|
"context": context, |
|
"query": query |
|
} |
|
|
|
async def load_assistant_context(self, assistant: AIAssistant, query: str): |
|
"""Load context specific to the assistant.""" |
|
base_context = {"query": query} |
|
|
|
if assistant == AIAssistant.CLAUDE: |
|
base_context.update({ |
|
"style": "detailed_explanation", |
|
"include_examples": True |
|
}) |
|
elif assistant == AIAssistant.COPILOT: |
|
base_context.update({ |
|
"style": "code_focused", |
|
"include_patterns": True |
|
}) |
|
elif assistant == AIAssistant.WINDSURF: |
|
base_context.update({ |
|
"style": "project_aware", |
|
"multi_file_context": True |
|
}) |
|
|
|
return base_context |
|
|
|
async def main(): |
|
"""Demo multi-assistant usage.""" |
|
acps = MultiAssistantACPS() |
|
|
|
tasks = [ |
|
("Write a Python function", "coding"), |
|
("Explain async/await", "explanation"), |
|
("Analyze project structure", "project_analysis") |
|
] |
|
|
|
for query, task_type in tasks: |
|
result = await acps.process_with_context(query, task_type) |
|
print(f"Result: {result}\n") |
|
|
|
if __name__ == "__main__": |
|
asyncio.run(main()) |