Skip to content

Refactor IncludeContents in State to use internal type - #2

Draft
google-labs-jules[bot] wants to merge 5 commits into
mainfrom
refactor-include-contents-type
Draft

Refactor IncludeContents in State to use internal type#2
google-labs-jules[bot] wants to merge 5 commits into
mainfrom
refactor-include-contents-type

Conversation

@google-labs-jules

Copy link
Copy Markdown

Refactor IncludeContents in State to use internal type


PR created automatically by Jules for task 3281018378544379227 started by @sheing-google

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.
@google-labs-jules

Copy link
Copy Markdown
Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@sheing-google

Copy link
Copy Markdown
Owner

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 (
IncludeContentsNone = llminternal.IncludeContentsNone
IncludeContentsDefault = llminternal.IncludeContentsDefault
)
This would make internal/llminternal the single source of truth and eliminate the duplicated code.

@google-labs-jules

Copy link
Copy Markdown
Author

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 (
IncludeContentsNone = llminternal.IncludeContentsNone
IncludeContentsDefault = llminternal.IncludeContentsDefault
)
This would make internal/llminternal the single source of truth and eliminate the duplicated code.

Thank you for the review. I have updated agent/llmagent/llmagent.go to use a type alias to llminternal.IncludeContents and point constants to llminternal constants, removing the duplication.

google-labs-jules Bot and others added 4 commits December 4, 2025 23:22
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant