Skip to content
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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

ZeevRispler
Copy link
Contributor

Added some steps (chains)
changes to existing chains
use the init file in chains

Copy link
Contributor

@yonishelach yonishelach left a 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
Copy link
Contributor

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:

Suggested change
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):
Copy link
Contributor

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):
Copy link
Contributor

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):
Copy link
Contributor

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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

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.

2 participants