docs: backfill env template and migration notes for M2

This commit is contained in:
2026-07-21 01:28:33 -04:00
parent 9aa97a61ae
commit 724dc3c328
10 changed files with 59 additions and 30 deletions
+2 -6
View File
@@ -94,14 +94,10 @@ class TestEmbedTransport:
assert payload == {"model": "embed-1", "input": ["a", "b"]}
return httpx.Response(
200,
json=_ok_body(
[[1.0, 0.0], [0.0, 1.0]], usage={"prompt_tokens": 5}, shuffle=True
),
json=_ok_body([[1.0, 0.0], [0.0, 1.0]], usage={"prompt_tokens": 5}, shuffle=True),
)
result = await _transport_with(handler).embed(
texts=["a", "b"], source=_src(), call_id="c"
)
result = await _transport_with(handler).embed(texts=["a", "b"], source=_src(), call_id="c")
assert result.vectors == [[1.0, 0.0], [0.0, 1.0]] # 乱序响应按 index 重排
assert result.dim == 2
assert result.prompt_tokens == 5 and result.usage_source == "measured"