SerpApi Google Search 도구

SerpApi Google Search 도구 (SerpApiGoogleSearchTool)

CrewAI의 SerpApiGoogleSearchTool은 SerpApi로 Google 검색을 실행하고 구조화된 결과를 가져오는 도구예요. SerpApi API 키가 필요하며, 에이전트가 실시간 Google 검색 결과를 활용해야 할 때 유용하답니다.

출처: 문서

본문

SerpApiGoogleSearchTool을 사용해 SerpApi로 Google 검색을 실행하고 구조화된 결과를 검색해 보세요. SerpApi API 키가 필요합니다.

설치 (Installation)

uv add crewai-tools[serpapi]

환경변수 (Environment Variables)

  • SERPAPI_API_KEY (필수): SerpApi용 API 키. https://serpapi.com/에서 만들 수 있어요 (무료 티어 제공).

예시 (Example)

from crewai import Agent, Task, Crew
from crewai_tools import SerpApiGoogleSearchTool

tool = SerpApiGoogleSearchTool()

agent = Agent(
    role="Researcher",
    goal="Answer questions using Google search",
    backstory="Search specialist",
    tools=[tool],
    verbose=True,
)

task = Task(
    description="Search for the latest CrewAI releases",
    expected_output="A concise list of relevant results with titles and links",
    agent=agent,
)

crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()

참고 (Notes)

  • 환경에 SERPAPI_API_KEY를 설정하세요. https://serpapi.com/에서 키를 만들 수 있어요.
  • SerpApi를 통한 Google Shopping도 참고하세요: /en/tools/search-research/serpapi-googleshoppingtool

파라미터 (Parameters)

실행 파라미터 (Run Parameters)

  • search_query (str, required): Google 쿼리예요.
  • location (str, optional): 지리적 위치 파라미터입니다.

참고 (Notes)

  • 이 도구는 SerpApi를 감싸며 구조화된 검색 결과를 반환합니다.

더 알아보기 (Learn more)