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

Update tavily_search_api.py #87

Merged
merged 5 commits into from
Oct 19, 2023

Conversation

SanskarTanwarShorthillsAI
Copy link
Collaborator

I replaced the ValueError exception with ImportError in the tavily_search_api.py file. This change enhances the exception handling when attempting to import the tavily package.
Previously, a ValueError was raised when the tavily package was not found during import. However, a more appropriate exception to raise in this case is ImportError, which is commonly used for import-related issues.
With this change, if the tavily package is not found, the script will now raise an ImportError with a clear error message instructing users to install the package using pip install tavily-python.
This update improves the code's readability and ensures that users are provided with accurate instructions when the required package is missing.
Please review the change at your convenience.
@ShorthillsAI

ShorthillsAI and others added 4 commits October 10, 2023 09:42
feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.
ValueError Must be ImportError
@ShorthillsAI ShorthillsAI force-pushed the master branch 2 times, most recently from 1c270f6 to 77fc2f7 Compare October 19, 2023 06:52
@ShorthillsAI ShorthillsAI merged commit ef53b51 into shorthills-ai:master Oct 19, 2023
30 checks passed
ShorthillsAI added a commit that referenced this pull request Dec 26, 2023
* Update tavily_search_api.py (#87)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* Update tavily_search_api.py

ValueError Must be ImportError

---------

Co-authored-by: Aashish Saini <[email protected]>

* Update faker_presidio_mapping.py (#93)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* Update faker_presidio_mapping.py

lambda was written twice, I have corrected the same

* Update base_moderation.py

Rectified input to input_text

---------

Co-authored-by: Aashish Saini <[email protected]>

* Logical and grammatical error in prompt_llm_parser.ipynb (#95)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* prompt_llm_parser.ipynb

---------

Co-authored-by: Aashish Saini <[email protected]>

* fixed index.mdx (#92)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* fixed index.mdx

Fixed grammatical error in file index.mdx.
Changed 'it's' to 'it is'.

I would like to emphasize that your feedback is immensely valuable to us and is truly treasured. We greatly appreciate your insights and input, as they help us improve and grow.

Gratitude
@baskaryan @hwchase17

---------

Co-authored-by: Aashish Saini <[email protected]>

* Updated debugging.md with grammatical corrections (#96)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* Updated debugging.md with grammatical corrections

"There's a number of callbacks" was grammatically incorrect and is replaced with "There are a...". There was a typographical error in the subheading. It was written as "set_vebose = True".

---------

Co-authored-by: Aashish Saini <[email protected]>

* Update baidu_qianfan_endpoint.py (#94)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* Update baidu_qianfan_endpoint.py

Import Error was used as Exception, but value error was raised so changed ValueError to ImportError

* Update databricks.py

Updated the raised ValueError to ImportError

---------

Co-authored-by: Aashish Saini <[email protected]>

* Update faker_presidio_mapping.py

Fixing Lint Issues

* Update faker_presidio_mapping.py

* Update faker_presidio_mapping.py

* Update faker_presidio_mapping.py

* Update faker_presidio_mapping.py

* Update faker_presidio_mapping.py

* Update faker_presidio_mapping.py

* Update faker_presidio_mapping.py

* simplified a sentence, updated walkthrough.ipynb (#100)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* simplified a sentence in walkthrough.ipynb

a minute adjustment in the sentence to make the message being conveyed more understandable.

---------

Co-authored-by: Aashish Saini <[email protected]>

* Update paul_graham_essay.txt (Grammatical error) (#91)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* Update paul_graham_essay.txt (Grammatical error)

Replaced "till" with "until." on line "The book, On Lisp, wasn't published till 1993, but I wrote much of it in grad school."

---------

Co-authored-by: Aashish Saini <[email protected]>

* Update CONTRIBUTING.md (#98)

Change the 'c' in 'Langchain' to 'C' to form 'LangChain.'
In the official documentation, it is written as 'LangChain.

* Updated xml_agent.ipynb. Missing Apostrophe added (#97)

There was a grammatical error. An apostrophe was missing in all the whats and it has been corrected to what's.

* Space missing (#90)

* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* space missing

The space between the words 'JSON' and 'Schema' was missing.

* Update interface.ipynb

---------

Co-authored-by: Aashish Saini <[email protected]>

* Update walkthrough.ipynb

* Update paul_graham_essay.txt

* Update CONTRIBUTING.md

* Update index.md

* Update CONTRIBUTING.md

---------

Co-authored-by: Sanskar Tanwar <[email protected]>
Co-authored-by: Aashish Saini <[email protected]>
Co-authored-by: UpneetShorthillsAI <[email protected]>
Co-authored-by: HarshGuptaShorthillsAI <[email protected]>
Co-authored-by: AdityaKalraShorthillsAI <[email protected]>
Co-authored-by: SakshiShorthillsAI <[email protected]>
Co-authored-by: AashiGuptaShorthillsAI <[email protected]>
Co-authored-by: ShamshadAhmedShorthillsAI <[email protected]>
AkshayTripathiShorthillsAI pushed a commit to AkshayTripathiShorthillsAI/langchain that referenced this pull request Jan 16, 2024
* Update modal.py

feat: Raise KeyError when 'prompt' key is missing in JSON response

This commit updates the error handling in the code to raise a KeyError when
the 'prompt' key is not found in the JSON response. This change makes the code
more explicit about the nature of the error, helping to improve clarity and
debugging.

* Update tavily_search_api.py

ValueError Must be ImportError

---------

Co-authored-by: Aashish Saini <[email protected]>
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