Skip to content

Commit

Permalink
add new param to langchain test
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana committed Jul 15, 2024
1 parent 42c7c3b commit 25ca6eb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/integrations/langchain/test_langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ def _llm_type(self) -> str:
return llm_type


def tiktoken_encoding_if_installed():
try:
import tiktoken # type: ignore # noqa # pylint: disable=unused-import

return "cl100k_base"
except ImportError:
return None


@pytest.mark.parametrize(
"send_default_pii, include_prompts, use_unknown_llm_type",
[
Expand All @@ -62,7 +71,12 @@ def test_langchain_agent(
llm_type = "acme-llm" if use_unknown_llm_type else "openai-chat"

sentry_init(
integrations=[LangchainIntegration(include_prompts=include_prompts)],
integrations=[
LangchainIntegration(
include_prompts=include_prompts,
tiktoken_encoding_name=tiktoken_encoding_if_installed(),
)
],
traces_sample_rate=1.0,
send_default_pii=send_default_pii,
)
Expand Down

0 comments on commit 25ca6eb

Please sign in to comment.