-
Notifications
You must be signed in to change notification settings - Fork 117
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
[RFC] Add initial support for Genie #163
Comments
Hey @Udayk02 👋 Thanks for the interest in this feature; we can discuss how to go about this feature support here! Let me know what you think about it and, generally, if you have any comments on implementation~ Thanks 😊 |
To my understanding,
Going forward, we can introduce Please provide suggestions and a pipeline would be appreciated so that I will pitch in where I can 😄 Thanks! |
Hey @Udayk02,
Yes, that's accurate! That's exactly what we want
For the
Yes, every Genie should have a Currently, I'm preoccupied with the next Thanks! 😊 |
Sure! No problem. Looking forward to it! |
Just to mention here: adding to the |
Hey there, folks! 😄
We want to add support for a class called
Genie
that would allow for interfacing with generative LLMs or API calls to them inside Chonkie. This functionality is essential to add ContextualRefinery (#105) but not only that, it would be important for AgenticChunking, LumberChunking and other generative chunking approaches. These chunking approaches are usually more time-consuming but give higher-quality text chunks than rule-based chunking approaches, making them a nice addition to have!To support
Genie
, we would need aBaseGenie
class that would define what everyGenie
from there on should implement.Additionally, since
Genie
s are meant to be easy to "plug in" into theContextualRefinery
or other chunkers mentioned above, they should come with a supporting classLibrary
(which in turn would have it's ownBaseLibrary
to define what to implement).Each
Library
would hold a set of template prompts in the f-string format, along with some way to define what the f-string requires. (OFD)An additional utility method inside
Library
that can create a prompt based on the specific**kwargs
passed into them and the prompt name would be a nice addition to quickly see the prompt from the template.Generally, we would want the
Library
to come with set defaults, but in case the user wishes to change the prompt and the template for any action, we should allow them to do so by initializing aLibrary
, picking the category they want to set as, and passing it into theGenie
for it to interface with.Since Chonkie defines its tasks, whenever a new task is called that needs a Genie, we would add the necessary default prompts inside the
Library
based on our own tests so the user either get's a verified prompt or nothing at all. In case a prompt template is not present in theLibrary
it can throw an error saying something along the lines ofThis genie has no prompt defined for {task}; Add prompt or use a supported genie.
Generally, these are my current thoughts on the implementation of the
Genie
. Of course, open to discussions on it!Thanks! 😊
The text was updated successfully, but these errors were encountered: