From 2851aec36086d7a5a948c049bfcdd2fc7414aa81 Mon Sep 17 00:00:00 2001 From: Nehemiah Onyekachukwu Emmanuel Date: Thu, 14 Dec 2023 03:34:03 +0100 Subject: [PATCH] fix client func name --- agenta-backend/agenta_backend/main.py | 3 ++- agenta-cli/agenta/cli/main.py | 2 +- agenta-cli/agenta/client/api.py | 16 +++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/agenta-backend/agenta_backend/main.py b/agenta-backend/agenta_backend/main.py index e197696360..c1c13e6b76 100644 --- a/agenta-backend/agenta_backend/main.py +++ b/agenta-backend/agenta_backend/main.py @@ -45,7 +45,8 @@ async def lifespan(application: FastAPI, cache=True): yield -app = FastAPI(lifespan=lifespan) +# app = FastAPI(lifespan=lifespan) +app = FastAPI() allow_headers = ["Content-Type"] diff --git a/agenta-cli/agenta/cli/main.py b/agenta-cli/agenta/cli/main.py index 1496777d5c..1fc6b0513d 100644 --- a/agenta-cli/agenta/cli/main.py +++ b/agenta-cli/agenta/cli/main.py @@ -110,7 +110,7 @@ def init(app_name: str): if global_backend_host: backend_host = global_backend_host else: - backend_host = "https://cloud.agenta.ai" + backend_host = "http://localhost" api_key = helper.get_api_key(backend_host) diff --git a/agenta-cli/agenta/client/api.py b/agenta-cli/agenta/client/api.py index 61a6a873c4..6da7869151 100644 --- a/agenta-cli/agenta/client/api.py +++ b/agenta-cli/agenta/client/api.py @@ -47,15 +47,13 @@ def add_variant_to_server( ) for attempt in range(retries): try: - response = ( - client.add_variant_from_image_apps_app_id_variant_from_image_post( - app_id=app_id, - variant_name=f"{base_name.lower()}.default", - base_name=base_name, - config_name="default", - docker_id=image.docker_id, - tags=image.tags, - ) + response = client.add_variant_from_image( + app_id=app_id, + variant_name=f"{base_name.lower()}.default", + base_name=base_name, + config_name="default", + docker_id=image.docker_id, + tags=image.tags, ) click.echo(click.style("\nVariant added successfully.", fg="green")) return response