GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - emergentmethods/asknews-python-sdk: Infusing news into any LLM with a single line of code

BranchesTags
Open more actions menu

Latest commit

 

History

605 Commits
605 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
asknews_sdk
asknews_sdk
 
 
cookbook
cookbook
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.gitlint
.gitlint
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Taskfile.yml
Taskfile.yml
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

AskNews Python SDK

Static Badge

Python SDK for the AskNews API.

Python support

Supported Python versions: 3.10–3.14.

Installation

pip install asknews

Usage

  • Use ask.news.search_news() for a fast, surgical, single-search lookup when you already know the keywords or entities and do not need iterative discovery.
  • Use DeepNews (ask.chat.get_deep_news() in this SDK) to attach your agent to deep, iterative research across news and other sources: finding and following leads, identifying unknown entities, and connecting evidence across sources.
from asknews_sdk import AskNewsSDK

ask = AskNewsSDK(
    api_key="<YOUR API KEY>",
    scopes=["news", "chat", "stories", "analytics"]
)

query = "NVIDIA earnings"

# Fast lookup: prompt-optimized news context for your LLM.
news_context = ask.news.search_news(query).as_string

# Iterative discovery across news and other sources.
research = ask.chat.get_deep_news(
    messages=[{"role": "user", "content": "Find and follow leads on AI chip supply risks."}],
    sources=["asknews", "google", "wiki"],
    engine="v1.5",
)
print(research.choices[0].message.content)

The API doesn't stop there, checkout the full set of recipes in the Cookbook showing off a wide range of endpoints:

  • /deepnews, a deep research agent that can explore the new knowledge graph, X, Reddit, Google, Wikipedia and more to build forecasts, reports, analytics, and anything else your system may need.
  • /websearch, search the web and get back an LLM distillation of all the relevant web pages
  • /wikipedia, high fidelity search on the Wikipedia corpus (open-sourced, https://huggingface.co/datasets/EmergentMethods/en_qdrant_wikipedia)
  • /stories, high level event tracking and state of the art article clustering

Find full docs at the AskNews API documentation.

Support

Join our Discord to see what other people are building, and to get support with your projects.

About

Infusing news into any LLM with a single line of code

docs.asknews.app

Topics

llmnewsnewsapinlprag

Resources

Readme
MIT license
Activity
Custom properties

Stars

9 stars

Watchers

3 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.