Skip to content

Commit

Permalink
add vcr
Browse files Browse the repository at this point in the history
  • Loading branch information
Saisakul Chernbumroong authored and Saisakul Chernbumroong committed Nov 15, 2024
1 parent 41ab927 commit 6c16776
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions redbox-core/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion redbox-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ env_files = [
".env"
]
markers = [
"ai: marks tests as using a live LLM (deselect with '-m \"not ai\"')"
"ai: marks tests as using a live LLM (deselect with '-m \"not ai\"')",
"vcr",
]
3 changes: 2 additions & 1 deletion redbox-core/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from uuid import UUID, uuid4

import pytest
import requests
from elasticsearch import Elasticsearch
from langchain_core.embeddings.fake import FakeEmbeddings
from langchain_core.messages import HumanMessage
Expand Down Expand Up @@ -212,14 +213,14 @@ def test_wikipedia_tool():
assert metadata.creator_type == ChunkCreatorType.wikipedia


@pytest.mark.vcr()
@pytest.mark.parametrize(
"is_filter, relevant_return, query, keyword",
[
(False, False, "UK government use of AI", "artificial intelligence"),
(True, True, "UK government use of AI", "artificial intelligence"),
],
)
@pytest.mark.vcr()
def test_gov_filter_AI(is_filter, relevant_return, query, keyword):
def run_tool(is_filter):
tool = build_govuk_search_tool(num_results=1, filter=is_filter)
Expand Down

0 comments on commit 6c16776

Please sign in to comment.