CurlGenAiClient

public class CurlGenAiClient
extends Object

java.lang.Object
   ↳ com.android.tradefed.ai.CurlGenAiClient


Provide a central client to interact with GenAi API and make prompt requests. This requires a valid API_KEY to be set.

Summary

Public constructors

CurlGenAiClient()

Public methods

PromptResponse runPrompt(CurlGenAiClient.Model model, String apiKey, boolean logPromptOnly, String prompt, List<ContentRequest.InlineData> data)

Request a prompt to execute.

PromptResponse runPrompt(String apiKey, boolean logPromptOnly, String prompt, List<ContentRequest.InlineData> data)

Request a prompt to execute.

PromptResponse runPrompt(String apiKey, boolean logPromptOnly, String prompt)

Request a prompt to execute.

Public constructors

CurlGenAiClient

public CurlGenAiClient ()

Public methods

runPrompt

public PromptResponse runPrompt (CurlGenAiClient.Model model, 
                String apiKey, 
                boolean logPromptOnly, 
                String prompt, 
                List<ContentRequest.InlineData> data)

Request a prompt to execute.

Parameters
model CurlGenAiClient.Model: The model to be used.

apiKey String: The API_KEY to be used for the query.

logPromptOnly boolean: returns the prompt only without executing it.

prompt String: The prompt being used.

data List: The inline file data to be associated with the prompt.

Returns
PromptResponse

runPrompt

public PromptResponse runPrompt (String apiKey, 
                boolean logPromptOnly, 
                String prompt, 
                List<ContentRequest.InlineData> data)

Request a prompt to execute.

Parameters
apiKey String: The API_KEY to be used for the query.

logPromptOnly boolean: returns the prompt only without executing it.

prompt String: The prompt being used.

data List: The inline file data to be associated with the prompt.

Returns
PromptResponse

runPrompt

public PromptResponse runPrompt (String apiKey, 
                boolean logPromptOnly, 
                String prompt)

Request a prompt to execute.

Parameters
apiKey String: The API_KEY to be used for the query.

logPromptOnly boolean: returns the prompt only without executing it.

prompt String: The prompt being used.

Returns
PromptResponse