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

fix: replace assert with ValueError for llm validation #884

Closed
wants to merge 1 commit into from

Conversation

iw4p
Copy link

@iw4p iw4p commented Apr 20, 2024

It's absolutely better to use raise ValueError instead of assert. (or maybe someone has a better idea)
If you agree for the next refactors I can implement this method

def check_llm(self):
    if self.llm is None:
        raise ValueError("LLM must be set before using this method")

So by using this method whenever we need to use llm, we can easily call it before that line like
self.check_llm()

@jjmachan
Copy link
Member

jjmachan commented Nov 3, 2024

thanks a lot for the suggestion and the PR 🙂 ❤️. hopefully with #1558 we will be able to fix this but keeping it for v0.3 so as to not break anything

closing this for now but I'm really sorry we couldn't merge it 🙁 but at the same time thanks a million for taking the time to raise this, really grateful too and do checkout this form https://docs.google.com/forms/d/e/1FAIpQLSdM9FrrZrnpByG4XxuTbcAB-zn-Z7i_a7CsMkgBVOWQjRJckg/viewform - our way of saying thank you 🙂

@jjmachan jjmachan closed this Nov 3, 2024
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