Conserte esse codego para min @Override public GeckoResult<PromptResponse>…
- User
Conserte esse codego para min @Override public GeckoResult onFilePrompt(GeckoSession session, FilePrompt prompt) { // Your existing code to start the file chooser intent Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("/"); intent.addCategory(Intent.CATEGORY_OPENABLE); currentFilePrompt = prompt; filePromptFuture = new CompletableFuture<>(); startActivityForResult(intent, FILE_UPLOAD_REQUEST_CODE); // Create a new GeckoResult GeckoResult geckoResult = new GeckoResult<>(); // When the CompletableFuture is completed, complete the GeckoResult filePromptFuture.whenComplete((result, throwable) -> { if (throwable != null) { // Complete the GeckoResult exceptionally if there is a throwable geckoResult.completeExceptionally(throwable); } else { // Otherwise, complete it with the result PromptResponse result = geckoResult.future.get();
geckoResult.complete(result); } }); return geckoResult; } - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.