Skip to content

Commit a07fca6

Browse files
committed
fix: id = slug in published agents
1 parent c19f78f commit a07fca6

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/publish_remote_agents.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,15 @@ def publish_remote_agent(
9696

9797
# Remove double slashes in route_name
9898
route_name = f"agents/{route_name}/stream-completion?token={abi_api_key}".replace("//", "/")
99+
100+
# Create a slug from the name
101+
slug = name.lower().replace(" ", "-").replace("_", "-")
99102

100103
# Create plugin data
101104
plugin_data = {
102-
"id": name.lower(),
103-
"name": name,
104-
"slug": name.lower().replace(" ", "-").replace("_", "-"),
105+
"id": slug,
106+
"name": name.replace("_", " "),
107+
"slug": slug,
105108
"default": default,
106109
"avatar": avatar,
107110
"description": description,
@@ -138,7 +141,7 @@ def publish_remote_agent(
138141
if __name__ == "__main__":
139142
from src import secret, config
140143
naas_api_key = secret.get("NAAS_API_KEY")
141-
api_base_url = f"https://{config.space_name}.default.space.naas.ai"
144+
api_base_url = f"https://{config.space_name}-api.default.space.naas.ai"
142145
abi_api_key = secret.get("ABI_API_KEY")
143146
workspace_id = config.workspace_id
144147
github_access_token = secret.get("GITHUB_ACCESS_TOKEN")

0 commit comments

Comments
 (0)