diff --git a/agents/requirements.txt b/agents/requirements.txt index 3e45558..eb2bcd2 100644 --- a/agents/requirements.txt +++ b/agents/requirements.txt @@ -1,4 +1,4 @@ -sirji-messages==0.0.32 +sirji-messages==0.0.33 sirji-tools==0.0.16 openai==1.35.7 anthropic==0.29.0 diff --git a/agents/setup.py b/agents/setup.py index a96816a..fcdf1b9 100644 --- a/agents/setup.py +++ b/agents/setup.py @@ -2,7 +2,7 @@ setup( name='sirji-agents', - version='0.0.48', + version='0.0.49', author='Sirji', description='Orchestrator, Generic Agent, and Research Agent components of the Sirji AI agentic framework.', license='MIT', diff --git a/agents/sirji_agents/llm/generic/system_prompts/anthropic.py b/agents/sirji_agents/llm/generic/system_prompts/anthropic.py index 6bc1896..a108993 100644 --- a/agents/sirji_agents/llm/generic/system_prompts/anthropic.py +++ b/agents/sirji_agents/llm/generic/system_prompts/anthropic.py @@ -2,7 +2,7 @@ import os import textwrap -from sirji_messages import ActionEnum, AgentEnum, allowed_response_templates, permissions_dict, ActionEnum +from sirji_messages import ActionEnum, AgentEnum, allowed_response_templates, permissions_dict class AnthropicSystemPrompt: def __init__(self, config, agent_output_folder_index): @@ -69,7 +69,7 @@ def system_prompt(self): *** FROM: {{Your Agent ID}} TO: {sub_agent['id']} - ACTION: INVOKE_AGENT + ACTION: {ActionEnum.INVOKE_AGENT.name} STEP: "provide the step number here for the ongoing step if any." SUMMARY: {{Display a concise summary to the user, describing the action using the present continuous tense.}} BODY: @@ -83,7 +83,7 @@ def system_prompt(self): *** FROM: {{Your Agent ID}} TO: {sub_agent['id']} - ACTION: INVOKE_AGENT_EXISTING_SESSION + ACTION: {ActionEnum.INVOKE_AGENT_EXISTING_SESSION.name} STEP: "provide the step number here for the ongoing step if any." SUMMARY: {{Display a concise summary to the user, describing the action using the present continuous tense.}} BODY: @@ -99,7 +99,7 @@ def system_prompt(self): action_list.add(ActionEnum[action]) allowed_response_templates_str += '\n' + allowed_response_templates(AgentEnum.ANY, AgentEnum.EXECUTOR, action_list) + '\n' - allowed_response_templates_str += "For updating in project folder use either FIND_AND_REPLACE, INSERT_ABOVE or INSERT_BELOW actions. Ensure you provide the exact matching string in find from file, with the exact number of lines and proper indentation for insert and replace actions.\n" + allowed_response_templates_str += f"""For updating in project folder use either {ActionEnum.FIND_AND_REPLACE.name}, {ActionEnum.INSERT_ABOVE.name} or {ActionEnum.INSERT_BELOW.name} actions. Ensure you provide the exact matching string in find from file, with the exact number of lines and proper indentation for insert and replace actions.\n""" allowed_response_templates_str += '\n' + allowed_response_templates(AgentEnum.ANY, AgentEnum.CALLER, permissions_dict[(AgentEnum.ANY, AgentEnum.CALLER)]) + '\n' current_agent_output_index = f"Current contents of Agent Output Index:\n{json.dumps(self.agent_output_folder_index, indent=4)}" diff --git a/agents/sirji_agents/llm/generic/system_prompts/default.py b/agents/sirji_agents/llm/generic/system_prompts/default.py index 3afe930..3ddb9a0 100644 --- a/agents/sirji_agents/llm/generic/system_prompts/default.py +++ b/agents/sirji_agents/llm/generic/system_prompts/default.py @@ -2,7 +2,7 @@ import os import textwrap -from sirji_messages import ActionEnum, AgentEnum, allowed_response_templates, permissions_dict, ActionEnum +from sirji_messages import ActionEnum, AgentEnum, allowed_response_templates, permissions_dict class DefaultSystemPrompt: def __init__(self, config, agent_output_folder_index): @@ -21,7 +21,7 @@ def system_prompt(self): - Your response must conform strictly to one of the allowed Response Templates, as it will be processed programmatically and only these templates are recognized. - Your response must be enclosed within '***' at the beginning and end, without any additional text above or below these markers. - Not conforming above rules will lead to response processing errors.""") - # Todo: Use action names from ActionEnum + understanding_the_folders = textwrap.dedent(""" Project Folder: - The Project Folder is your primary directory for accessing all user-specific project files, including code files, documentation, and other relevant resources. @@ -48,7 +48,7 @@ def system_prompt(self): - Upon being invoked, identify which of your skills match the requirements of the task. - Execute the sub-tasks associated with each of these matching skills. - Do not respond with two actions in the same response. Respond with one action at a time. - - Always use STORE_IN_AGENT_OUTPUT and READ_AGENT_OUTPUT_FILES to write and read files to and from the agent output folder. + - Always use {ActionEnum.STORE_IN_AGENT_OUTPUT.name} and {ActionEnum.READ_AGENT_OUTPUT_FILES.name} to write and read files to and from the agent output folder. - If any step is not applicable or cannot be followed, use the DO_NOTHING action to skip it. """) @@ -69,7 +69,7 @@ def system_prompt(self): *** FROM: {{Your Agent ID}} TO: {sub_agent['id']} - ACTION: INVOKE_AGENT + ACTION: {ActionEnum.INVOKE_AGENT.name} STEP: "provide the step number here for the ongoing step if any." SUMMARY: {{Display a concise summary to the user, describing the action using the present continuous tense.}} BODY: @@ -83,7 +83,7 @@ def system_prompt(self): *** FROM: {{Your Agent ID}} TO: {sub_agent['id']} - ACTION: INVOKE_AGENT_EXISTING_SESSION + ACTION: {ActionEnum.INVOKE_AGENT_EXISTING_SESSION.name} STEP: "provide the step number here for the ongoing step if any." SUMMARY: {{Display a concise summary to the user, describing the action using the present continuous tense.}} BODY: @@ -99,7 +99,7 @@ def system_prompt(self): action_list.add(ActionEnum[action]) allowed_response_templates_str += '\n' + allowed_response_templates(AgentEnum.ANY, AgentEnum.EXECUTOR, action_list) + '\n' - allowed_response_templates_str += "For updating in project folder use either FIND_AND_REPLACE, INSERT_ABOVE or INSERT_BELOW actions. Ensure you provide the exact matching string in find from file, with the exact number of lines and proper indentation for insert and replace actions.\n" + allowed_response_templates_str += textwrap.dedent(f"""For updating in project folder use either {ActionEnum.FIND_AND_REPLACE.name}, {ActionEnum.INSERT_ABOVE.name} or {ActionEnum.INSERT_BELOW.name} actions. Ensure you provide the exact matching string in find from file, with the exact number of lines and proper indentation for insert and replace actions.""") + '\n' allowed_response_templates_str += '\n' + allowed_response_templates(AgentEnum.ANY, AgentEnum.CALLER, permissions_dict[(AgentEnum.ANY, AgentEnum.CALLER)]) + '\n' current_agent_output_index = f"Current contents of Agent Output Index:\n{json.dumps(self.agent_output_folder_index, indent=4)}" @@ -118,7 +118,7 @@ def __format_skills(self): output_text += f"Skill: {self.config['skill']}\n" - output_text += "Make sure to first convert all the points mentioned in Pseudo code in plain english to steps having at max 10 words each and log these steps using LOG_STEPS action.\n" + output_text += f"Make sure to first convert all the points mentioned in Pseudo code in plain english to steps having at max 10 words each and log these steps using {ActionEnum.LOG_STEPS.name} action.\n" output_text += "Then, execute the steps in the order they are logged.\n" output_text += f"Pseudo code which you must follow:\n{self.config['pseudo_code']}" output_text += "\n" diff --git a/agents/sirji_agents/llm/orchestrator.py b/agents/sirji_agents/llm/orchestrator.py index 1a1ad93..b4d9510 100644 --- a/agents/sirji_agents/llm/orchestrator.py +++ b/agents/sirji_agents/llm/orchestrator.py @@ -2,7 +2,6 @@ import os import json -# TODO - log file should be dynamically created based on agent ID from sirji_tools.logger import o_logger as logger from sirji_messages import message_parse, ActionEnum, AgentEnum, allowed_response_templates, permissions_dict, MessageIncorrectFormatError, MessageMultipleActionError, MessageUnRecognizedActionError, MessageMissingPropertyError, MessageLengthConstraintError @@ -132,7 +131,7 @@ def system_prompt(self): pseudo_code = textwrap.dedent(f""" Pseudo code which you must follow: - 1. Invoke agent RECIPE_SELECTOR to get the recipe selected from the available recipes by SIRJI_USER and then store it in Agent Output Folder. + 1. Invoke agent {ActionEnum.RECIPE_SELECTOR.name} to get the recipe selected from the available recipes by SIRJI_USER and then store it in Agent Output Folder. 2. Read the selected recipe from the Agent Output Folder. 3. Loop over the prescribed tasks in the selected recipe and invoke the agent specified in the recipe alongside the current task, explaining the task in the BODY of the invocation. """) diff --git a/messages/setup.py b/messages/setup.py index 9b15d11..3835f2e 100644 --- a/messages/setup.py +++ b/messages/setup.py @@ -2,7 +2,7 @@ setup( name='sirji-messages', - version='0.0.32', + version='0.0.33', author='Sirji', description='Sirji messaging protocol implementation to create, validate and parse messages.', license='MIT', diff --git a/sirji/vscode-extension/package.json b/sirji/vscode-extension/package.json index 463b776..23d4316 100644 --- a/sirji/vscode-extension/package.json +++ b/sirji/vscode-extension/package.json @@ -2,7 +2,7 @@ "name": "sirji", "displayName": "Sirji", "description": "Sirji is an AI Software Development Agent.", - "version": "0.0.31-beta.2", + "version": "0.0.31-beta.3", "publisher": "TrueSparrow", "icon": "out/assets/sirji.png", "repository": { diff --git a/sirji/vscode-extension/src/py_scripts/requirements-windows.txt b/sirji/vscode-extension/src/py_scripts/requirements-windows.txt index 348c8fc..0dd0b5c 100644 --- a/sirji/vscode-extension/src/py_scripts/requirements-windows.txt +++ b/sirji/vscode-extension/src/py_scripts/requirements-windows.txt @@ -1,4 +1,4 @@ urllib3==2.2.1 pyyaml==6.0.1 -sirji-messages==0.0.32 -sirji-agents == 0.0.48 +sirji-messages==0.0.33 +sirji-agents == 0.0.49 diff --git a/sirji/vscode-extension/src/py_scripts/requirements.txt b/sirji/vscode-extension/src/py_scripts/requirements.txt index 3ee22ed..3f1d700 100644 --- a/sirji/vscode-extension/src/py_scripts/requirements.txt +++ b/sirji/vscode-extension/src/py_scripts/requirements.txt @@ -1,4 +1,4 @@ urllib3==1.25.11 pyyaml==6.0.1 -sirji-messages==0.0.32 -sirji-agents == 0.0.48 +sirji-messages==0.0.33 +sirji-agents == 0.0.49