sessions/fall24/spring-ai-quotes-llm-in-gke/src/main/java/com/example/quotes/domain/QuoteLLMInVertexService.java [91:105]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static String getOauth2Token(String target) throws IOException {
    // Load credentials from the environment (default)
    GoogleCredentials credentials = GoogleCredentials.getApplicationDefault();

    // Refresh if necessary
    if (credentials.getAccessToken() == null || credentials.getAccessToken().getExpirationTime().before(new Date())) {
      credentials.refresh();
    }

    // Get the access token
    AccessToken accessToken = credentials.getAccessToken();
    System.out.println("Generated short-lived Access Token: " + accessToken.getTokenValue());

    return accessToken.getTokenValue();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



sessions/next25/quotes-llm/src/main/java/com/example/quotes/domain/QuoteLLMInVertexService.java [85:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static String getOauth2Token(String target) throws IOException {
    // Load credentials from the environment (default)
    GoogleCredentials credentials = GoogleCredentials.getApplicationDefault();

    // Refresh if necessary
    if (credentials.getAccessToken() == null || credentials.getAccessToken().getExpirationTime().before(new Date())) {
      credentials.refresh();
    }

    // Get the access token
    AccessToken accessToken = credentials.getAccessToken();
    System.out.println("Generated short-lived Access Token: " + accessToken.getTokenValue());

    return accessToken.getTokenValue();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ai-patterns/spring-ai-function-calling/src/main/java/services/gemini/FunctionCallingApplication.java [196:210]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	private static String getOauth2Token(String target) throws IOException {
	    // Load credentials from the environment (default)
	    GoogleCredentials credentials = GoogleCredentials.getApplicationDefault();

	    // Refresh if necessary
	    if (credentials.getAccessToken() == null || credentials.getAccessToken().getExpirationTime().before(new Date())) {
	        credentials.refresh();
	    }

	    // Get the access token
	    AccessToken accessToken = credentials.getAccessToken();
	    System.out.println("Access Token: " + accessToken.getTokenValue());

	    return accessToken.getTokenValue();
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ai-patterns/spring-ai-quotes-llm-in-gke/src/main/java/com/example/quotes/domain/QuoteLLMInVertexService.java [91:105]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static String getOauth2Token(String target) throws IOException {
    // Load credentials from the environment (default)
    GoogleCredentials credentials = GoogleCredentials.getApplicationDefault();

    // Refresh if necessary
    if (credentials.getAccessToken() == null || credentials.getAccessToken().getExpirationTime().before(new Date())) {
      credentials.refresh();
    }

    // Get the access token
    AccessToken accessToken = credentials.getAccessToken();
    System.out.println("Generated short-lived Access Token: " + accessToken.getTokenValue());

    return accessToken.getTokenValue();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ai-patterns/langchain4j-function-calling-openai-api/src/main/java/services/gemini/Langchain4JFunctionCallingApplication.java [109:123]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	private static String getToken(String target) throws IOException {
		// Load credentials from the environment (default)
		GoogleCredentials credentials = GoogleCredentials.getApplicationDefault();

		// Refresh if necessary
		if (credentials.getAccessToken() == null || credentials.getAccessToken().getExpirationTime().before(new Date())) {
			credentials.refresh();
		}

		// Get the access token
		AccessToken accessToken = credentials.getAccessToken();
		System.out.println("Access Token: " + accessToken.getTokenValue());

		return accessToken.getTokenValue();
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ai-patterns/spring-ai-quotes/src/main/java/services/gemini/QuotesTestApplication.java [83:97]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	private static String getOauth2Token(String target) throws IOException {
		// Load credentials from the environment (default)
		GoogleCredentials credentials = GoogleCredentials.getApplicationDefault();

		// Refresh if necessary
		if (credentials.getAccessToken() == null || credentials.getAccessToken().getExpirationTime().before(new Date())) {
			credentials.refresh();
		}

		// Get the access token
		AccessToken accessToken = credentials.getAccessToken();
		System.out.println("Generated short-lived Access Token: " + accessToken.getTokenValue());

		return accessToken.getTokenValue();
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



