| """Isolated test — just claim_client.attribute() against the live clAIm endpoint. |
| Uses the exact winner sentence/label confirmed by test_analyze_live.py. |
| |
| Run from the veriscite/ root: |
| python -m tests.test_attribute_live |
| """ |
|
|
| import asyncio |
| from app.tools import claim_client |
|
|
|
|
| async def main(): |
| claim = "Aspirin inhibits the production of thromboxane A2." |
| winner_sentence = ("Aspirin irreversibly inhibits cyclooxygenase, thereby " |
| "reducing thromboxane A2 synthesis in platelets.") |
| label_id = claim_client.LABEL2ID["SUPPORT"] |
|
|
| result = await claim_client.attribute(claim, winner_sentence, label_id) |
|
|
| print("RAW RESPONSE (list of {token, score}):") |
| for item in result: |
| print(item) |
|
|
| print() |
| print("token count:", len(result)) |
|
|
|
|
| if __name__ == "__main__": |
| asyncio.run(main()) |
|
|