diff --git a/__init__.py b/__init__.py index 4f09cac..ce482be 100644 --- a/__init__.py +++ b/__init__.py @@ -4,4 +4,4 @@ JIVAS is an Agentic Framework for rapidly prototyping and deploying graph-based, AI solutions. """ -__version__ = "2.1.24" +__version__ = "2.1.25" diff --git a/core/jivas/agent/action/action.jac b/core/jivas/agent/action/action.jac index c1c1c7a..be07b25 100644 --- a/core/jivas/agent/action/action.jac +++ b/core/jivas/agent/action/action.jac @@ -180,9 +180,9 @@ node Action(GraphNode) { return self.get_agent().get_file(f"{self.get_type()}/{path}"); } - def save_file(path: str, content: bytes) -> bool { + def save_file(path: str, content: bytes, content_type: str = "") -> bool { # saves a file associated with this action at the given path - return self.get_agent().save_file(f"{self.get_type()}/{path}", content); + return self.get_agent().save_file(f"{self.get_type()}/{path}", content, content_type); } def delete_file(path: str) -> bool { diff --git a/core/jivas/agent/action/subgraph_action/state.jac b/core/jivas/agent/action/subgraph_action/state.jac index e6702a7..67d2228 100644 --- a/core/jivas/agent/action/subgraph_action/state.jac +++ b/core/jivas/agent/action/subgraph_action/state.jac @@ -130,6 +130,7 @@ node State(GraphNode) { directive = directive + "\n They can choose from the list of options below\n" + str(options); } frame_node.data_set(key="directive", value=directive); + return directive; } elif required == False { diff --git a/core/jivas/agent/core/agent.jac b/core/jivas/agent/core/agent.jac index c38dbbe..5e026e3 100644 --- a/core/jivas/agent/core/agent.jac +++ b/core/jivas/agent/core/agent.jac @@ -446,9 +446,9 @@ node Agent(GraphNode) { return file_interface.get_file(f"{self.id}/{path}"); } - def save_file(path: str, content: bytes) -> bool { + def save_file(path: str, content: bytes, content_type: str = "") -> bool { # Saves a file for this agent at the given path. - return file_interface.save_file(f"{self.id}/{path}", content); + return file_interface.save_file(f"{self.id}/{path}", content, content_type); } def delete_file(path: str) -> bool { diff --git a/jvcli/jvcli/templates/2.1.24/project/README.md b/jvcli/jvcli/templates/2.1.25/project/README.md similarity index 100% rename from jvcli/jvcli/templates/2.1.24/project/README.md rename to jvcli/jvcli/templates/2.1.25/project/README.md diff --git a/jvcli/jvcli/templates/2.1.24/project/actions/README.md b/jvcli/jvcli/templates/2.1.25/project/actions/README.md similarity index 100% rename from jvcli/jvcli/templates/2.1.24/project/actions/README.md rename to jvcli/jvcli/templates/2.1.25/project/actions/README.md diff --git a/jvcli/jvcli/templates/2.1.24/project/daf/README.md b/jvcli/jvcli/templates/2.1.25/project/daf/README.md similarity index 100% rename from jvcli/jvcli/templates/2.1.24/project/daf/README.md rename to jvcli/jvcli/templates/2.1.25/project/daf/README.md diff --git a/jvcli/jvcli/templates/2.1.24/project/env.example b/jvcli/jvcli/templates/2.1.25/project/env.example similarity index 97% rename from jvcli/jvcli/templates/2.1.24/project/env.example rename to jvcli/jvcli/templates/2.1.25/project/env.example index af63cc6..e4066c0 100644 --- a/jvcli/jvcli/templates/2.1.24/project/env.example +++ b/jvcli/jvcli/templates/2.1.25/project/env.example @@ -20,7 +20,7 @@ JIVAS_FILES_SHORT_URL=${JIVAS_BASE_URL}/f # JIVAS_S3_ENDPOINT=access_key_id # optional # JIVAS_S3_ACCESS_KEY_ID=access_key_id # JIVAS_S3_SECRET_ACCESS_KEY=secret_access_key -# JIVAS_S3_REGION=us-east-1 +# JIVAS_S3_REGION_NAME=us-east-1 # JIVAS_S3_BUCKET_NAME=my-bucket # Secrets Config diff --git a/jvcli/jvcli/templates/2.1.24/project/gitignore.example b/jvcli/jvcli/templates/2.1.25/project/gitignore.example similarity index 100% rename from jvcli/jvcli/templates/2.1.24/project/gitignore.example rename to jvcli/jvcli/templates/2.1.25/project/gitignore.example diff --git a/jvcli/jvcli/templates/2.1.24/project/globals.jac b/jvcli/jvcli/templates/2.1.25/project/globals.jac similarity index 100% rename from jvcli/jvcli/templates/2.1.24/project/globals.jac rename to jvcli/jvcli/templates/2.1.25/project/globals.jac diff --git a/jvcli/jvcli/templates/2.1.24/project/main.jac b/jvcli/jvcli/templates/2.1.25/project/main.jac similarity index 100% rename from jvcli/jvcli/templates/2.1.24/project/main.jac rename to jvcli/jvcli/templates/2.1.25/project/main.jac diff --git a/jvcli/jvcli/templates/2.1.24/project/tests/README.md b/jvcli/jvcli/templates/2.1.25/project/tests/README.md similarity index 100% rename from jvcli/jvcli/templates/2.1.24/project/tests/README.md rename to jvcli/jvcli/templates/2.1.25/project/tests/README.md diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/CHANGELOG.md b/jvcli/jvcli/templates/2.1.25/sourcefiles/CHANGELOG.md similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/CHANGELOG.md rename to jvcli/jvcli/templates/2.1.25/sourcefiles/CHANGELOG.md diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/README.md b/jvcli/jvcli/templates/2.1.25/sourcefiles/README.md similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/README.md rename to jvcli/jvcli/templates/2.1.25/sourcefiles/README.md diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/action_app.py b/jvcli/jvcli/templates/2.1.25/sourcefiles/action_app.py similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/action_app.py rename to jvcli/jvcli/templates/2.1.25/sourcefiles/action_app.py diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/action_archetype.jac b/jvcli/jvcli/templates/2.1.25/sourcefiles/action_archetype.jac similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/action_archetype.jac rename to jvcli/jvcli/templates/2.1.25/sourcefiles/action_archetype.jac diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/action_info.yaml b/jvcli/jvcli/templates/2.1.25/sourcefiles/action_info.yaml similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/action_info.yaml rename to jvcli/jvcli/templates/2.1.25/sourcefiles/action_info.yaml diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/action_lib.jac b/jvcli/jvcli/templates/2.1.25/sourcefiles/action_lib.jac similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/action_lib.jac rename to jvcli/jvcli/templates/2.1.25/sourcefiles/action_lib.jac diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/agent_descriptor.yaml b/jvcli/jvcli/templates/2.1.25/sourcefiles/agent_descriptor.yaml similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/agent_descriptor.yaml rename to jvcli/jvcli/templates/2.1.25/sourcefiles/agent_descriptor.yaml diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/agent_info.yaml b/jvcli/jvcli/templates/2.1.25/sourcefiles/agent_info.yaml similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/agent_info.yaml rename to jvcli/jvcli/templates/2.1.25/sourcefiles/agent_info.yaml diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/agent_knowledge.yaml b/jvcli/jvcli/templates/2.1.25/sourcefiles/agent_knowledge.yaml similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/agent_knowledge.yaml rename to jvcli/jvcli/templates/2.1.25/sourcefiles/agent_knowledge.yaml diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/agent_memory.yaml b/jvcli/jvcli/templates/2.1.25/sourcefiles/agent_memory.yaml similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/agent_memory.yaml rename to jvcli/jvcli/templates/2.1.25/sourcefiles/agent_memory.yaml diff --git a/jvcli/jvcli/templates/2.1.24/sourcefiles/interact_action_archetype.jac b/jvcli/jvcli/templates/2.1.25/sourcefiles/interact_action_archetype.jac similarity index 100% rename from jvcli/jvcli/templates/2.1.24/sourcefiles/interact_action_archetype.jac rename to jvcli/jvcli/templates/2.1.25/sourcefiles/interact_action_archetype.jac diff --git a/jvserve/jvserve/lib/file_interface.py b/jvserve/jvserve/lib/file_interface.py index b2ec336..75b5b97 100644 --- a/jvserve/jvserve/lib/file_interface.py +++ b/jvserve/jvserve/lib/file_interface.py @@ -28,7 +28,7 @@ def get_file(self, filename: str) -> bytes | None: pass @abstractmethod - def save_file(self, filename: str, content: bytes) -> bool: + def save_file(self, filename: str, content: bytes, content_type: str = "") -> bool: """Save content to a file in storage.""" pass @@ -58,7 +58,7 @@ def get_file(self, filename: str) -> bytes | None: return f.read() return None - def save_file(self, filename: str, content: bytes) -> bool: + def save_file(self, filename: str, content: bytes, content_type: str = "") -> bool: """Write content to a local file.""" file_path = os.path.join(self.__root_dir, filename) os.makedirs(os.path.dirname(file_path), exist_ok=True) @@ -124,13 +124,22 @@ def get_file(self, filename: str) -> bytes | None: except Exception: return None - def save_file(self, filename: str, content: bytes) -> bool: + def save_file(self, filename: str, content: bytes, content_type: str = "") -> bool: """Save file to S3 bucket.""" try: file_key = os.path.join(self.__root_dir, filename) - self.s3_client.put_object( - Bucket=self.bucket_name, Key=file_key, Body=content - ) + + if content_type: + self.s3_client.put_object( + Bucket=self.bucket_name, + Key=file_key, + Body=content, + ContentType=content_type, + ) + else: + self.s3_client.put_object( + Bucket=self.bucket_name, Key=file_key, Body=content + ) return True except Exception: return False