- 8543716: Add search grounding feature to SDK.
- dda0b5c: Add
frequencyPenalty
,presencePenalty
,responseLogprobs
, andlogProbs
parameters support forgenerationConfig
. AddedavgLogprobs
andlogprobsResult
toGenerateContentResponse
. Updated test cases.
- 00dc7a1: Use lowercase SchemaType enum values to match json-schema.
- fc008a1: Add ability to set modelParams (generationConfig, safetySettings) on getGenerativeModelFromCachedContent().
- d8f6b4f: Fix language marker in text helper for executable code results.
- fdfb5bd: Fix reference to
requestOptions
instartChat
.
- 3b5daae: Fix
Schema
type to reference itself and not a derived type in itsitems
array andproperties
map.
This is a cherry-picked patch to fix an bug for users pinned to versions 0.16.x.
- fdfb5bd: Fix reference to
requestOptions
instartChat
.
- d2d42ca: Adds
SingleRequestOptions
withAbortSignal
support to most of the asynchronous methods ofGenerativeModel
,GoogleAIFileManager
andChatSession
.
- 05b8631: Add FinishReason.LANGUAGE enum value.
- e87d5b0: Fix countTokens to include any params set on the model instance.
- 0c23bb3: Add
CodeExecutionTool
toTool
type.
- fb1c0f2: Add a
cachedContentTokenCount
field to theUsageMetadata
interface returned bygenerateContent
responses. - 06216be: Add code execution feature.
- 83ec4ac: Expand the model's
countTokens
method to alternatively accept aGenerateContentRequest
. - 5df61d1: Added
GoogleAICacheManager
utility to allow caching large content to be used in inference. This class is exported from the@google/generative-ai/server
subpath. Breaking change: TheGoogleAIFileManager
class has been moved to be exported from this subpath as well instead of the/files
subpath.
- 1440a05: Removed the
model
field from the internally formatted payload ofcountToken
requests as it was unnecessary. - 03eb57b: Fix missing usageMetadata in streamed aggregated response (#174)
- 85ff2c4: Added
responseSchema
toGenerationConfig
to allow user to provide a JSON schema whenresponseMimeType
is set to JSON.
- 42ba6ca: Fix paths to @google/generative-ai/files.
- ee02ff0: Add additional properties
videoMetadata
anderror
toFileMetadataResponse
type.
- c7c0b50: Fixed
FileState
enum values to be strings.
- cefa8f2: Lifted a restriction in chat sessions that required a specific order of content roles.
- 819501f: Fix a bug that caused file uploads to be named "undefined" if no file name is provided.
- 58ab777: Added responseMimeType to GenerationConfig to allow for JSON formatted responses.
- c39015c: Fixed a bug where
text()
did not handle multipleTextPart
s in a single candidate. Addedstate
field toFileMetadataResponse
.
- 657799a: Added UsageMetadata to GenerateContentResponses.
- 4562366: Add a request option for custom headers
- ca62400: Allow text-only systemInstruction as well as Part and Content.
- 111e970: Export error classes and add more properties to fetch errors.
- a89d427: Add GoogleAIFileManager for file uploads.
- 6ef8cee: Fixed bugs where
RequestOptions
,generationConfig
, andsafetySettings
were not passed from the model down to some methods.
- 79b7651: Set default API version to "v1beta" to match Go and Python.
- 2a1f97c: Add
systemInstruction
feature and forced function calling feature (usingtoolConfig
).
- 0931d2c: Refactor makeRequest to make fetch mockable.
- 658a0da: Add
apiClient
configuration option toRequestOptions
.
- 790a943: Deprecate functionCall() and add functionCalls().
- e636823: Loosen role field typing on Content.
- 7a45f01: Add option in RequestOptions to change baseUrl.
- 3f95168: Fix requestOptions not being passed through countTokens, embedContent, and batchEmbedContents
- ccd9951: validateChatHistory is now checking that 'parts' property is an array
- 932e1be: Add
apiVersion
property toRequestOptions
to allow user to choose API endpoint version. - 9887465: Added support for function calling
- 2b0c955: Handle different model prefixes (such as tunedModels/).
- c64fca1: add request timeout configuration
- 54839f2: Send API key in header instead of query param.
- 6a4c9c2: Fixed stream hanging
- 73c2ff9: Fixed UTF-8 handling and chunking for stream output
- fb52d34: Obscure API key in error messages
- 5b5fc7d: Catch unhandled rejections in
sendMessageStream
.
- Update README to released version and bump to publish new README to npm.