Skip to content

Commit

Permalink
Add execute_command endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Aug 20, 2023
1 parent 43f0061 commit e1e3350
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions agixtsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,17 @@ def toggle_command(self, agent_name: str, command_name: str, enable: bool) -> st
except Exception as e:
return self.handle_error(e)

def execute_command(self, agent_name: str, command_name: str, command_args: dict):
try:
response = requests.post(
headers=self.headers,
url=f"{self.base_uri}/api/agent/{agent_name}/command",
json={"command_name": command_name, "command_args": command_args},
)
return response.json()["response"]
except Exception as e:
return self.handle_error(e)

def get_chains(self) -> List[str]:
try:
response = requests.get(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="agixtsdk",
version="0.0.24",
version="0.0.25",
description="The AGiXT SDK for Python.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit e1e3350

Please sign in to comment.