Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
🦋 Changeset detectedLatest commit: 96c113e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Vertex AI Mock Responses Check
|
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
| let functionCalls: FunctionCall[] | undefined; | ||
| let functionCallTurnCount = 0; | ||
| const functionCallMaxTurns = | ||
| this.requestOptions?.maxSequentalFunctionCalls ?? |
There was a problem hiding this comment.
if maxSequentalFunctionCalls is zero or negative then it still executes at least one function. Should we prevent this from happening?
There was a problem hiding this comment.
Just stepped through to check and surprisingly it won't. The order of operations of the loop is a little odd. So the first loop always executes, however each loop only makes one request to the server. The first request will send the user prompt, and if the response has callable FunctionCall parts, they are assigned to the variable functionCalls as needed. However the loop stops at the assignment, and hits the while condition, where it will stop if maxturns is set to 0. It's only on the second iteration of the loop where it would actually execute the functions (and send the result to the model).
Just to be sure I tested this out in my test app and that's the behavior I see. This actually would make it easy to test the limit so I will add a unit test that does this.
* Refactor Github Action per b/485167538 (#9555) Co-authored-by: Ben Knutson <benknutson@google.com> * build(deps): bump lodash in /packages/auth-compat/demo/functions (#9482) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump lodash in /packages/auth-compat/demo (#9464) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump lodash in /packages/rules-unit-testing/functions (#9463) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump lodash in /packages/auth/demo/functions (#9466) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): update dependency webpack-dev-server to v5.2.1 [security] (#9078) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update google-github-actions/auth digest to fc21748 (#8879) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * build(deps-dev): bump lodash from 4.17.21 to 4.17.23 (#9465) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove health metrics workflows (#9571) * feat(ai): Automatic function calling (#9489) * Updating otel dependencies * format * Updating otel dependencies * Remove fetch and user interaction libaries * Removing node tracing * format * Update angular example to modern standards (#9583) * chore(deps): update dependency @rollup/plugin-strip to v3 (#8745) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update dependency @rollup/plugin-virtual to v3 (#8771) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Use environment for wdr tokens (#9578) * use environment for wdr tokens * missed a file * fix(deps): update dependency @rushstack/node-core-library to v5 (#8816) * fix(deps): update dependency @rushstack/node-core-library to v5 * Fix method name --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christina Holland <chholland@google.com> * Update logs endpoint w/ location (fixed to `global` for now) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Google Admin <github-admin@google.com> Co-authored-by: Ben Knutson <benknutson@google.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christina Holland <chholland@google.com> Co-authored-by: Anit Das <anitdas@google.com> Co-authored-by: Anthony Barone <tonybaroneee@gmail.com> Co-authored-by: Morgan Chen <morganchen12@gmail.com>
Automatic function calling
Enabled only in chat (on
sendMessageandsendMessageStream).Docs (internal links)
functionReferenceto theirFunctionDeclarationwhich is a reference to the actual function they would like called. If this is provided, then instead of returning aFunctionCallobject that tells the developer what function to call with what arguments, the SDK actually calls the function, and sends the results back to the model in aFunctionResponseobject. If the model responds with moreFunctionCalls, it will call those functions as well, until the model finally responds with something that is not aFunctionCall, at which point the SDK will return that response to the developer.Misc
partswas added toFunctionResponsefor multimodal, which was something that was added to the model that our SDK needs to update to reflect: https://ai.google.dev/gemini-api/docs/function-calling?example=meeting#multimodal