Agents 1.5.0
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::tools::DirectAnswer Struct Reference

Direct answer extracted from SerpAPI response (answer boxes, featured snippets, etc.). More...

#include <web_search_tool.h>

Public Member Functions

bool isEmpty () const
 Check if the DirectAnswer is empty.
JsonObject toJson () const
 Convert DirectAnswer to JsonObject.

Public Attributes

std::string type
 Type of direct answer: "answer_box", "featured_snippet", "sports_result", "rich_snippet".
std::string answer
 The direct answer text.
std::string title
 Title associated with the answer.
std::string snippet
 Extended snippet text.
std::string source_url
 Source URL for the answer.
std::vector< std::string > highlighted_words
 Highlighted words from the answer.

Detailed Description

Direct answer extracted from SerpAPI response (answer boxes, featured snippets, etc.).

Member Function Documentation

◆ isEmpty()

bool agents::tools::DirectAnswer::isEmpty ( ) const
inline

Check if the DirectAnswer is empty.

Returns
true if no meaningful content, false otherwise

◆ toJson()

JsonObject agents::tools::DirectAnswer::toJson ( ) const
inline

Convert DirectAnswer to JsonObject.

Returns
JsonObject json representation