|
@@ -43,9 +43,9 @@ public class GeminiGenerateContentAction implements Action {
|
|
|
@Override
|
|
|
public String execute(ActionParam param) {
|
|
|
Integer type = param.getType();
|
|
|
-// ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
|
-// int index = random.nextInt(apiKeyList.size());
|
|
|
-// String apiKey = apiKeyList.get(index);
|
|
|
+ ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
|
+ int index = random.nextInt(apiKeyList.size());
|
|
|
+ String apiKey = apiKeyList.get(index);
|
|
|
GeminiParam geminiParam = new GeminiParam();
|
|
|
geminiParam.setType(type);
|
|
|
geminiParam.setPrompt(param.getPrompt());
|
|
@@ -54,7 +54,7 @@ public class GeminiGenerateContentAction implements Action {
|
|
|
|| Objects.equals(ContentTypeEnum.VTT.getValue(), type)) {
|
|
|
geminiParam.setMediaUrl(param.getInput());
|
|
|
}
|
|
|
-// geminiParam.setApiKey(apiKey);
|
|
|
+ geminiParam.setApiKey(apiKey);
|
|
|
geminiParam.setModel(MODEL);
|
|
|
geminiParam.setTemperature(TEMPERATURE);
|
|
|
return RetryUtil.executeWithRetry(() -> {
|