refactor: Replace interface{} with any and add multimodal type support#232
Merged
refactor: Replace interface{} with any and add multimodal type support#232
Conversation
…ckages Reorganized the providers package to improve code organization and maintainability: - Created providers/constants/ package for all constants (breaks import cycles) - Created providers/types/ for generated types and message helpers - Created providers/registry/ for provider configuration and registry - Created providers/core/ for provider implementation infrastructure - Created providers/client/ for HTTP client abstraction - Created providers/routing/ for model routing logic - Created providers/transformers/ for provider-specific response transformers This structure provides clear separation of concerns and makes the codebase easier to navigate. The constants package has no dependencies, which breaks the circular import dependencies that existed previously. Updated all imports across 17+ files including tests, API routes, middleware, config, and code generation templates. Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Use naming imports for non-builtin packages and group them for clarity - from library down to internal packages Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
- Add named imports to constants, transformers, and registry templates - Add generation comment to client and transformer templates - Regenerate all provider files with consistent import style Signed-off-by: Eden Reich <eden.reich@gmail.com>
Remove unused code generation functions that were replaced by oapi-codegen: - Remove GenerateCommonTypes() function (178 lines) - Remove ProvidersCommonTypes CLI case handler - Remove unused helper functions generateType() and generateTag() These functions were used to generate providers/common_types.go with custom templates, but this has been completely replaced by oapi-codegen which now generates providers/types/common_types.go from the OpenAPI spec. Verification: - task generate completes successfully - All tests pass - No change in generated output Signed-off-by: Eden Reich <eden.reich@gmail.com>
ig-semantic-release-bot bot
added a commit
that referenced
this pull request
Jan 23, 2026
## [0.23.1](v0.23.0...v0.23.1) (2026-01-23) ### ♻️ Improvements * Replace interface{} with any and add multimodal type support ([#232](#232)) ([bfae43d](bfae43d))
Contributor
|
🎉 This PR is included in version 0.23.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates Go type definitions from
interface{}toanyfor Go 1.18+ compatibility. Adds support for multimodal message content with new types for text and image content parts. Includes spelling dictionary updates for new AI providers.Changes
Type Modernization
interface{}occurrences withanythroughout the codebaseinternal/codegen/codegen.goto handleanytype properlyinternal/openapi/openapi.goMultimodal Support
MessageContent,ContentPart,TextContentPart,ImageContentPart, andImageURLtypes inproviders/common_types.gooneOfschemas to handle polymorphic message contentopenapi.yamlto support multimodal message formatsSpelling Updates
.cspell.jsonBenefits
anytype for better readability and type safetyoneOfsupportTechnical Details