Skip to content

Commit

Permalink
Add max_batch_inputs and block_duration to message Function
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Bernhardsson committed Jul 5, 2024
1 parent bcb8e89 commit 0e5f3be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modal/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ def from_args(
allow_background_volume_commits: Optional[bool] = None,
block_network: bool = False,
max_inputs: Optional[int] = None,
max_batch_inputs: Optional[int] = None,
block_duration: Optional[float] = None,
ephemeral_disk: Optional[int] = None,
) -> None:
"""mdmd:hidden"""
Expand Down Expand Up @@ -807,6 +809,8 @@ async def _load(self: _Function, resolver: Resolver, existing_object_id: Optiona
object_dependencies=object_dependencies,
block_network=block_network,
max_inputs=max_inputs or 0,
max_batch_inputs=max_batch_inputs or 1,
block_duration=block_duration or 0,
cloud_bucket_mounts=cloud_bucket_mounts_to_proto(cloud_bucket_mounts),
_experimental_boost=_experimental_boost,
scheduler_placement=scheduler_placement.proto if scheduler_placement else None,
Expand Down
3 changes: 3 additions & 0 deletions modal_proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,9 @@ message Function {

string use_function_id = 54; // for class methods use this function id instead for invocations - the *referenced* function should have is_class=True
string use_method_name = 55; // for class methods - this method name needs to be included in the FunctionInput

int32 max_batch_inputs = 56; // Maximum number of inputs per batch
float block_duration = 57; // Time to block before a response is needed
}

message FunctionBindParamsRequest {
Expand Down

0 comments on commit 0e5f3be

Please sign in to comment.