We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8ae3fc commit 6894f48Copy full SHA for 6894f48
tests/system/test_openai_encoder.py
@@ -24,11 +24,8 @@ def test_init_with_kwargs():
24
25
26
def encode_by_type(openai_encoder, encoding_function, test_input):
27
- if encoding_function == "encode_documents":
28
- return openai_encoder.encode_documents(test_input)
29
- elif encoding_function == "encode_queries":
30
- return openai_encoder.encode_queries(test_input)
31
- pytest.fail(f"Unknown encoding function: {encoding_function}")
+ func = getattr(openai_encoder, encoding_function)
+ return func(test_input)
32
33
34
@pytest.mark.parametrize(
0 commit comments