rig icon indicating copy to clipboard operation
rig copied to clipboard

Feat/rig shared

Open mkranjac opened this issue 8 months ago • 2 comments

Relates to issue #434

Couple of notes:

  • Most of the crates have similar dependencies but with small variations on minor versions, using Workspace dependencies aims to simplify updates and removes redundant compilation. If you have any drawbacks with this approach I will revert it back to original.
  • Added fixtures for most commonly used mocks ( mostly for embeddings )
  • I named this crate rig-shared, at the moment it’s not ideal because it’s mostly for fixtures and common tools but if you have better alternative I will rename it
  • currently only AWS Bedrock crate is using this shared crate just for POC, if everything else is good I can refactor other crates.

mkranjac avatar May 02 '25 12:05 mkranjac

@0xMochan @joshua-mo-143 please let me know if this is correct approach

mkranjac avatar May 02 '25 12:05 mkranjac

TBH, i'm not too fond of a crate (even if internal) that is only used to reduce duplication among examples. the examples' duplications come from the fact that we lack a proper integration testing suite. internally, we've discussed introducing and rolling some examples as apart of said suite on running against commits against our release branches. since these only get bumped on the PRs that get merged (+ we can always cancel if needed), it'll ensure that we don't burn too many credits in testing.

Then, we can skim through and try to isolate examples that actually highlight a specific use-case (rather than just duplicating every example for every provider). There's also a case of some examples that highlight openai-compatible services that could be collapsed into a single example, though I'm not entirely sure what that would look like.


If there is an examples crate in the wild that does use a shared / example crate as a form of reducing duplication, i'd love to get a look as an alternative perspective on this.

0xMochan avatar May 26 '25 00:05 0xMochan

I agree with @0xMochan here.

On the other hand, we could really do with slimming down the examples list as there are now 80(!!!!) items in the examples folder. It's likely we will need to do some preliminary work first to figure out what examples we actually need to keep for integration testing and which ones we should either keep in the rig-core examples or turn into a cookbook of some kind.

joshua-mo-143 avatar Jun 19 '25 23:06 joshua-mo-143