retrieval

public abstract Tool.Builder retrieval(Retrieval retrieval)

Setter for retrieval.

retrieval: Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API.


@CanIgnoreReturnValue()
public Tool.Builder retrieval(Retrieval.Builder retrievalBuilder)

Setter for retrieval builder.

retrieval: Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API.