Linkup 검색

컨텍스트 검색 기능을 갖춘 강력한 웹 검색인 Linkup을 LiteLLM /search 엔드포인트에서 사용하는 방법을 안내할게요.

출처: 문서

본문

API 키 받기: https://linkup.so

LiteLLM Python SDK

Linkup Search

import os
from litellm import search

os.environ["LINKUP_API_KEY"] = "..."

response = search(
    query="latest AI developments",
    search_provider="linkup",
    max_results=5
)

LiteLLM AI Gateway

1. config.yaml 설정

config.yaml

model_list:
  - model_name: gpt-5.6-terra
    litellm_params:
      model: gpt-5.6-terra
      api_key: os.environ/OPENAI_API_KEY

search_tools:
  - search_tool_name: linkup-search
    litellm_params:
      search_provider: linkup
      api_key: os.environ/LINKUP_API_KEY

2. 프록시 시작

litellm --config /path/to/config.yaml

# RUNNING on http://0.0.0.0:4000

3. 검색 엔드포인트 테스트

Test Request

curl http://0.0.0.0:4000/v1/search/linkup-search \
  -H "Authorization: Bearer ***" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "latest AI developments",
    "max_results": 5
  }'

제공자별 파라미터

Linkup Search with Provider-specific Parameters

import os
from litellm import search

os.environ["LINKUP_API_KEY"] = "..."

response = search(
    query="machine learning research",
    search_provider="linkup",
    max_results=10,
    # Linkup-specific parameters
    depth="deep",                      # "standard" (faster) or "deep" (more comprehensive)
    outputType="searchResults",        # "searchResults", "sourcedAnswer", or "structured"
    includeSources=True,               # Include sources in response
    includeImages=True,                # Include images in results
    fromDate="2024-01-01",             # Start date filter (YYYY-MM-DD)
    toDate="2024-12-31",               # End date filter (YYYY-MM-DD)
    includeDomains=["arxiv.org", "nature.com"],  # Domains to search (max 100)
    excludeDomains=["wikipedia.com"],  # Domains to exclude
    includeInlineCitations=True,       # Include inline citations in sourcedAnswer
)

기능

Linkup은 컨텍스트 검색 기능이 있는 강력한 웹 검색을 제공해요:

검색 깊이

검색의 정밀도와 속도를 제어해요:

  • standard - 결과를 더 빨리 반환
  • deep - 더 오래 걸리지만 더 철저한 결과 반환

출력 타입

결과 형식을 선택해요:

  • searchResults - URL과 콘텐츠가 있는 검색 결과 목록 반환
  • sourcedAnswer - 출처가 있는 AI 생성 답변 반환
  • structured - 커스텀 JSON 스키마 형식으로 결과 반환

날짜 필터링

날짜 범위로 결과를 필터링해요:

response = search(
    query="AI developments",
    search_provider="linkup",
    fromDate="2024-06-01",
    toDate="2024-12-31"
)

도메인 필터링

특정 도메인을 포함하거나 제외해요:

response = search(
    query="research papers",
    search_provider="linkup",
    includeDomains=["arxiv.org", "nature.com", "ieee.org"],
    excludeDomains=["wikipedia.com"]
)

구조화된 출력

커스텀 JSON 스키마 형식으로 결과를 얻어요:

response = search(
    query="Microsoft 2024 revenue",
    search_provider="linkup",
    outputType="structured",
    structuredOutputSchema='{"type": "object", "properties": {"revenue": {"type": "string"}, "year": {"type": "string"}}}'
)

응답 형식

Linkup은 다음 형식으로 결과를 반환해요:

{
  "results": [
    {
      "type": "text",
      "name": "Microsoft 2024 Annual Report",
      "url": "https://www.microsoft.com/investor/reports/ar24/index.html",
      "content": "Highlights from fiscal year 2024..."
    }
  ]
}

LiteLLM은 이를 표준 SearchResponse 형식으로 변환해요:

  • results[].nameSearchResult.title
  • results[].urlSearchResult.url
  • results[].contentSearchResult.snippet

더 알아보기 (Learn more)