- Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathtest_jina_ai.py
32 lines (24 loc) · 737 Bytes
/
test_jina_ai.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
importjson
importos
importsys
fromdatetimeimportdatetime
fromunittest.mockimportAsyncMock
sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system path
frombase_rerank_unit_testsimportBaseLLMRerankTest
importlitellm
classTestJinaAI(BaseLLMRerankTest):
defget_custom_llm_provider(self) ->litellm.LlmProviders:
returnlitellm.LlmProviders.JINA_AI
defget_base_rerank_call_args(self) ->dict:
return {
"model": "jina_ai/jina-reranker-v2-base-multilingual",
}
deftest_jina_ai_embedding():
litellm.embedding(
model="jina_ai/jina-embeddings-v3",
input=["a"],
task="separation",
dimensions=1024,
)