Skip to content

Commit

Permalink
Regenerate cassette for embedding llmobs test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Kim committed Jul 30, 2024
1 parent 23da90d commit 78f08e0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/contrib/langchain/test_langchain_llmobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,14 @@ def _call_openai_llm(OpenAI):
@staticmethod
def _call_openai_embedding(OpenAIEmbeddings):
embedding = OpenAIEmbeddings()
with get_request_vcr(subdirectory_name="langchain_community").use_cassette("openai_embedding_query.yaml"):
embedding.embed_query("hello world")
with mock.patch("langchain_openai.embeddings.base.tiktoken.encoding_for_model") as mock_encoding_for_model:
mock_encoding = mock.MagicMock()
mock_encoding_for_model.return_value = mock_encoding
mock_encoding.encode.return_value = [0.0] * 1536
with get_request_vcr(subdirectory_name="langchain_community").use_cassette(
"openai_embedding_query_integration.yaml"
):
embedding.embed_query("hello world")

@staticmethod
def _call_anthropic_chat(Anthropic):
Expand Down

0 comments on commit 78f08e0

Please sign in to comment.