Interaction.outputText() always returns Optional.empty() (SDK-computed field is never populated)
Los mantenedores suelen responder en 1 día
@hemasekhar-p ya está trabajando en esto.
Desde el 5/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Environment details
- SDK version:
com.google.genai:google-genai:1.73.0(also reproducible onmain) - Java version: 21 / 25
Problem description
com.google.genai.gaos.models.interactions.Interaction.outputText() is documented as an SDK-populated convenience property:
/**
* Concatenated text from the last model output in response to the current request.
*
* <p>Note: this is added by the SDK.
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("output_text")
private String outputText;
However, the Gemini Interactions REST API does not return an "output_text" field in the JSON response payload (text blocks are returned inside steps -> ModelOutputStep -> TextContent). Because Interaction.java is generated by Speakeasy as a plain Jackson POJO and no SDK hook or getter computes outputText from steps, interaction.outputText() always returns Optional.empty().
(The same appears to apply to outputAudio(), outputImage(), and outputVideo() on Interaction.)
Steps to reproduce
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
public class Repro {
public static void main(String[] args) {
try (Client client = new Client()) {
CreateModelInteraction request =
CreateModelInteraction.builder()
.model("gemini-2.5-flash")
.input(InteractionsInput.of("Tell me a short joke."))
.build();
Interaction interaction =
client.interactions
.create(CreateInteractionRequestBody.of(request))
.interaction()
.orElseThrow();
// Prints Optional.empty even though interaction.steps() contains a ModelOutputStep with TextContent
System.out.println("outputText: " + interaction.outputText());
}
}
}
Current workaround
Callers have to manually traverse interaction.steps(), unwrap Step.value(), match ModelOutputStep, iterate its content(), unwrap Content.value(), and concatenate TextContent.text():
StringBuilder sb = new StringBuilder();
interaction.steps().ifPresent(steps -> {
for (var step : steps) {
if (step.value() instanceof ModelOutputStep modelOutput) {
modelOutput.content().ifPresent(contents -> {
for (var content : contents) {
if (content.value() instanceof TextContent textContent) {
textContent.text().ifPresent(sb::append);
}
}
});
}
}
});
Expected behavior
interaction.outputText() should return the concatenated text from the last ModelOutputStep in interaction.steps() (either computed lazily in Interaction.outputText() when this.outputText == null, or populated via a Speakeasy AfterSuccess hook in SDKHooks), matching the Javadoc contract ("Concatenated text from the last model output in response to the current request. Note: this is added by the SDK.").
- Lenguaje dominante
- Java
- Estrellas
- 398
- Forks
- 126
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 71
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleapis/java-genai
-
ResponseStream.close() can block on the reader lock before closing the HTTP responsePosiblemente ocupada @hirematha la tomó hoy. Abiertopriority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
googleapis/java-genai#1372 ·
Los mantenedores suelen responder en 1 día
-
Interactions API: GaosClientException.getMessage() only returns "400 . API error occurred" and omits the server error detailsPosiblemente ocupada @hemasekhar-p la tomó hace 25 días. Abiertopriority: p2 type: bug
googleapis/java-genai#1282 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Interactions API: store(false) omits "id", breaking Interaction and InteractionCompletedEvent deserializationPosiblemente ocupada @hemasekhar-p la tomó hace 25 días. Abiertopriority: p2 type: bug
googleapis/java-genai#1281 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Gen AI with structured output - `propertyOrdering` in Python vs. Java implementationsPosiblemente ocupada @hemasekhar-p la tomó hace 79 días. Abiertopriority: p3 type: feature request
googleapis/java-genai#1169 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Live API: no way to observe session close or connection errors after setupPosiblemente ocupada @hemasekhar-p la tomó hace 88 días. Abiertopriority: p3 type: feature request
googleapis/java-genai#1153 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de googleapis/java-genai
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aws/context-ontology-accelerator#325 ·
Los mantenedores suelen responder en 1 día
-
The README tells to run `mvn jeo:disassemble`, which fails with `No plugin found for prefix 'jeo'`Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
objectionary/jeo-maven-plugin#1938 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
oVirt/ovirt-engine#1219 ·
Los mantenedores suelen responder en 1 día
-
pending:code-area pending:issue-category to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area:core bug priority:p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aomarai/minecraft-mcp#247 ·
Los mantenedores suelen responder en 1 día