题意:
Google Gemini API 错误:\”由于安全原因,响应已被拦截。\”尽管我已将伤害内容拦截阈值设置为 BLOCK_NONE。
问题背景:
I have this piece of code: 有以下代码片段:
public static String simpleQuestion(String projectId, String location, String modelName) throws Exception {
// Initialize client that will be used to send requests.
// This client only needs to be created once, and can be reused for multiple requests.
try (VertexAI vertexAI = new VertexAI(projectId, location)) {
String output;
GenerativeModel model = new GenerativeModel(modelName, vertexAI);
model.setGenerationConfig(GenerationConfig.newBuilder().build());


