Skip to content

Commit

Permalink
Update - remove backend_host from get_api_key arg
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Nov 27, 2023
1 parent 04219d0 commit 895842d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions agenta-cli/agenta/cli/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,14 @@ def set_global_config(var_name: str, var_value: Any) -> None:
toml.dump(global_config, config_file)


def get_api_key(backend_host: str) -> str:
def get_api_key() -> str:
"""
Retrieve or request the API key for accessing the Agenta platform.
This function first looks for an existing API key in the global config file.
If found, it prompts the user to confirm whether they'd like to use that key.
If not found, it asks the user to input a new key.
Args:
backend_host (str): The URL to the backend
Returns:
str: The API key to be used for accessing the Agenta platform.
Expand All @@ -88,7 +85,7 @@ def get_api_key(backend_host: str) -> str:
sys.exit(0)

api_key = questionary.text(
f"(You can get your API Key here: {backend_host}/settings?tab=apiKeys) "
"(You can get your API Key here: https://cloud.agenta.ai/settings?tab=apiKeys) "
"Please provide your API key:"
).ask()

Expand Down
2 changes: 1 addition & 1 deletion agenta-cli/agenta/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def init(app_name: str):
elif where_question == "On agenta cloud":
backend_host = "https://cloud.agenta.ai"

api_key = helper.get_api_key(backend_host)
api_key = helper.get_api_key()
client.validate_api_key(api_key, backend_host)

elif where_question is None: # User pressed Ctrl+C
Expand Down

0 comments on commit 895842d

Please sign in to comment.