fix: repair embedding rerank CI checks

This commit is contained in:
Kayphoon
2026-05-04 11:33:00 +08:00
parent 5abe664d65
commit 6bdd7792eb
2 changed files with 5 additions and 8 deletions

View File

@@ -4337,12 +4337,7 @@ fn rerank_request_from_raw(body_json: &Value, namespace: &str) -> Option<Canonic
.map(str::trim)
.filter(|value| !value.is_empty())?
.to_string();
let documents = request
.get("documents")
.and_then(Value::as_array)?
.iter()
.cloned()
.collect::<Vec<_>>();
let documents = request.get("documents").and_then(Value::as_array)?.to_vec();
let rerank = CanonicalRerankRequest {
query,
documents,

View File

@@ -676,12 +676,13 @@ mod tests {
Some("ai_public"),
Some("openai"),
Some("embedding"),
None,
&Method::POST,
"/v1/embeddings",
),
Some(OPENAI_EMBEDDING_SYNC_PLAN_KIND)
);
assert!(supports_sync_scheduler_decision_kind(
assert!(supports_sync_execution_decision_kind(
OPENAI_EMBEDDING_SYNC_PLAN_KIND
));
}
@@ -693,12 +694,13 @@ mod tests {
Some("ai_public"),
Some("openai"),
Some("rerank"),
None,
&Method::POST,
"/v1/rerank",
),
Some(OPENAI_RERANK_SYNC_PLAN_KIND)
);
assert!(supports_sync_scheduler_decision_kind(
assert!(supports_sync_execution_decision_kind(
OPENAI_RERANK_SYNC_PLAN_KIND
));
}