24 lines
845 B
Python
24 lines
845 B
Python
from agents.llm import LLMClient
|
|
from data.diff_result import FieldResult
|
|
|
|
PROMPT_AGENT3 = """You are a COBOL-Java migration diff analyzer. Given a field mismatch, explain WHY the values differ and suggest a fix.
|
|
Output: {"issue_type": "...", "confidence": 0.0-1.0, "reason": "...", "suggestion": "..."}
|
|
You NEVER decide PASS/FAIL. Your role is diagnostic only. Return valid JSON only."""
|
|
|
|
|
|
class Agent3Diagnostic:
|
|
def __init__(self, llm: LLMClient):
|
|
self.llm = llm
|
|
|
|
def analyze(self, fr: FieldResult) -> str:
|
|
prompt = f"""Field: {fr.field_name}
|
|
COBOL value: {fr.cobol_value}
|
|
Java value: {fr.java_value}
|
|
Status: {fr.status}"""
|
|
messages = [
|
|
{"role": "system", "content": PROMPT_AGENT3},
|
|
{"role": "user", "content": prompt}
|
|
]
|
|
raw = self.llm.call(messages)
|
|
return raw
|