Skip to content

refactor(ai): update WebhookOptions, Gemini, and Vertex types - #1952

Merged
inlined merged 5 commits into
masterfrom
fal-feedback
Aug 26, 2026
Merged

refactor(ai): update WebhookOptions, Gemini, and Vertex types#1952
inlined merged 5 commits into
masterfrom
fal-feedback

Conversation

@inlined

@inlined inlined commented Aug 25, 2026

Copy link
Copy Markdown
Member

relnote: Refactor WebhookOptions, Gemini, and Vertex AI provider types in v2/ai

Description

  • Remove regionalWebhook field and array location typing from WebhookOptions in AI provider.
  • Remove labels field from Vertex GenerateContentRequest.
  • Note on tools and toolConfig: verified that GenerateContentRequest in Vertex extends BaseModelParams which already provides tools?: Tool[] and toolConfig?: ToolConfig, making explicit re-declaration on GenerateContentRequest unnecessary.
  • Remove generateContentStream reference from JSDoc comments in Gemini v1beta.

Scenarios Tested

  • Ran unit tests in spec/v2/providers/ai.spec.ts
  • Ran npm test and npm run format

relnote: remove unused fields from FAL functions

### Description
- Remove regionalWebhook field and array location typing from WebhookOptions in AI provider.
- Remove labels field from Vertex GenerateContentRequest.
- Explicitly add tools and toolConfig fields to Vertex GenerateContentRequest.
- Remove generateContentStream reference from JSDoc comments in Gemini v1beta.

### Scenarios Tested
- Ran unit tests in spec/v2/providers/ai.spec.ts
- Ran npm test and npm run format

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the AI provider webhooks by removing the generic Regional option and regionalWebhook configurations from WebhookOptions, beforeGenerateContent, and afterGenerateContent. It also cleans up related tests, unused imports, and updates type definitions for Gemini and Vertex AI. Feedback was provided regarding a redundant definition of tools and toolConfig in GenerateContentRequest within the Vertex AI types, as these are already inherited from BaseModelParams.

Comment thread src/v2/providers/ai/types/vertex/v1beta1/index.ts
# Conflicts:
#	src/v2/providers/ai/index.ts
#	src/v2/providers/ai/types/gemini/v1beta/index.ts

@ajperel ajperel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It's weird to have "relnote:" repeated with different messages at the top and bottom of your PR description. Maybe best to have it in only one place though I'm not too fussed on whether it's the top or the bottom. I would have done the bottom since it looks git-footer like.

Comment thread spec/v2/providers/ai.spec.ts Outdated

it("should allow global webhooks to specify a single location", () => {
it("should allow webhooks to specify a single region", () => {
ai.beforeGenerateContent({ region: "us-central1" }, () => {});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we'd benefit from the test verifying that region is correctly populated in the the Endpoint object after this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +402 to +399
* the stream is done.
* Individual response from {@link GenerativeModel.generateContent}.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The {@link} here would cause the same issue as it did earlier. The api-documenter is unable to resolve it and that leaves broken sentences in the docgen files.

We might want to put it in just bacticks like *Individual response from generateContent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* the stream is done.
* Individual response from {@link GenerativeModel.generateContent}.
* Individual response from `generateContent`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@marb2000 marb2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. In sync with we we talked internally

@inlined
inlined merged commit 78f884e into master Aug 26, 2026
26 checks passed
@inlined
inlined deleted the fal-feedback branch August 26, 2026 06:03
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.

6 participants