Skip to content

Conversation

@martinemde
Copy link
Contributor

This refactoring makes it possible to support more providers than the current two (openrouter and openai) without modifying the existing interface, fallback behavior, or expectations for consumers.

@martinemde martinemde force-pushed the martinemde/refactor-to-allow-other-providers branch from 9a68ae9 to ed603c8 Compare August 17, 2025 04:34
This refactoring makes it possible to support more providers than the
current two (openrouter and openai) without modifying the existing
interface, fallback behavior, or expectations for consumers.
@martinemde martinemde force-pushed the martinemde/refactor-to-allow-other-providers branch from ed603c8 to 6518dcc Compare August 17, 2025 04:35
@martinemde
Copy link
Contributor Author

martinemde commented Aug 18, 2025

This was inspired by the need for raix-bedrock, which I just published. It can work without this, but I think the API is cleaner with this change.

@martinemde
Copy link
Contributor Author

martinemde commented Aug 21, 2025

One reason not to merge this is that it doesn't go far enough.

The interface inside of raix-bedrock is not pretty. I have to do a lot of work to change formats to use the AWS bedrock gem, then a lot more work to change back.

It would be great if we moved enough of the complexity so that the interface was more like "register tool, tool called, chat completion, completion result" in an abstract way so that the OpenAI response structure and the bedrock structure was hidden into the OpenAI provider and bedrock provider. Right now, I only normalized the call sites but none of the params or return formats.

I'll take another stab at this when I have a moment. Let me know if you don't think it's worth the effort or you wouldn't want to merge it.

@martinemde martinemde closed this Nov 9, 2025
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