Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@

class OpenAiTextToTextModel(TraditionalOnlineLlm, ABC):
_OPENAI_ASYNC_CLIENT = AsyncOpenAI(
api_key=os.getenv("OPENAI_API_KEY"),
api_key=(
os.getenv("OPENAI_API_KEY")
if os.getenv("OPENAI_API_KEY") is not None
else "fake_key_so_it_doesn't_error_on_initialization"
),
max_retries=0, # Retry is implemented locally
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ class PerplexityTextModel(OpenAiTextToTextModel, PricedPerRequest, ABC):
PRICE_PER_TOKEN: float
PERPLEXITY_API_KEY = os.getenv("PERPLEXITY_API_KEY")
_OPENAI_ASYNC_CLIENT = AsyncOpenAI(
api_key=PERPLEXITY_API_KEY,
api_key=(
PERPLEXITY_API_KEY
if PERPLEXITY_API_KEY is not None
else "fake_key_so_it_doesn't_error_on_initialization"
),
base_url="https://api.perplexity.ai",
max_retries=0, # Retry is implemented locally
)
Expand Down
Loading