refactor(llm): elevate prompt engineering with context grounding and contrastive taxonomy
This commit is contained in:
@@ -69,7 +69,7 @@ def test_llm_adapter_build_prompt_structure():
|
||||
)
|
||||
|
||||
prompt = adapter.build_prompt(ecp, "# Título do Artigo\n\nConteúdo sobre o jogo.", initial_res)
|
||||
assert "Target Entity: River Plate" in prompt
|
||||
assert "River Plate" in prompt
|
||||
assert "Futebol" in prompt
|
||||
assert "TANGENTIAL" in prompt
|
||||
assert "Título do Artigo" in prompt
|
||||
@@ -148,9 +148,11 @@ def test_llm_adapter_parsing_json_wrapped_in_markdown_codeblock():
|
||||
|
||||
def test_llm_adapter_handling_invalid_and_corrupt_responses():
|
||||
"""Valida que respostas corrompidas ou JSONs sem campos obrigatórios retornem None com segurança."""
|
||||
|
||||
def make_bad_provider(resp_str: str):
|
||||
def _prov(prompt: str) -> str:
|
||||
return resp_str
|
||||
|
||||
return _prov
|
||||
|
||||
for bad_response in [
|
||||
|
||||
Reference in New Issue
Block a user