Module: LLM::OpenAI::Response::WebSearch

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

Overview

The LLM::OpenAI::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
# File 'lib/llm/providers/openai/response/web_search.rb', line 13

def search_results
  LLM::Object.from_hash(
    choices[0]
      .annotations
      .map { _1.slice(:title, :url) }
  )
end