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

ts-chatgpt

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-chatgpt - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

3

build/core/common/env/EnvImpl.js

@@ -7,3 +7,4 @@ "use strict";

if (!process.env.OPENAI_API_KEY) {
throw new Error("No API key provided");
// throw new Error("No API key provided");
return "";
}

@@ -10,0 +11,0 @@ return process.env.OPENAI_API_KEY;

@@ -129,3 +129,4 @@ import { z } from "zod";

export interface PromptOptions {
apiKey?: string;
temperature?: number;
}

@@ -19,3 +19,5 @@ "use strict";

async prompt(model, messages, options) {
const headers = this.prepareAuthHeaders(this.apiKey);
// Extract only apiKey from options
const { apiKey, ...restOptions } = options;
const headers = this.prepareAuthHeaders(apiKey ?? this.apiKey);
const response = await this.fetchService.sendRequest(this.url, {

@@ -27,3 +29,3 @@ method: "POST",

messages,
...options,
...restOptions,
}),

@@ -30,0 +32,0 @@ }, this.parser);

{
"name": "ts-chatgpt",
"version": "0.4.0",
"version": "0.5.0",
"main": "./build/index.js",

@@ -5,0 +5,0 @@ "types": "./build/index.d.ts",

# ts-chatgpt
[![npm version](https://badge.fury.io/js/ts-chatgpt.svg)](https://badge.fury.io/js/ts-chatgpt)
![main workflow](https://github.com/takagimeow/ts-chatgpt/actions/workflows/main.yml/badge.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

@@ -74,2 +75,3 @@

| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `apiKey` | API key that can be obtained from the [OpenAI configuration page](https://platform.openai.com/account/api-keys). You can omit this value by setting the `OPENAI_API_KEY` environment variable. | `string` |
| `temperature` | **The lower the temperature, the more accurate the results.** API temperatures set to 0 or close to 0 (e.g. 0.1 or 0.2) tend to give better results in most cases; with GPT-3, the higher the temperature, the more creative and random the results, while with Codex, the higher the temperature, the more truly random and erratic the response can be. | `number` |

@@ -76,0 +78,0 @@

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