Skip to content

Commit

Permalink
fixing JIRA tool issue to fetch keys
Browse files Browse the repository at this point in the history
  • Loading branch information
TransformerOptimus committed Jun 28, 2023
1 parent 1644b24 commit 0e7c19a
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion superagi/jobs/agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, session=None, toolkit_id=None):

def get_tool_config(self, key: str):
tool_config = self.session.query(ToolConfig).filter_by(key=key, toolkit_id=self.toolkit_id).first()
if tool_config:
if tool_config and tool_config.value:
return tool_config.value
return super().get_tool_config(key=key)

Expand Down
2 changes: 1 addition & 1 deletion superagi/tools/base_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create_function_schema(

class BaseToolkitConfiguration:

def get_tool_config(key: str):
def get_tool_config(self, key: str):
# Default implementation of the tool configuration retrieval logic
with open("config.yaml") as file:
config = yaml.safe_load(file)
Expand Down
2 changes: 1 addition & 1 deletion superagi/tools/jira/create_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ def _execute(self, fields: dict):
Returns:
The key of the created issue.
"""
jira = JiraTool.build_jira_instance()
jira = self.build_jira_instance()
new_issue = jira.create_issue(fields=fields)
return f"Issue '{new_issue.key}' created successfully!"
2 changes: 1 addition & 1 deletion superagi/tools/jira/edit_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _execute(self, key: str, fields: dict):
Returns:
The key of the created issue. or Issue not found!
"""
jira = JiraTool.build_jira_instance()
jira = self.build_jira_instance()
issues = jira.search_issues('key=')
if len(issues) > 0:
issues[0].update(fields=fields)
Expand Down
2 changes: 1 addition & 1 deletion superagi/tools/jira/get_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _execute(self) -> str:
Returns:
The key of the created issue.
"""
jira = JiraTool.build_jira_instance()
jira = self.build_jira_instance()
projects = jira.projects()
parsed_projects = self.parse_projects(projects)
parsed_projects_str = (
Expand Down
2 changes: 1 addition & 1 deletion superagi/tools/jira/search_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _execute(self, query: str) -> str:
Returns:
The key of the created issue.
"""
jira = JiraTool.build_jira_instance()
jira = self.build_jira_instance()
issues = jira.search_issues(query)
parsed_issues = self.parse_issues(issues)
parsed_issues_str = (
Expand Down
1 change: 0 additions & 1 deletion superagi/tools/jira/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class JiraTool(BaseTool):
description : The description.
args_schema : The args schema.
"""
@classmethod
def build_jira_instance(self) -> dict:
"""
Build a Jira instance.
Expand Down

0 comments on commit 0e7c19a

Please sign in to comment.