Skip to content

Commit

Permalink
fixed parsing issue and better test error message
Browse files Browse the repository at this point in the history
  • Loading branch information
bboynton97 committed Nov 30, 2024
1 parent ff35935 commit 28c1a4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agentstack/tools/neon.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
},
"tools": ["create_database", "execute_sql_ddl", "run_sql_query"],
"cta": "Create an API key at https://www.neon.tech"
}
}
Empty file removed agentstack/tools/tools.json
Empty file.
7 changes: 6 additions & 1 deletion tests/test_tool_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import os, sys
import unittest
import importlib.resources
Expand Down Expand Up @@ -41,6 +42,10 @@ def test_all_json_configs_from_tool_name(self):

def test_all_json_configs_from_tool_path(self):
for path in get_all_tool_paths():
config = ToolConfig.from_json(path)
try:
config = ToolConfig.from_json(path)
except json.decoder.JSONDecodeError as e:
raise Exception(f"Failed to decode tool json at {path}. Does your tool config fit the required formatting? https://github.com/AgentOps-AI/AgentStack/blob/main/agentstack/tools/~README.md")

assert config.name == path.stem
# We can assume that pydantic validation caught any other issues

0 comments on commit 28c1a4f

Please sign in to comment.