🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@fuyun/generative-ai

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fuyun/generative-ai - npm Package Compare versions

Comparing version

to
0.2.1

15

dist/index.js

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

*/
const PACKAGE_VERSION = "0.2.0";
const PACKAGE_VERSION = "0.2.1";
const PACKAGE_LOG_HEADER = "genai-js";

@@ -181,3 +181,3 @@ var Task;

const baseURL = this.requestOptions.baseURL || 'https://generativelanguage.googleapis.com';
let url = `${baseURL}/${API_VERSION}/models/${this.model}:${this.task}`;
let url = `${baseURL}/${API_VERSION}/${this.model}:${this.task}`;
if (this.stream) {

@@ -788,3 +788,3 @@ url += "?alt=sse";

const requestsWithModel = params.requests.map((request) => {
return Object.assign(Object.assign({}, request), { model: `models/${model}` });
return Object.assign(Object.assign({}, request), { model });
});

@@ -817,9 +817,10 @@ const response = await makeRequest(url, JSON.stringify({ requests: requestsWithModel }), requestOptions);

constructor(apiKey, modelParams, requestOptions) {
var _a;
this.apiKey = apiKey;
if (modelParams.model.startsWith("models/")) {
this.model = (_a = modelParams.model.split("models/")) === null || _a === void 0 ? void 0 : _a[1];
if (modelParams.model.includes("/")) {
// Models may be named "models/model-name" or "tunedModels/model-name"
this.model = modelParams.model;
}
else {
this.model = modelParams.model;
// If path is not included, assume it's a non-tuned model.
this.model = `models/${modelParams.model}`;
}

@@ -826,0 +827,0 @@ this.generationConfig = modelParams.generationConfig || {};

{
"name": "@fuyun/generative-ai",
"version": "0.2.0",
"version": "0.2.1",
"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