| from smolagents import CodeAgent, DuckDuckGoSearchTool, tool |
| |
| from smolagents.models import TransformersModel |
| import gradio as gr |
|
|
| @tool |
| def check_migration_blockers(inventory_data: str) -> str: |
| """ |
| Analyzes server inventory data for common Azure VMware Solution (AVS) blockers. |
| Args: |
| inventory_data: A string description of the server hardware or a snippet from an RVTools export. |
| """ |
| data = inventory_data.lower() |
| if "rdm" in data: |
| return "⚠️ BLOCKER: Physical RDM identified. Suggest Pure Cloud Block Store (Everpure)." |
| if "iscsi" in data: |
| return "⚠️ ALERT: Guest iSCSI detected. Check network pathing." |
| return "✅ No immediate architectural blockers identified for standard AVS migration." |
|
|
| |
| model = TransformersModel(model_id="Qwen/Qwen2-1.5B-Instruct") |
|
|
| agent = CodeAgent( |
| tools=[check_migration_blockers, DuckDuckGoSearchTool()], |
| model=model, |
| add_base_tools=True |
| ) |
|
|
| def respond(message, history): |
| |
| return agent.run(message) |
|
|
| |
| gr.ChatInterface(respond).launch() |