-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add tests for tools #209
Add tests for tools #209
Conversation
Tools working with gpt and claude models
befda44
to
006cc1d
Compare
006cc1d
to
de0218f
Compare
return response | ||
|
||
if self.llm_provider == "openrouter": | ||
# TODO investigate the transform parameter https://openrouter.ai/docs#transforms |
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.
You can remove already this comment
): | ||
results.append(url) | ||
except Exception: | ||
pass | ||
unique_results = list(set(results)) |
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.
what if all queries fail and you have no urls?
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.
Not they ever all fail
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.
I haven't seen it happen at least
|
||
|
||
def extract_texts(urls: List[str], num_words: Optional[int] = None) -> List[Document]: | ||
"""Extract texts from URLs with improved error handling, excluding failed URLs.""" | ||
extracted_texts = [] |
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.
if the list of urls is empty then there is nothing to batch, you could return an empty list and avoid the loop
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.
Would this make a difference if the loop is for len(urls).
I'm going to leave this out for now for code clarity since I don't think the list is ever empty.
|
||
|
||
class TestPredictionCOT(BaseToolTest): | ||
"""Test Prediction RAG.""" |
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.
I guess you mean Test Prediction COT
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.
why deleted?
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.
The whole tool has been deleted. Claude can now be used in prediction_request_rag.
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
This PR adds tests for tools.
To run the tests, you can use:
or alternatively: