Golden은 Golden Knowledge Graph를 사용하여 쿼리 및 데이터 보강을 위한 자연어 API 세트를 제공합니다. 예를 들어 Products from OpenAI, Generative ai companies with series a funding, rappers who invest와 같은 쿼리를 사용하여 관련 엔티티에 대한 구조화된 데이터를 검색할 수 있습니다. golden-query langchain tool은 Golden Query API를 래핑한 것으로, 이러한 결과에 프로그래밍 방식으로 액세스할 수 있게 해줍니다. 자세한 내용은 Golden Query API 문서를 참조하세요.
이 노트북은 golden-query tool을 사용하는 방법을 다룹니다.
  • Golden API 문서에서 Golden API에 대한 개요를 확인하세요.
  • Golden API Settings 페이지에서 API key를 받으세요.
  • API key를 GOLDEN_API_KEY 환경 변수에 저장하세요.
pip install -qU langchain-community
import os

os.environ["GOLDEN_API_KEY"] = ""
from langchain_community.utilities.golden_query import GoldenQueryAPIWrapper
golden_query = GoldenQueryAPIWrapper()
import json

json.loads(golden_query.run("companies in nanotech"))
{'results': [{'id': 4673886,
   'latestVersionId': 60276991,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'Samsung', 'citations': []}]}]},
  {'id': 7008,
   'latestVersionId': 61087416,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'Intel', 'citations': []}]}]},
  {'id': 24193,
   'latestVersionId': 60274482,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'Texas Instruments', 'citations': []}]}]},
  {'id': 1142,
   'latestVersionId': 61406205,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'Advanced Micro Devices', 'citations': []}]}]},
  {'id': 193948,
   'latestVersionId': 58326582,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'Freescale Semiconductor', 'citations': []}]}]},
  {'id': 91316,
   'latestVersionId': 60387380,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'Agilent Technologies', 'citations': []}]}]},
  {'id': 90014,
   'latestVersionId': 60388078,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'Novartis', 'citations': []}]}]},
  {'id': 237458,
   'latestVersionId': 61406160,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'Analog Devices', 'citations': []}]}]},
  {'id': 3941943,
   'latestVersionId': 60382250,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'AbbVie Inc.', 'citations': []}]}]},
  {'id': 4178762,
   'latestVersionId': 60542667,
   'properties': [{'predicateId': 'name',
     'instances': [{'value': 'IBM', 'citations': []}]}]}],
 'next': 'https://golden.com/api/v2/public/queries/59044/results/?cursor=eyJwb3NpdGlvbiI6IFsxNzYxNiwgIklCTS04M1lQM1oiXX0%3D&pageSize=10',
 'previous': None}

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I