Skip to content
Snippets Groups Projects
Unverified Commit 29978055 authored by James Briggs's avatar James Briggs Committed by GitHub
Browse files

Merge pull request #329 from aurelio-labs/james/pytests-oai-init

fix: add condition to init encoder
parents 43779a64 26070a3c
No related branches found
No related tags found
No related merge requests found
import os
import pytest
from semantic_router.encoders.base import BaseEncoder
from semantic_router.encoders.openai import OpenAIEncoder
with open("tests/integration/57640.4032.txt", "r") as fp:
......@@ -8,7 +9,10 @@ with open("tests/integration/57640.4032.txt", "r") as fp:
@pytest.fixture
def openai_encoder():
return OpenAIEncoder()
if os.environ.get("OPENAI_API_KEY") is None:
return BaseEncoder()
else:
return OpenAIEncoder()
class TestOpenAIEncoder:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment