Skip to content
This repository was archived by the owner on Jun 22, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions core/jivas/agent/action/action.jac
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions core/jivas/agent/action/subgraph_action/state.jac
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions core/jivas/agent/core/agent.jac
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 15 additions & 6 deletions jvserve/jvserve/lib/file_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down