Dappier는 모든 LLM 또는 Agentic AI를 신뢰할 수 있는 출처의 실시간, 권리가 확보된 독점 데이터에 연결하여 AI를 모든 분야의 전문가로 만들어줍니다. 우리의 특화된 모델에는 실시간 웹 검색, 뉴스, 스포츠, 금융 주식 시장 데이터, 암호화폐 데이터, 그리고 프리미엄 퍼블리셔의 독점 콘텐츠가 포함됩니다. marketplace.dappier.com의 마켓플레이스에서 다양한 데이터 모델을 탐색해보세요. Dappier는 LangChain과의 원활한 통합을 위해 최적화된 풍부하고, 프롬프트 준비가 완료된, 문맥적으로 관련성 있는 데이터 문자열을 제공합니다. 대화형 AI, 추천 엔진 또는 지능형 검색을 구축하든, Dappier의 LLM 독립적인 RAG 모델은 자체 검색 파이프라인을 구축하고 관리하는 복잡성 없이 검증되고 최신 데이터에 대한 액세스를 보장합니다.

DappierRetriever

이 문서는 Dappier retriever를 시작하는 데 도움이 됩니다. 모든 DappierRetriever 기능 및 구성에 대한 자세한 문서는 API reference를 참조하세요.

Setup

langchain-dappier를 설치하고 환경 변수 DAPPIER_API_KEY를 설정합니다.
pip install -U langchain-dappier
export DAPPIER_API_KEY="your-api-key"
또한 Dappier 사이트에서 생성할 수 있는 Dappier API 자격 증명을 설정해야 합니다. Dappier 마켓플레이스로 이동하여 지원되는 데이터 모델을 찾을 수 있습니다. 개별 쿼리에서 자동화된 추적을 원하는 경우, 아래 주석을 해제하여 LangSmith API 키를 설정할 수도 있습니다:
os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
os.environ["LANGSMITH_TRACING"] = "true"

Installation

이 retriever는 langchain-dappier 패키지에 있습니다:
pip install -qU langchain-dappier

Instantiation

  • data_model_id: str dm_으로 시작하는 데이터 모델 ID입니다. 사용 가능한 데이터 모델 ID는 다음에서 찾을 수 있습니다: Dappier 마켓플레이스
  • k: int 반환할 문서 수입니다.
  • ref: Optional[str] AI 추천이 표시되는 사이트 도메인입니다.
  • num_articles_ref: int 지정된 ref 도메인의 최소 기사 수입니다. 나머지는 RAG 모델 내의 다른 사이트에서 가져옵니다.
  • search_algorithm: Literal[ “most_recent”, “most_recent_semantic”, “semantic”, “trending” ] 기사 검색을 위한 검색 알고리즘입니다.
  • api_key: Optional[str] Dappier API와 상호 작용하는 데 사용되는 API 키입니다.
from langchain_dappier import DappierRetriever

retriever = DappierRetriever(data_model_id="dm_01jagy9nqaeer9hxx8z1sk1jx6")

Usage

query = "latest tech news"

retriever.invoke(query)
[Document(metadata={'title': 'Man shot and killed on Wells Street near downtown Fort Wayne', 'author': 'Gregg Montgomery', 'source_url': 'https://www.wishtv.com/news/indiana-news/man-shot-dies-fort-wayne-december-25-2024/', 'image_url': 'https://images.dappier.com/dm_01jagy9nqaeer9hxx8z1sk1jx6/fort-wayne-police-department-vehicle-via-Flickr_.jpg?width=428&height=321', 'pubdata': 'Thu, 26 Dec 2024 01:00:33 +0000'}, page_content='A man was shot and killed on December 25, 2024, in Fort Wayne, Indiana, near West Fourth and Wells streets. Police arrived shortly after 6:30 p.m. following reports of gunfire and found the victim in the 1600 block of Wells Street, where he was pronounced dead. The area features a mix of businesses, including a daycare and restaurants.\n\nAs of the latest updates, police have not provided details on the safety of the area, potential suspects, or the motive for the shooting. Authorities are encouraging anyone with information to reach out to the Fort Wayne Police Department or Crime Stoppers.'),
 Document(metadata={'title': 'House cat dies from bird flu in pet food, prompting recall', 'author': 'Associated Press', 'source_url': 'https://www.wishtv.com/news/business/house-cat-bird-flu-pet-food-recall/', 'image_url': 'https://images.dappier.com/dm_01jagy9nqaeer9hxx8z1sk1jx6/BACKGROUND-Northwest-Naturals-cat-food_.jpg?width=428&height=321', 'pubdata': 'Wed, 25 Dec 2024 23:12:41 +0000'}, page_content='An Oregon house cat has died after eating pet food contaminated with the H5N1 bird flu virus, prompting a nationwide recall of Northwest Naturals\' 2-pound Feline Turkey Recipe raw frozen pet food. The Oregon Department of Agriculture confirmed that the strictly indoor cat contracted the virus solely from the food, which has "best if used by" dates of May 21, 2026, and June 23, 2026. \n\nThe affected product was distributed across several states, including Arizona, California, and Florida, as well as British Columbia, Canada. Consumers are urged to dispose of the recalled food and seek refunds. This incident raises concerns about the spread of bird flu and its potential impact on domestic animals, particularly as California has declared a state of emergency due to the outbreak affecting various bird species.'),
 Document(metadata={'title': '20 big cats die from bird flu at Washington sanctuary', 'author': 'Nic F. Anderson, CNN', 'source_url': 'https://www.wishtv.com/news/national/bird-flu-outbreak-wild-felid-center-2024/', 'image_url': 'https://images.dappier.com/dm_01jagy9nqaeer9hxx8z1sk1jx6/BACKGROUND-Amur-Bengal-tiger-at-Wild-Felid-Advocacy-Center-of-Washington-FB-post_.jpg?width=428&height=321', 'pubdata': 'Wed, 25 Dec 2024 23:04:34 +0000'}, page_content='The Wild Felid Advocacy Center in Washington state has experienced a devastating bird flu outbreak, resulting in the deaths of 20 big cats, over half of its population. The first death was reported around Thanksgiving, affecting various species, including cougars and a tiger mix. The sanctuary is currently under quarantine, closed to the public, and working with animal health officials to disinfect enclosures and implement prevention strategies.\n\nAs the situation unfolds, the Washington Department of Fish and Wildlife has noted an increase in bird flu cases statewide, including infections in cougars. While human infections from bird flu through contact with mammals are rare, the CDC acknowledges the potential risk. The sanctuary hopes to reopen in the new year, focusing on the recovery of the remaining animals and taking measures to prevent further outbreaks, marking an unprecedented challenge in its 20-year history.')]

API reference

모든 DappierRetriever 기능 및 구성에 대한 자세한 문서는 API reference를 참조하세요.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I