ChatMessageImageContent.Builder<T> Class

  • java.lang.Object
    • com.microsoft.semantickernel.services.chatcompletion.message.ChatMessageImageContent.Builder<T>

Type Parameters

T

the type of the inner content within the message

Implements

public static class ChatMessageImageContent.Builder<T>
implements SemanticKernelBuilder<ChatMessageImageContent<T>>

Builder for the ChatMessageImageContent<T> class.

Constructor Summary

Constructor Description
Builder()

Method Summary

Modifier and Type Method and Description
ChatMessageImageContent<T> build()

Build the object.

Builder<T> withDetail(ChatMessageImageContent.ImageDetail detail)

Set the detail level of the image to include in the chat message.

Builder<T> withImage(String imageType, byte[] content)

Set the image content to include in the chat message.

Builder<T> withImageUrl(String url)

Set the URL of the image to include in the chat message.

Builder<T> withImageUrl(URL url)

Set the URL of the image to include in the chat message.

Builder<T> withModelId(String modelId)

Set the model ID to use for the chat message.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

Builder

public Builder()

Method Details

build

public ChatMessageImageContent build()

Build the object.

withDetail

public ChatMessageImageContent.Builder withDetail(ChatMessageImageContent.ImageDetail detail)

Set the detail level of the image to include in the chat message.

Parameters:

detail - the detail level of the image

Returns:

this builder

withImage

public ChatMessageImageContent.Builder withImage(String imageType, byte[] content)

Set the image content to include in the chat message.

Parameters:

imageType - For instance jpg or png. For known types known to OpenAI see: docs.
content - the image content

Returns:

this builder

withImageUrl

public ChatMessageImageContent.Builder withImageUrl(String url)

Set the URL of the image to include in the chat message.

Parameters:

url - the URL of the image

Returns:

this builder

withImageUrl

public ChatMessageImageContent.Builder withImageUrl(URL url)

Set the URL of the image to include in the chat message.

Parameters:

url - the URL of the image

Returns:

this builder

withModelId

public ChatMessageImageContent.Builder withModelId(String modelId)

Set the model ID to use for the chat message.

Parameters:

modelId - the model ID

Returns:

this builder

Applies to