Skip to content

Conversation

@xavidop
Copy link
Contributor

@xavidop xavidop commented Dec 22, 2025

Description here... Help the reviewer by:

  • linking to an issue that includes more details
  • if it's a new feature include samples of how to use the new feature
  • (optional if issue link is provided) if you fixed a bug include basic bug details

Checklist (if applicable):

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @xavidop, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request marks a significant expansion of the Genkit framework by introducing a full-fledged Java SDK. It provides Java developers with the necessary tools and abstractions to seamlessly integrate AI capabilities into their applications, covering everything from model interaction and tool orchestration to advanced features like Retrieval Augmented Generation (RAG), evaluation workflows, and stateful conversational experiences. The new SDK is designed with observability in mind, leveraging OpenTelemetry for comprehensive tracing and metrics.

Highlights

  • Genkit Java SDK Introduction: This pull request introduces the foundational Java SDK for Genkit, enabling Java developers to build AI-powered applications directly within the Genkit framework.
  • Core AI Abstractions: The new SDK includes comprehensive AI abstractions for models, tools, embedders, retrievers, prompts, and agents, providing a unified API for interacting with various AI capabilities.
  • Evaluation Framework: A robust evaluation framework has been added, allowing developers to define custom evaluators, manage datasets, run evaluations, and store results to assess AI output quality.
  • Session Management: The SDK now supports stateful multi-turn conversations through a session management system, including chat history persistence and agent handoff capabilities.
  • Observability Integration: Built-in OpenTelemetry integration provides detailed tracing and metrics for all Genkit actions, offering deep insights into application performance and AI interactions.
  • Project Structure and Tooling: The project structure has been updated to accommodate Java modules, including new Maven POM files, and genkit-tools now detects Java project roots (Maven/Gradle).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/java.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a massive and impressive amount of work: the initial implementation of the Genkit Java SDK. The overall architecture is well-structured, with clear separation of concerns between the core, ai, telemetry, session, and evaluation packages. The use of core abstractions like Action and Registry, and patterns like Plugin for extensibility, lays a strong foundation. The inclusion of advanced features like multi-agent sessions, human-in-the-loop interrupts, and comprehensive telemetry from the start is commendable. The code is generally clean, well-documented, and follows good Java practices. I've found a couple of issues related to JSON schema definitions that need to be addressed, but otherwise, this is an excellent contribution.

Comment on lines 125 to 158
public Map<String, Object> getInputSchema() {
// Define the input schema for embedders
// This follows the EmbedRequestSchema from genkit-tools
Map<String, Object> schema = new HashMap<>();
schema.put("type", "object");

Map<String, Object> properties = new HashMap<>();

// input: array of documents
Map<String, Object> inputProp = new HashMap<>();
inputProp.put("type", "array");
Map<String, Object> itemSchema = new HashMap<>();
itemSchema.put("type", "object");
Map<String, Object> itemProps = new HashMap<>();
Map<String, Object> textProp = new HashMap<>();
textProp.put("type", "string");
textProp.put("description", "Text content to embed");
itemProps.put("text", textProp);
itemSchema.put("properties", itemProps);
inputProp.put("items", itemSchema);
inputProp.put("description", "Array of documents to embed");
properties.put("input", inputProp);

// options: optional configuration
Map<String, Object> optionsProp = new HashMap<>();
optionsProp.put("type", "object");
optionsProp.put("description", "Optional embedding configuration");
properties.put("options", optionsProp);

schema.put("properties", properties);
schema.put("required", new String[]{"input"});

return schema;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The JSON schema defined for the input of the Embedder action appears to be incorrect. The schema describes the input as {"input": [{"text": "..."}]}, but the EmbedRequest class expects a structure closer to {"input": [{"content": [{"text": "..."}]}]} based on the Document and Part class definitions. This mismatch will likely cause deserialization errors when the action is invoked with JSON, for example from the Dev UI.

The schema should be updated to accurately reflect the structure of EmbedRequest containing a list of Document objects. The schema defined in Indexer.java for its documents property could be a good reference.

Map<String, Object> numberItem = new HashMap<>();
numberItem.put("type", "number");
embeddingArrayProp.put("items", numberItem);
embeddingProps.put("embedding", embeddingArrayProp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The JSON schema for the output of the Embedder action has an incorrect property name. The schema uses "embedding" for the vector property, but the EmbedResponse.Embedding class uses "values" and is annotated with @JsonProperty("values"). This will lead to issues with schema validation and client-side tooling that relies on the schema. The property name in the output schema should be changed from "embedding" to "values" to match the class definition.

Suggested change
embeddingProps.put("embedding", embeddingArrayProp);
embeddingProps.put("values", embeddingArrayProp);
@xavidop
Copy link
Contributor Author

xavidop commented Dec 23, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config docs Improvements or additions to documentation dotprompt js root tooling

1 participant