Update Optional[x] -> x | None and Union[x, y] to x | y (#26633)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -8,8 +8,6 @@ Note that `pip install cohere` is needed to run this example.
|
||||
run: vllm serve BAAI/bge-reranker-base
|
||||
"""
|
||||
|
||||
from typing import Union
|
||||
|
||||
import cohere
|
||||
from cohere import Client, ClientV2
|
||||
|
||||
@@ -25,7 +23,7 @@ documents = [
|
||||
|
||||
|
||||
def cohere_rerank(
|
||||
client: Union[Client, ClientV2], model: str, query: str, documents: list[str]
|
||||
client: Client | ClientV2, model: str, query: str, documents: list[str]
|
||||
) -> dict:
|
||||
return client.rerank(model=model, query=query, documents=documents)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user