docs: backfill env template and migration notes for M2
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user