embedContent

suspend fun embedContent(model: String, contents: List<Content>, config: EmbedContentConfig? = null): EmbedContentResponse

Calculates embeddings for the given content.

Return

an EmbedContentResponse instance that contains response contents and other metadata

Parameters

model

the name of the GenAI model to use for embedding

contents

a list of Content to embed

config

an EmbedContentConfig instance that specifies the optional configurations


suspend fun embedContent(model: String, content: Content, config: EmbedContentConfig? = null): EmbedContentResponse

Calculates embeddings for the given content.

Return

an EmbedContentResponse instance that contains response contents and other metadata

Parameters

model

the name of the GenAI model to use for embedding

content

a Content to embed

config

an EmbedContentConfig instance that specifies the optional configurations


suspend fun embedContent(model: String, text: String, config: EmbedContentConfig? = null): EmbedContentResponse

Calculates embeddings for the given text string.

Return

an EmbedContentResponse instance that contains response contents and other metadata

Parameters

model

the name of the GenAI model to use for embedding

text

the text string to embed

config

an EmbedContentConfig instance that specifies the optional configurations