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

DOC: Missing details about credentials requirements of AskNewsAPIWrapper #29472

Open
2 tasks done
arslaan5 opened this issue Jan 29, 2025 · 1 comment
Open
2 tasks done
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder

Comments

@arslaan5
Copy link

URL

https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.asknews.AskNewsAPIWrapper.html#asknewsapiwrapper

Checklist

  • I added a very descriptive title to this issue.
  • I included a link to the documentation page I am referring to (if applicable).

Issue with current documentation:

I faced an issue of missing credentials like 'Client_id' and 'secret_key' while working on a project. I was trying to use the AskNews search tool but referring to the documentation leads me to the below error:

pydantic_core._pydantic_core.ValidationError: 1 validation error for AskNewsAPIWrapper Value error, Did not find asknews_client_id, please add an environment variable ASKNEWS_CLIENT_ID which contains it, or pass asknews_cliens it, or pass asknews_client_id as a named parameter. [type=value_error, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.10/v/value_error

I was referring to https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.asknews.AskNewsAPIWrapper.html#asknewsapiwrapper

Idea or request for content:

To solve this error I headed to the asknews official website and there I found that it is required to use the "client_id" and "secret_key" which is available under the developer section of the asknews website.

@dosubot dosubot bot added the 🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder label Jan 29, 2025
@keenborder786
Copy link
Contributor

You need to use the api wrapper as following:

from langchain_community.utilities.asknews import AskNewsAPIWrapper


ask_new_api = AskNewsAPIWrapper(asknews_client_id="xxxx", asknews_client_secret="xxxxxx")
print(ask_new_api.search_news("what is AI?"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
Projects
None yet
Development

No branches or pull requests

2 participants