langchain/libs/partners/openai/tests/integration_tests
ccurme 56499cf58b
openai[patch]: unskip test and relax tolerance in embeddings comparison (#28262)
From what I can tell response using SDK is not deterministic:
```python
import numpy as np
import openai

documents = ["disallowed special token '<|endoftext|>'"]
model = "text-embedding-ada-002"

direct_output_1 = (
    openai.OpenAI()
    .embeddings.create(input=documents, model=model)
    .data[0]
    .embedding
)

for i in range(10):
    direct_output_2 = (
        openai.OpenAI()
        .embeddings.create(input=documents, model=model)
        .data[0]
        .embedding
    )
    print(f"{i}: {np.isclose(direct_output_1, direct_output_2).all()}")
```
```
0: True
1: True
2: True
3: True
4: False
5: True
6: True
7: True
8: True
9: True
```

See related discussion here:
https://community.openai.com/t/can-text-embedding-ada-002-be-made-deterministic/318054

Found the same result using `"text-embedding-3-small"`.
2024-11-21 10:23:10 -08:00
..
chat_models standard-tests: rename langchain_standard_tests to langchain_tests, release 0.3.2 (#28203) 2024-11-18 19:10:39 -08:00
embeddings openai[patch]: unskip test and relax tolerance in embeddings comparison (#28262) 2024-11-21 10:23:10 -08:00
llms infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
__init__.py openai[minor]: implement langchain-openai package (#15503) 2024-01-05 15:03:28 -08:00
test_compile.py openai[minor]: implement langchain-openai package (#15503) 2024-01-05 15:03:28 -08:00