-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Chains] Copilot steps #33
base: main
Are you sure you want to change the base?
Conversation
… inheriting it, for now summrize and refine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! very nice work on the GeneralLLMInvoke
class, make the other classes look very simple to use.
Don't forget to run make fmt lint
from .sentiment_analysis import SentimentAnalysisStep | ||
from .base import HistorySaver, SessionLoader, ChainRunner | ||
from .retrieval import MultiRetriever | ||
from .llm_invoke import RefineQuery, Summerize, GeneralLLMInvoke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to use absolute imports than relative imports, for example:
from .llm_invoke import RefineQuery, Summerize, GeneralLLMInvoke | |
from genai_factory.chains.llm_invoke import RefineQuery, Summerize, GeneralLLMInvoke |
A step that classifies a given text into a list of possible classes. | ||
The classes must be provided in the classifier_classes parameter. | ||
""" | ||
def __init__(self, llm=None, prompt_template=None, classifier_classes=None, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add type hints and docstring that explain better each parameter, it will help the user
""" | ||
A step that generates a response to a given text based on the conversation history. | ||
Is the base class for all steps that require an llm invoke but with different prompts. | ||
""" | ||
def __init__(self, llm=None, prompt_template=None, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
|
||
|
||
class RefineQuery(GeneralLLMInvoke): | ||
def __init__(self, llm=None, prompt_template=None, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
""" | ||
|
||
class Summerize(GeneralLLMInvoke): | ||
def __init__(self, llm=None, prompt_template=None, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
Added some steps (chains)
changes to existing chains
use the init file in chains