Projeto do Agent Contas ORACLE
This commit is contained in:
30
tests/migration/test_framework_llm_composition_directive.py
Normal file
30
tests/migration/test_framework_llm_composition_directive.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from agent_framework.runtime.agent_runtime import AgentRuntimeMixin
|
||||
|
||||
|
||||
def test_framework_detecta_instrucao_de_composicao_llm_recursiva():
|
||||
results=[{"ok":True,"result":{"output":{"orientar":{"requires_llm_composition":True,"response_instruction":"Explique a devolução."}}}}]
|
||||
required, instructions = AgentRuntimeMixin._mcp_llm_composition_directive(results)
|
||||
assert required is True
|
||||
assert instructions == ["Explique a devolução."]
|
||||
|
||||
|
||||
def test_direct_answer_eh_desabilitada_quando_tool_exige_composicao_llm():
|
||||
runtime=AgentRuntimeMixin()
|
||||
results=[{"ok":True,"tool_name":"pro_rata","result":{"requires_llm_composition":True,"response_instruction":"Explique."}}]
|
||||
assert runtime.build_direct_mcp_answer({"user_text":"explique"}, results, agent_label="Contas") is None
|
||||
|
||||
|
||||
def test_pro_rata_orientacao_declara_composicao_no_llm_do_framework():
|
||||
from app.domain.contas.workflow_actions import build_contas_workflow_actions
|
||||
|
||||
class Service: pass
|
||||
reg=build_contas_workflow_actions(Service()) # type: ignore[arg-type]
|
||||
result=reg.get("orientar_pagamento_pro_rata")(
|
||||
{"devolucao":{"format_text":"conta_futura","items":[{"itemName":"Plano","validatedAmount":3.06}]}},
|
||||
{"input":{}},
|
||||
)
|
||||
assert result["requires_llm_composition"] is True
|
||||
assert result["devolucao"]["format_text"] == "conta_futura"
|
||||
assert "devolução" in result["response_instruction"]
|
||||
Reference in New Issue
Block a user