Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ai-sdk/google

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/google - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

20

./dist/index.js

@@ -24,2 +24,3 @@ "use strict";

Google: () => Google,
createGoogleGenerativeAI: () => createGoogleGenerativeAI,
google: () => google

@@ -473,8 +474,25 @@ });

};
var google = new Google();
// src/google-provider.ts
function createGoogleGenerativeAI(options = {}) {
const google2 = new Google(options);
const provider = function(modelId, settings) {
if (new.target) {
throw new Error(
"The Google Generative AI model function cannot be called with the new keyword."
);
}
return google2.chat(modelId, settings);
};
provider.chat = google2.chat.bind(google2);
provider.generativeAI = google2.generativeAI.bind(google2);
return provider;
}
var google = createGoogleGenerativeAI();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Google,
createGoogleGenerativeAI,
google
});
//# sourceMappingURL=index.js.map

@@ -28,3 +28,3 @@ import { LanguageModelV1 } from '@ai-sdk/provider';

/**
* Google provider.
* @deprecated Use `createGoogleGenerativeAI` instead.
*/

@@ -63,7 +63,34 @@ declare class Google {

}
interface GoogleGenerativeAIProvider {
(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): GoogleGenerativeAILanguageModel;
chat(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): GoogleGenerativeAILanguageModel;
/**
* @deprecated Use `chat()` instead.
*/
generativeAI(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): GoogleGenerativeAILanguageModel;
}
/**
* Default Google provider instance.
* Create a Google Generative AI provider.
*/
declare const google: Google;
declare function createGoogleGenerativeAI(options?: {
/**
* Base URL for the Google API calls.
*/
baseURL?: string;
/**
* @deprecated Use `baseURL` instead.
*/
baseUrl?: string;
/**
* API key for authenticating requests.
*/
apiKey?: string;
generateId?: () => string;
}): GoogleGenerativeAIProvider;
/**
* Default Google Generative AI provider instance.
*/
declare const google: GoogleGenerativeAIProvider;
export { Google, google };
export { Google, type GoogleGenerativeAIProvider, createGoogleGenerativeAI, google };

@@ -24,2 +24,3 @@ "use strict";

Google: () => Google,
createGoogleGenerativeAI: () => createGoogleGenerativeAI,
google: () => google

@@ -473,8 +474,25 @@ });

};
var google = new Google();
// src/google-provider.ts
function createGoogleGenerativeAI(options = {}) {
const google2 = new Google(options);
const provider = function(modelId, settings) {
if (new.target) {
throw new Error(
"The Google Generative AI model function cannot be called with the new keyword."
);
}
return google2.chat(modelId, settings);
};
provider.chat = google2.chat.bind(google2);
provider.generativeAI = google2.generativeAI.bind(google2);
return provider;
}
var google = createGoogleGenerativeAI();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Google,
createGoogleGenerativeAI,
google
});
//# sourceMappingURL=index.js.map

2

package.json
{
"name": "@ai-sdk/google",
"version": "0.0.3",
"version": "0.0.4",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -1,2 +0,2 @@

# Vercel AI SDK - Google Provider
# Vercel AI SDK - Google Generative AI Provider

@@ -14,8 +14,8 @@ The Google provider contains language model support for the [Google Generative AI](https://ai.google/discover/generativeai/) APIs.

You can import `Google` from `ai/google` and initialize a provider instance with various settings:
You can import `createGoogleGenerativeAI` from `@ai-sdk/google` and create a provider instance with various settings:
```ts
import { Google } from '@ai-sdk/google';
import { createGoogleGenerativeAI } from '@ai-sdk/google';
const google = new Google({
const google = createGoogleGenerativeAI({
baseURL: '', // optional base URL for proxies etc.

@@ -32,5 +32,5 @@ apiKey: '', // optional API key, default to env property GOOGLE_GENERATIVE_AI_API_KEY

## Generative AI Models
## Models
You can create models that call the [Google Generative AI API](https://ai.google.dev/api/rest) using the `.chat()` factory method.
You can create models that call the [Google Generative AI API](https://ai.google.dev/api/rest) using the provider instance.
The first argument is the model id, e.g. `models/gemini-pro`.

@@ -40,3 +40,3 @@ The models support tool calls and some have multi-modal capabilities.

```ts
const model = google.chat('models/gemini-pro');
const model = google('models/gemini-pro');
```

@@ -48,5 +48,5 @@

```ts
const model = google.chat('models/gemini-pro', {
const model = google('models/gemini-pro', {
topK: 0.2,
});
```

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