欢迎光临
我们一直在努力

Google Gemini API error: “The response is blocked due to safety reason.“ although I set the harm...

题意:

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());

赞(0)
未经允许不得转载:171主机测评 » Google Gemini API error: “The response is blocked due to safety reason.“ although I set the harm...
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址