-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal/WIP: action interface refactoring #331
base: main
Are you sure you want to change the base?
Conversation
I see at least three things going on here:
|
Actually I'm not going to fix s/Candidate/GenerateResponseChunk/ just yet because it will result in a merge mess with #326, so let's resolve that first. |
Just reading the JS again... you have something like
which means the same thing as in Go: ModelAction is just another name for the type on the right-hand side. |
I know enough Go to be dangerous... I'm at peak dangerous! :) My main motivation is make sure dynamic registry lookup is super efficient with minimal overhead. |
The problem I'm trying to solve is that the actions defined and registered in the registry are not the same thing as what is being returned to the user. Actions are getting rewrapped in generator interface which creates two tiered type system and unnecessary steps when going from one to the other.
This refactoring proposal (demonstrated on Generator but applies to all other action types) defines a single type definition for GeneratorAction which is being stored in the registry and being returned by
LookupGeneratorAction
and passed into ai.Generate, etc. This makesLookupGeneratorAction
very lightweight.