New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@google/generative-ai

Package Overview
Dependencies
Maintainers
4
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google/generative-ai - npm Package Compare versions

Comparing version 0.20.0 to 0.21.0

dist/server/types/search-grounding.d.ts

183

dist/generative-ai.d.ts

@@ -227,2 +227,27 @@ /**

/**
* Specifies the dynamic retrieval configuration for the given source.
* @public
*/
export declare interface DynamicRetrievalConfig {
/**
* The mode of the predictor to be used in dynamic retrieval.
*/
mode?: DynamicRetrievalMode;
/**
* The threshold to be used in dynamic retrieval. If not set, a system default
* value is used.
*/
dynamicThreshold?: number;
}
/**
* The mode of the predictor to be used in dynamic retrieval.
* @public
*/
export declare enum DynamicRetrievalMode {
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
MODE_DYNAMIC = "MODE_DYNAMIC"
}
/**
* Params for calling {@link GenerativeModel.embedContent}

@@ -534,2 +559,4 @@ * @public

logprobsResult?: LogprobsResult;
/** Search grounding metadata. */
groundingMetadata?: GroundingMetadata;
}

@@ -776,2 +803,126 @@

/**
* Retrieval tool that is powered by Google search.
* @public
*/
export declare interface GoogleSearchRetrieval {
/**
* Specifies the dynamic retrieval configuration for the given source.
*/
dynamicRetrievalConfig?: DynamicRetrievalConfig;
}
/**
* Retrieval tool that is powered by Google search.
* @public
*/
export declare interface GoogleSearchRetrievalTool {
/**
* Google search retrieval tool config.
*/
googleSearchRetrieval?: GoogleSearchRetrieval;
}
/**
* Grounding chunk.
* @public
*/
export declare interface GroundingChunk {
/**
* Chunk from the web.
*/
web?: GroundingChunkWeb;
}
/**
* Chunk from the web.
* @public
*/
export declare interface GroundingChunkWeb {
/**
* URI reference of the chunk.
*/
uri?: string;
/**
* Title of the chunk.
*/
title?: string;
}
/**
* Metadata returned to client when grounding is enabled.
* @public
*/
export declare interface GroundingMetadata {
/**
* Google search entry for the following-up web searches.
*/
searchEntryPoint?: SearchEntryPoint;
/**
* List of supporting references retrieved from specified grounding source.
*/
groundingChuncks?: GroundingChunk[];
/**
* List of grounding support.
*/
groundingSupport?: GroundingSupport[];
/**
* Metadata related to retrieval in the grounding flow.
*/
retrievalMetadata?: RetrievalMetadata;
/**
* * Web search queries for the following-up web search.
*/
webSearchQueries: string[];
}
/**
* Grounding support.
* @public
*/
export declare interface GroundingSupport {
/**
* URI reference of the chunk.
*/
segment?: string;
/**
* A list of indices (into 'grounding_chunk') specifying the citations
* associated with the claim. For instance [1,3,4] means that
* grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the
* retrieved content attributed to the claim.
*/
groundingChunckIndices?: number[];
/**
* Confidence score of the support references. Ranges from 0 to 1. 1 is the
* most confident. This list must have the same size as the
* grounding_chunk_indices.
*/
confidenceScores?: number[];
}
/**
* Segment of the content.
* @public
*/
export declare interface GroundingSupportSegment {
/**
* The index of a Part object within its parent Content object.
*/
partIndex?: number;
/**
* Start index in the given Part, measured in bytes. Offset from the start of
* the Part, inclusive, starting at zero.
*/
startIndex?: number;
/**
* End index in the given Part, measured in bytes. Offset from the start of
* the Part, exclusive, starting at zero.
*/
endIndex?: number;
/**
* The text corresponding to the segment from the response.
*/
text?: string;
}
/**
* Threshold above which a prompt or candidate will be blocked.

@@ -950,2 +1101,17 @@ * @public

/**
* Metadata related to retrieval in the grounding flow.
* @public
*/
export declare interface RetrievalMetadata {
/**
* Score indicating how likely information from google search could help
* answer the prompt. The score is in the range [0, 1], where 0 is the least
* likely and 1 is the most likely. This score is only populated when google
* search grounding and dynamic retrieval is enabled. It will becompared to
* the threshold to determine whether to trigger google search.
*/
googleSearchDynamicRetrievalScore?: number;
}
/**
* A safety rating associated with a {@link GenerateContentCandidate}

@@ -1021,2 +1187,17 @@ * @public

/**
* Google search entry point.
* @public
*/
export declare interface SearchEntryPoint {
/**
* Web content snippet that can be embedded in a web page or an app webview.
*/
renderedContent?: string;
/**
* Base64 encoded JSON representing array of <search term, search url> tuple.
*/
sdkBlob?: string;
}
/**
* Params passed to atomic asynchronous operations.

@@ -1083,3 +1264,3 @@ * @public

*/
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool;
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool | GoogleSearchRetrievalTool;

@@ -1086,0 +1267,0 @@ /**

@@ -207,2 +207,13 @@ 'use strict';

})(exports.FunctionCallingMode || (exports.FunctionCallingMode = {}));
/**
* The mode of the predictor to be used in dynamic retrieval.
* @public
*/
exports.DynamicRetrievalMode = void 0;
(function (DynamicRetrievalMode) {
// Unspecified function calling mode. This value should not be used.
DynamicRetrievalMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
// Run retrieval only when system decides it is necessary.
DynamicRetrievalMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
})(exports.DynamicRetrievalMode || (exports.DynamicRetrievalMode = {}));

@@ -287,3 +298,3 @@ /**

*/
const PACKAGE_VERSION = "0.20.0";
const PACKAGE_VERSION = "0.21.0";
const PACKAGE_LOG_HEADER = "genai-js";

@@ -754,2 +765,4 @@ var Task;

candidate.citationMetadata;
aggregatedResponse.candidates[i].groundingMetadata =
candidate.groundingMetadata;
aggregatedResponse.candidates[i].finishReason = candidate.finishReason;

@@ -756,0 +769,0 @@ aggregatedResponse.candidates[i].finishMessage =

@@ -72,3 +72,3 @@ 'use strict';

*/
const PACKAGE_VERSION = "0.20.0";
const PACKAGE_VERSION = "0.21.0";
const PACKAGE_LOG_HEADER = "genai-js";

@@ -784,2 +784,13 @@ var Task;

})(exports.FunctionCallingMode || (exports.FunctionCallingMode = {}));
/**
* The mode of the predictor to be used in dynamic retrieval.
* @public
*/
var DynamicRetrievalMode;
(function (DynamicRetrievalMode) {
// Unspecified function calling mode. This value should not be used.
DynamicRetrievalMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
// Run retrieval only when system decides it is necessary.
DynamicRetrievalMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
})(DynamicRetrievalMode || (DynamicRetrievalMode = {}));

@@ -786,0 +797,0 @@ exports.GoogleAICacheManager = GoogleAICacheManager;

@@ -147,2 +147,27 @@ /**

/**
* Specifies the dynamic retrieval configuration for the given source.
* @public
*/
declare interface DynamicRetrievalConfig {
/**
* The mode of the predictor to be used in dynamic retrieval.
*/
mode?: DynamicRetrievalMode;
/**
* The threshold to be used in dynamic retrieval. If not set, a system default
* value is used.
*/
dynamicThreshold?: number;
}
/**
* The mode of the predictor to be used in dynamic retrieval.
* @public
*/
declare enum DynamicRetrievalMode {
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
MODE_DYNAMIC = "MODE_DYNAMIC"
}
/**
* Details object that may be included in an error response.

@@ -505,2 +530,24 @@ * @public

/**
* Retrieval tool that is powered by Google search.
* @public
*/
declare interface GoogleSearchRetrieval {
/**
* Specifies the dynamic retrieval configuration for the given source.
*/
dynamicRetrievalConfig?: DynamicRetrievalConfig;
}
/**
* Retrieval tool that is powered by Google search.
* @public
*/
declare interface GoogleSearchRetrievalTool {
/**
* Google search retrieval tool config.
*/
googleSearchRetrieval?: GoogleSearchRetrieval;
}
/**
* Content part interface if the part represents an image.

@@ -718,3 +765,3 @@ * @public

*/
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool;
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool | GoogleSearchRetrievalTool;

@@ -721,0 +768,0 @@ /**

@@ -98,1 +98,9 @@ /**

}
/**
* The mode of the predictor to be used in dynamic retrieval.
* @public
*/
export declare enum DynamicRetrievalMode {
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
MODE_DYNAMIC = "MODE_DYNAMIC"
}

@@ -21,2 +21,3 @@ /**

export * from "./responses";
export * from "./search-grounding";
export { CachedContent, CachedContentBase } from "./server/caching";

3

dist/server/types/requests.d.ts

@@ -21,2 +21,3 @@ /**

import { FunctionDeclarationsTool, ResponseSchema, ToolConfig } from "./function-calling";
import { GoogleSearchRetrievalTool } from "./search-grounding";
/**

@@ -212,3 +213,3 @@ * Base parameters for a number of methods.

*/
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool;
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool | GoogleSearchRetrievalTool;
/**

@@ -215,0 +216,0 @@ * Enables the model to execute code as part of generation.

@@ -19,2 +19,3 @@ /**

import { BlockReason, FinishReason, HarmCategory, HarmProbability } from "./enums";
import { GroundingMetadata } from "./search-grounding";
/**

@@ -150,2 +151,4 @@ * Result object returned from generateContent() call.

logprobsResult?: LogprobsResult;
/** Search grounding metadata. */
groundingMetadata?: GroundingMetadata;
}

@@ -152,0 +155,0 @@ /**

@@ -98,1 +98,9 @@ /**

}
/**
* The mode of the predictor to be used in dynamic retrieval.
* @public
*/
export declare enum DynamicRetrievalMode {
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
MODE_DYNAMIC = "MODE_DYNAMIC"
}

@@ -21,2 +21,3 @@ /**

export * from "./responses";
export * from "./search-grounding";
export { CachedContent, CachedContentBase } from "./server/caching";

@@ -21,2 +21,3 @@ /**

import { FunctionDeclarationsTool, ResponseSchema, ToolConfig } from "./function-calling";
import { GoogleSearchRetrievalTool } from "./search-grounding";
/**

@@ -212,3 +213,3 @@ * Base parameters for a number of methods.

*/
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool;
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool | GoogleSearchRetrievalTool;
/**

@@ -215,0 +216,0 @@ * Enables the model to execute code as part of generation.

@@ -19,2 +19,3 @@ /**

import { BlockReason, FinishReason, HarmCategory, HarmProbability } from "./enums";
import { GroundingMetadata } from "./search-grounding";
/**

@@ -150,2 +151,4 @@ * Result object returned from generateContent() call.

logprobsResult?: LogprobsResult;
/** Search grounding metadata. */
groundingMetadata?: GroundingMetadata;
}

@@ -152,0 +155,0 @@ /**

{
"name": "@google/generative-ai",
"version": "0.20.0",
"version": "0.21.0",
"description": "Google AI JavaScript SDK",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc