Skip to content

feat: add randomize to @func_latency_control - #265

Merged
Aj33tSKY merged 4 commits into
polyai:mainfrom
Aj33tSKY:ajeet/feat/shuffle-delay-responses
Aug 28, 2026
Merged

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

Conversation

@Aj33tSKY

@Aj33tSKY Aj33tSKY commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

This comment has been minimized.

@github-actions

This comment has been minimized.

…yout

Add randomize to the latency-control args table and example under
reference/resources/functions.md after the docs restructure.

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

Copy link
Copy Markdown
Contributor

Coverage Report

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

Changed file coverage

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

@Aj33tSKY
Aj33tSKY merged commit f9d3884 into polyai:main Aug 28, 2026
7 checks passed
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.

2 participants