Module: LLM::Gemini::Response::WebSearch

Defined in:
lib/llm/providers/gemini/response/web_search.rb

Overview

The LLM::Gemini::Response::WebSearch module provides methods for accessing web search results from a web search tool call made via the LLM::Provider#web_search method.

Instance Method Summary collapse

Instance Method Details

#search_resultsArray<LLM::Object>

Returns one or more search results

Returns:



13
14
15
16
17
18
19
20
# File 'lib/llm/providers/gemini/response/web_search.rb', line 13

def search_results
  LLM::Object.from_hash(
    candidates[0]
      .
      .groundingChunks
      .map { {"url" => _1.web.uri, "title" => _1.web.title} }
  )
end