Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor makeRequest #87

Merged
merged 4 commits into from
Apr 8, 2024
Merged

Refactor makeRequest #87

merged 4 commits into from
Apr 8, 2024

Conversation

hsubox76
Copy link
Collaborator

@hsubox76 hsubox76 commented Apr 5, 2024

Tests on makeRequest relied on stubbing globalThis.fetch which seems to no longer be possible as of Node 20.12.0. This was failing silently and causing the tests to make live backend calls.

Extracting an internal function that explicitly passes in a fetch function as well as further modularizing various parts of request construction for better architecture (e.g., methods calling both RequestUrl and makeRequest seems unnecessarily redundant). This mirrors changes in the Firebase Vertex SDK under development.

Copy link

changeset-bot bot commented Apr 5, 2024

🦋 Changeset detected

Latest commit: bdf5544

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@google/generative-ai Patch

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

@hsubox76 hsubox76 merged commit 0931d2c into main Apr 8, 2024
3 checks passed
@hsubox76 hsubox76 deleted the ch-request-refactor branch April 8, 2024 16:31
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