Prepare Python SDK public PyPI publication
This commit is contained in:
32
python/sdk/tests/test_smoke_model.py
Normal file
32
python/sdk/tests/test_smoke_model.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import runpy
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
SMOKE = runpy.run_path(ROOT / "scripts" / "smoke-python-runtime.py")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("prompt_name", "expected"),
|
||||
[
|
||||
("SNAPSHOT_DIRECT_CHILD_PROMPT", "DIRECT_CHILD_OK"),
|
||||
("SNAPSHOT_WORKFLOW_CHILD_PROMPT", "WORKFLOW_CHILD_OK"),
|
||||
],
|
||||
)
|
||||
def test_child_prompt_precedes_runtime_context(prompt_name: str, expected: str) -> None:
|
||||
chunks = SMOKE["completion_chunks"]({
|
||||
"messages": [
|
||||
{"role": "user", "content": SMOKE[prompt_name]},
|
||||
{"role": "user", "content": "Current runtime context"},
|
||||
],
|
||||
})
|
||||
|
||||
assert any(
|
||||
choice.get("delta", {}).get("content") == expected
|
||||
for chunk in chunks
|
||||
for choice in chunk.get("choices", [])
|
||||
)
|
||||
Reference in New Issue
Block a user