Skip to content

google-genai: simplify monkey patched code to not need to handle dict cases#4541

Closed
aabmass wants to merge 1 commit into
open-telemetry:mainfrom
aabmass:push-zrqpyzyyxopm
Closed

google-genai: simplify monkey patched code to not need to handle dict cases#4541
aabmass wants to merge 1 commit into
open-telemetry:mainfrom
aabmass:push-zrqpyzyyxopm

Conversation

@aabmass
Copy link
Copy Markdown
Member

@aabmass aabmass commented May 6, 2026

Description

Refactors opentelemetry-instrumentation-google-genai by instantiating the SDK's own Pydantic models (_GenerateContentParameters) early in the wrappers.

This coerces user inputs (config and contents) immediately, allowing us to completely eliminate complex recursive dict-handling logic, redundant type-checking helpers, and obsolete imports (ToolUnionDict, ToolListUnionDict, ContentUnionDict) across the package. Legacy prompt logging formats are preserved to maintain backwards compatibility.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)?

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Existing tests passing

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@aabmass aabmass added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 6, 2026
@github-actions github-actions Bot added the gen-ai Related to generative AI label May 6, 2026
@aabmass aabmass force-pushed the push-zrqpyzyyxopm branch from f1fa068 to 7a9006f Compare May 6, 2026 21:56
@aabmass aabmass closed this May 8, 2026
@aabmass aabmass deleted the push-zrqpyzyyxopm branch May 8, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gen-ai Related to generative AI Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant