flutter_gemini_lululala
library
Classes
-
Candidates
-
Candidates is the value in request response
A class representing the AI-generated response, including content,
metadata, and safety-related information.
-
Content
-
Represents the content of an AI response, including its components (parts)
and the role associated with it, such as "user" or "model".
-
FileDataPart
-
Represents a part of a file, including metadata like MIME type and URI pointing to the file.
This class is used when a file is included in the conversation or request, allowing the system
to handle files alongside other content types (such as text or inline data).
-
FilePart
-
Represents a part of a request or response that contains file data. This class implements
the
Part
interface and is used when a file is included in the conversation, allowing
for seamless handling of file-based content alongside other parts such as text or inline data.
-
Gemini
-
Gemini
Flutter Google Gemini SDK. Google Gemini is a set of cutting-edge large language models
(LLMs) designed to be the driving force behind Google's future AI initiatives.
implements
GeminiInterface
and GeminiInterface
defines all methods of Gemini
Here's a simple example of using this API:
-
GeminiModel
-
Represents the Gemini model with properties such as name, version,
description, and token limits, along with configuration for generation
methods and sampling parameters.
-
GeminiResponse
-
-
GenerationConfig
-
Configuration for controlling the behavior of content generation,
including various parameters such as stop sequences, temperature, and token limits.
-
InlineData
-
Represents inline data used in requests or responses, including metadata like MIME type
and the actual data, which is often encoded as a Base64 string. This class is useful for
handling in-line binary data such as images, audio files, or any data that needs to be
transmitted in the body of a message.
-
InlinePart
-
Represents an inline part of a request or response, specifically used for
handling binary data that is transmitted inline, such as images, audio, or other
media types. This class wraps the
InlineData
object, which contains the actual
binary content along with its metadata (like MIME type and Base64-encoded data).
-
Part
-
Represents a flexible data part that can hold text, file, or binary data.
This is an abstract interface class with factory constructors for specific
implementations like
TextPart
, FilePart
, and InlinePart
.
-
Parts
-
DEPRECATED: Please use
Part
instead. This class has been replaced by
Part
for better structure and flexibility in handling different types of
content. The Parts
class was originally designed to hold textual content,
but has been superseded by the more general Part
class, which supports
multiple content types, such as text, files, and inline data.
-
SafetySetting
-
SafetySetting
Safety settings are part of the request you send to the text service.
It can be adjusted for each request you make to the API.
The following table lists the categories that you can set and describes the type of harm that each category encompasses.
A configuration for setting safety measures, including a category and threshold.
This class helps define the safety parameters to assess or control the behavior of the AI model's outputs.
-
TextPart
-
Represents a text part of a request or response, used for handling plain text
content within a message. This class encapsulates the text content, which can
be transmitted as part of a multi-part message or response.
Enums
-
SafetyCategory
-
An enumeration representing various safety categories for content moderation.
Each category corresponds to a type of potentially harmful content that can be flagged,
restricted, or filtered based on specific safety settings.
-
SafetyThreshold
-
An enumeration representing various safety thresholds for content moderation.
Each threshold defines a level of risk associated with potentially unsafe content,
dictating whether content should be blocked or flagged based on its probability of being harmful.
Extensions
-
CandidateExtension
on Candidates
-
CandidateExtension used when wanna get output simply
Extension for the
Candidates
class that provides convenient getters
to access the last part of the content
in different formats (text, file, or generic part).
This extension is useful for extracting the relevant output from the Candidates
object based on the response type (text, file, or other parts).
Exceptions / Errors
-
GeminiException
-
A custom exception class to represent errors that occur during Gemini API interactions.
This exception is used to capture error messages and status codes from the API response,
providing more context for error handling.