package
0.0.0-20240114103748-720e7b74ac27
Repository: https://github.com/frainl/generative-ai-go.git
Documentation: pkg.go.dev

# Functions

ImageData is a convenience function for creating an image Blob for input to a model.
NewClient creates a new Google generative AI client.
Ptr returns a pointer to its argument.

# Constants

BlockReasonOther means prompt was blocked due to unknown reaasons.
BlockReasonSafety means prompt was blocked due to safety reasons.
BlockReasonUnspecified means default value.
FinishReasonMaxTokens means the maximum number of tokens as specified in the request was reached.
FinishReasonOther means unknown reason.
FinishReasonRecitation means the candidate content was flagged for recitation reasons.
FinishReasonSafety means the candidate content was flagged for safety reasons.
FinishReasonStop means natural stop point of the model or provided stop sequence.
FinishReasonUnspecified means default value.
HarmBlockLowAndAbove means content with NEGLIGIBLE will be allowed.
HarmBlockMediumAndAbove means content with NEGLIGIBLE and LOW will be allowed.
HarmBlockNone means all content will be allowed.
HarmBlockOnlyHigh means content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.
HarmBlockUnspecified means threshold is unspecified.
HarmCategoryDangerous means dangerous content that promotes, facilitates, or encourages harmful acts.
HarmCategoryDangerousContent means dangerous content.
HarmCategoryDerogatory means negative or harmful comments targeting identity and/or protected attribute.
HarmCategoryHarassment means harasment content.
HarmCategoryHateSpeech means hate speech and content.
HarmCategoryMedical means promotes unchecked medical advice.
HarmCategorySexual means contains references to sexual acts or other lewd content.
HarmCategorySexuallyExplicit means sexually explicit content.
HarmCategoryToxicity means content that is rude, disrepspectful, or profane.
HarmCategoryUnspecified means category is unspecified.
HarmCategoryViolence means describes scenarios depictng violence against an individual or group, or general descriptions of gore.
HarmProbabilityHigh means content has a high chance of being unsafe.
HarmProbabilityLow means content has a low chance of being unsafe.
HarmProbabilityMedium means content has a medium chance of being unsafe.
HarmProbabilityNegligible means content has a negligible chance of being unsafe.
HarmProbabilityUnspecified means probability is unspecified.
TaskTypeClassification means specifies that the given text will be classified.
TaskTypeClustering means specifies that the embeddings will be used for clustering.
TaskTypeRetrievalDocument means specifies the given text is a document from the corpus being searched.
TaskTypeRetrievalQuery means specifies the given text is a query in a search/retrieval setting.
TaskTypeSemanticSimilarity means specifies the given text will be used for STS.
TaskTypeUnspecified means unset value, which will default to one of the other enum values.
TypeArray means array type.
TypeBoolean means boolean type.
TypeInteger means integer type.
TypeNumber means number type.
TypeObject means object type.
TypeString means string type.
TypeUnspecified means not specified, should not be used.

# Structs

BatchEmbedContentsResponse is the response to a `BatchEmbedContentsRequest`.
Blob contains raw media bytes.
A BlockedError indicates that the model's response was blocked.
Candidate is a response candidate generated from the model.
A ChatSession provides interactive chat.
CitationMetadata is a collection of source attributions for a piece of content.
CitationSource contains a citation to a source for a portion of a specific response.
A Client is a Google generative AI client.
Content is the base structured datatype containing multi-part content of a message.
ContentEmbedding is a list of floats representing an embedding.
CountTokensResponse is a response from `CountTokens`.
EmbedContentResponse is the response to an `EmbedContentRequest`.
An EmbeddingBatch holds a collection of embedding requests.
EmbeddingModel is a model that computes embeddings.
FunctionCall is a predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.
FunctionDeclaration is structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3).
FunctionResponse is the result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model.
GenerateContentResponse is the response from a GenerateContent or GenerateContentStream call.
GenerateContentResponseIterator is an iterator over GnerateContentResponse.
GenerationConfig is configuration options for model generation and outputs.
GenerativeModel is a model that can generate text.
Model is information about a Generative Language Model.
A ModelIterator iterates over Models.
PromptFeedback contains a set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.
SafetyRating is the safety rating for a piece of content.
SafetySetting is safety setting, affecting the safety-blocking behavior.
Schema is the `Schema` object allows the definition of input and output data types.
Tool details that the model may use to generate response.

# Interfaces

A Part is either a Text, a Blob, or a FileData.

# Type aliases

BlockReason is specifies what was the reason why prompt was blocked.
FinishReason is defines the reason why the model stopped generating tokens.
HarmBlockThreshold specifies block at and beyond a specified harm probability.
HarmCategory specifies the category of a rating.
HarmProbability specifies the probability that a piece of content is harmful.
TaskType is type of task for which the embedding will be used.
A Text is a piece of text, like a question or phrase.
Type contains the list of OpenAPI data types as defined by https://spec.openapis.org/oas/v3.0.3#data-types.