Skip to content

feat: add randomize to @func_latency_control - #265

Open
Aj33tSKY wants to merge 2 commits into
polyai:mainfrom
Aj33tSKY:ajeet/feat/shuffle-delay-responses
Open

feat: add randomize to @func_latency_control#265
Aj33tSKY wants to merge 2 commits into
polyai:mainfrom
Aj33tSKY:ajeet/feat/shuffle-delay-responses

Conversation

@Aj33tSKY

@Aj33tSKY Aj33tSKY commented Aug 10, 2026

Copy link
Copy Markdown

Summary

Adds randomize to @func_latency_control so ADK projects can opt into shuffling delay responses per call.

Changes

  • @func_latency_control(..., randomize: bool = False)
  • Parse/render/to_proto/create wiring on FunctionLatencyControl
  • Updated functions_pb2 bindings
  • Docs + unit tests

Test strategy

  • Added/updated unit tests
  • Manual CLI testing (poly <command>)
  • Tested against a live Agent Studio project
  • N/A (docs, config, or trivial change)

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes (latency/randomize cases)
  • No breaking changes to the poly CLI interface (or migration path documented)
  • Commit messages follow conventional commits

Example

@func_latency_control(
    delay_before_responses_start=0,
    silence_after_each_response=2,
    delay_responses=[("$delay_1", 3), ("$delay_2", 2)],
    randomize=True,
)

Expose latencyControl.randomize on the ADK decorator so projects can
opt into shuffling delay responses per call via push/pull.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Aj33tSKY
Aj33tSKY requested a review from a team August 10, 2026 17:19
@Aj33tSKY
Aj33tSKY requested a review from a team as a code owner August 10, 2026 17:19
@github-actions

This comment has been minimized.

Copy regenerated Sourcerer SDK bindings so ADK matches the canonical functions.proto randomize fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
72.7% 72.7% +0.0% ✅

Changed file coverage

File Coverage Change
poly/resources/function.py 81.3% +0.9% ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant