Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/key_injection #1549

Merged
merged 2 commits into from
Apr 23, 2024
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
12 changes: 1 addition & 11 deletions agenta-backend/agenta_backend/routers/variants_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,7 @@ async def start_variant(
logger.debug("Starting variant %s", variant_id)

# Inject env vars to docker container
if isCloudEE():
if not os.environ["OPENAI_API_KEY"]:
raise HTTPException(
status_code=400,
detail="Unable to start app container. Please file an issue by clicking on the button below.",
)
envvars = {
"OPENAI_API_KEY": os.environ["OPENAI_API_KEY"],
}
else:
envvars = {} if env_vars is None else env_vars.env_vars
envvars = {} if env_vars is None else env_vars.env_vars

if action.action == VariantActionEnum.START:
url: URI = await app_manager.start_variant(app_variant_db, envvars)
Expand Down
2 changes: 1 addition & 1 deletion agenta-cli/agenta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .sdk.utils.preinit import PreInitObject
from .sdk.agenta_decorator import app, entrypoint
from .sdk.context import get_contexts, save_context
from .sdk.types import (
Expand All @@ -14,7 +15,6 @@
BinaryParam,
)
from .sdk.tracing.decorators import span
from .sdk.utils.preinit import PreInitObject
from .sdk.agenta_init import Config, init, llm_tracing
from .sdk.utils.helper.openai_cost import calculate_token_usage

Expand Down
Loading