Refactor IncludeContents in State to use internal type - #2
Refactor IncludeContents in State to use internal type#2google-labs-jules[bot] wants to merge 5 commits into
Conversation
Defines a new `IncludeContents` type and constants in `internal/llminternal` and updates the `State` struct to use it. This improves type safety and addresses a TODO comment. Internal Refs: - Defined `IncludeContents` type and constants in `internal/llminternal/agent.go`. - Updated `State.IncludeContents` field type. - Updated `llmagent.New` to cast config value to internal type. - Updated `contents_processor.go` to use internal constant.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
While introducing this new IncludeContents type for better type safety is a good move, it has resulted in duplication of the type and its constants, as they are also defined in agent/llmagent/llmagent.go. To improve maintainability and avoid potential inconsistencies, it would be better to have a single source of truth. You could define the type and constants only here in the internal package, and then use a type alias in the public agent/llmagent package. For example, in agent/llmagent/llmagent.go, you could have: import "google.golang.org/adk/internal/llminternal" type IncludeContents = llminternal.IncludeContents const ( |
Thank you for the review. I have updated |
Updated `agent/llmagent/llmagent.go` to use a type alias for `IncludeContents` that points to the internal type in `internal/llminternal`. This avoids code duplication while maintaining the public API. Internal Refs: - Changed `IncludeContents` in `llmagent.go` to be an alias. - Updated constants to reference `llminternal` constants.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: João Westerberg <baptmont@gmail.com>
Refactor IncludeContents in State to use internal type
PR created automatically by Jules for task 3281018378544379227 started by @sheing-google