setting fake openai key

This commit is contained in:
João Moura
2024-04-03 06:56:02 -03:00
parent af7803e94b
commit cf4138f385

View File

@@ -1,6 +1,7 @@
import contextlib import contextlib
import io import io
import logging import logging
import os
from typing import Any, Dict from typing import Any, Dict
from embedchain import App from embedchain import App
@@ -38,6 +39,11 @@ class RAGStorage(Storage):
def __init__(self, type, allow_reset=True, embedder_config=None): def __init__(self, type, allow_reset=True, embedder_config=None):
super().__init__() super().__init__()
if (
not os.getenv("OPENAI_API_KEY")
and not os.getenv("OPENAI_BASE_URLl") == "https://api.openai.com/v1"
):
os.environ["OPENAI_API_KEY"] = "fake"
config = { config = {
"app": { "app": {
"config": {"name": type, "collect_metrics": False, "log_level": "ERROR"} "config": {"name": type, "collect_metrics": False, "log_level": "ERROR"}