| import sail_kernel |
| print("sail_kernel version:", sail_kernel.__version__) |
|
|
| |
| result = sail_kernel.clean_text("<b>Hello World</b>\n\n\n\nFoo") |
| print("clean_text:", repr(result)) |
|
|
| |
| batch = sail_kernel.clean_batch(["<p>First</p>", "<b>Second text</b>", "Normal text"]) |
| print("clean_batch:", batch) |
|
|
| |
| budget = sail_kernel.compute_budget("Define photosynthesis. [2 marks]") |
| print("budget (2 marks):", budget) |
| budget8 = sail_kernel.compute_budget("Explain with examples how TCP/IP works. (8 marks)") |
| print("budget (8 marks):", budget8) |
| budget_deep = sail_kernel.compute_budget("Analyze and compare the causes of WW1 and WW2 in detail step-by-step") |
| print("budget (deep Q):", budget_deep) |
|
|
| |
| score = sail_kernel.score_output("## Answer\n\n**Key point**: Use `cargo build`.\n\n- Item 1\n- Item 2", 500) |
| print("format-rich score:", score.format_score, "total:", score.total_score) |
|
|
| score_plain = sail_kernel.score_output("just plain text with no formatting at all", 100) |
| print("plain text score:", score_plain.format_score, "total:", score_plain.total_score) |
|
|
| |
| scores = sail_kernel.score_batch([ |
| "## Section\n\n**Bold**: some content\n\n- list item", |
| "plain text answer", |
| "## Deep Answer\n\n**Critical**: step by step analysis\n\n```python\ncode```" |
| ], target_tokens=300) |
| print("batch scores:", scores) |
|
|
| print("\nAll SAIL kernel tests PASSED!") |
|
|