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

Implemented the Support Application Default Credentials #388

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akhileshdasari2004
Copy link

The updated search-grounding.ts file integrates Application Default Credentials (ADC) support for authenticating Google Search API requests. It includes:

ADC Authentication: A utility function (getAuthenticatedClient) fetches credentials using ADC or falls back to environment variables if ADC is unavailable.

Type Safety: Explicit type handling ensures the authenticated client is either a JWT or OAuth2Client.

Error Handling: Proper error handling is added for failed authentication.

Service Class: A GoogleSearchRetrievalService class initializes the authenticated client and provides a method (fetchData) to interact with the Google Search API.

Linting Fixes: Addressed ESLint errors by ensuring promises are handled, adding return types, and avoiding the any type.

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