Skip to content

FunctionToolCallOutput

This docs was updated at: 2026-02-23

com.paragon.responses.spec.FunctionToolCallOutput  ยท  Record


The output of a function tool call.

Methods

success

public static FunctionToolCallOutput success(@NonNull String message)

Creates a successful text output with a generated call ID.

Parameters

Name Description
message The success message

Returns

A FunctionToolCallOutput with the text


success

public static FunctionToolCallOutput success(@NonNull String callId, @NonNull String message)

Creates a successful text output with a specific call ID.

Parameters

Name Description
callId The call ID
message The success message

Returns

A FunctionToolCallOutput with the text


error

public static FunctionToolCallOutput error(@NonNull String errorMessage)

Creates an error text output with a generated call ID.

Parameters

Name Description
errorMessage The error message

Returns

A FunctionToolCallOutput with the error text


error

public static FunctionToolCallOutput error(@NonNull String callId, @NonNull String errorMessage)

Creates an error text output with a specific call ID.

Parameters

Name Description
callId The call ID
errorMessage The error message

Returns

A FunctionToolCallOutput with the error text


inProgress

public static FunctionToolCallOutput inProgress(@NonNull String message)

Creates an in-progress text output with a generated call ID.

Parameters

Name Description
message The progress message

Returns

A FunctionToolCallOutput with in-progress status


inProgress

public static FunctionToolCallOutput inProgress(@NonNull String callId, @NonNull String message)

Creates an in-progress text output with a specific call ID.

Parameters

Name Description
callId The call ID
message The progress message

Returns

A FunctionToolCallOutput with in-progress status


withImage

public static FunctionToolCallOutput withImage(@NonNull Image image)

Creates an output with an image result.

Parameters

Name Description
image The image output

Returns

A FunctionToolCallOutput with the image


withImage

public static FunctionToolCallOutput withImage(@NonNull String callId, @NonNull Image image)

Creates an output with an image result and specific call ID.

Parameters

Name Description
callId The call ID
image The image output

Returns

A FunctionToolCallOutput with the image


withFile

public static FunctionToolCallOutput withFile(@NonNull File file)

Creates an output with a file result.

Parameters

Name Description
file The file output

Returns

A FunctionToolCallOutput with the file


withFile

public static FunctionToolCallOutput withFile(@NonNull String callId, @NonNull File file)

Creates an output with a file result and specific call ID.

Parameters

Name Description
callId The call ID
file The file output

Returns

A FunctionToolCallOutput with the file


generateCallId

private static String generateCallId()

Generates a unique call ID.

Returns

A unique call ID string