Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ internal class UnsupportedUserLocationException(cause: Throwable? = null) :
FirebaseCommonAIException("User location is not supported for the API use.", cause)

/**
* The user's project has not been configured and enabled for the selected API.
* The Firebase project has not been configured and enabled for the selected API.
*
* For the Gemini Developer API, see
* [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public class UnsupportedUserLocationException internal constructor(cause: Throwa
FirebaseAIException("User location is not supported for the API use.", cause)

/**
* The user's project has not been configured and enabled for the selected API.
* The Firebase project has not been configured and enabled for the selected API.
*
* For the Gemini Developer API, see
* [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class GenerateContentResponse(

/**
* Convenience field representing all the text parts in the response that are marked as thoughts
* as a single string, if they exists.
* as a single string, if they exist.
*
* Learn more about [thinking](https://firebase.google.com/docs/ai-logic/thinking?api=dev).
*/
Expand Down
44 changes: 20 additions & 24 deletions firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ internal constructor(
/**
* Represents image data sent to and received from requests. The image is converted client-side to
* JPEG encoding at 80% quality before being sent to the server.
*
* @param image [Bitmap] to convert into a [Part]
*/
public class ImagePart
internal constructor(
Expand All @@ -116,6 +114,7 @@ internal constructor(
internal val thoughtSignature: String?
) : Part {

/** @param image [Bitmap] to convert into a [Part] */
public constructor(image: Bitmap) : this(image, false, null)

internal fun toInlineDataPart() =
Expand All @@ -127,13 +126,7 @@ internal constructor(
)
}

/**
* Represents binary data with an associated MIME type sent to and received from requests.
*
* @param inlineData the binary data as a [ByteArray]
* @param mimeType an IANA standard MIME type. For supported values, see the
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
*/
/** Represents binary data with an associated MIME type sent to and received from requests. */
public class InlineDataPart
internal constructor(
public val inlineData: ByteArray,
Expand All @@ -142,6 +135,11 @@ internal constructor(
internal val thoughtSignature: String?
) : Part {

/**
* @param inlineData the binary data as a [ByteArray]
* @param mimeType an IANA standard MIME type. For supported values, see the
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
*/
public constructor(
inlineData: ByteArray,
mimeType: String
Expand Down Expand Up @@ -199,13 +197,7 @@ internal constructor(
}
}

/**
* Represents function call output to be returned to the model when it requests a function call.
*
* @param name The name of the called function.
* @param response The response produced by the function as a [JSONObject].
* @param id Matching `id` for a [FunctionCallPart], if one was provided.
*/
/** Represents function call output to be returned to the model when it requests a function call. */
public class FunctionResponsePart
internal constructor(
public val name: String,
Expand All @@ -215,6 +207,11 @@ internal constructor(
internal val thoughtSignature: String?
) : Part {

/**
* @param name The name of the called function.
* @param response The response produced by the function as a [JSONObject].
* @param id Matching `id` for a [FunctionCallPart], if one was provided.
*/
@JvmOverloads
public constructor(
name: String,
Expand Down Expand Up @@ -242,14 +239,7 @@ internal constructor(
}
}

/**
* Represents file data stored in Cloud Storage for Firebase, referenced by URI.
*
* @param uri The `"gs://"`-prefixed URI of the file in Cloud Storage for Firebase, for example,
* `"gs://bucket-name/path/image.jpg"`
* @param mimeType an IANA standard MIME type. For supported MIME type values see the
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
*/
/** Represents file data stored in Cloud Storage for Firebase, referenced by URI. */
public class FileDataPart
internal constructor(
public val uri: String,
Expand All @@ -258,6 +248,12 @@ internal constructor(
internal val thoughtSignature: String?
) : Part {

/**
* @param uri The `"gs://"`-prefixed URI of the file in Cloud Storage for Firebase, for example,
* `"gs://bucket-name/path/image.jpg"`
* @param mimeType an IANA standard MIME type. For supported MIME type values see the
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
*/
public constructor(uri: String, mimeType: String) : this(uri, mimeType, false, null)

@Serializable
Expand Down
Loading