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

chatgpt-optimized-official

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chatgpt-optimized-official - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

4

dist/classes/chatgpt.js

@@ -264,7 +264,7 @@ import axios from "axios";

if (response.data.choices[0]['message']['content']) {
if (response.data.choices[0]['message']['tool_calls']) {
if (response.data.choices[0].finish_reason == "tool_calls") {
conversation.messages.push({
id: randomUUID(),
content: response.data.choices[0]['message']['content'],
type: MessageType.Function,
type: MessageType.Assistant,
date: Date.now(),

@@ -271,0 +271,0 @@ name: function_name,

@@ -9,3 +9,3 @@ import { ChatGPT, Assistant } from "../dist/index.js";

let bot = new ChatGPT(process.env.OPENAI_API_KEY, {
let bot = new ChatGPT("", {
temperature: 0.7, // OpenAI parameter

@@ -71,24 +71,6 @@ max_tokens: 256, // OpenAI parameter [Max response size by tokens]

}
},
{
"type": "function",
"function": {
"name": "saveDataPayment",
"description": "Guarda la información del pago del cliente",
"parameters": {
"type": "object",
"properties": {
"payType": { "type": "string", "enum": ["efectivo", "pago movil", "transferencia bancaria", "binance", "zelle"] },
"voucher": {
"type": "string",
"description": "texto comprobante de pago",
}
}
]
},
"required": ["payType"],
}
}
}]
}

@@ -111,9 +93,14 @@ );

process.stdout.write("ChatGPT: ");
await bot.askPost(res => {
let response = await bot.askPost(res => {
process.stdout.write(res.toString());
}, _ => { }, prompt, "3236385");
//console.log();
console.log("response new", response);
if(response.finish_reason=="tool_calls"){
let response2=await bot.askV1("orden creada", "3236385", 3, "createOrder", response.message.tool_calls[0].id);
process.stdout.write(response2.toString());
}
}
}
main();
{
"name": "chatgpt-optimized-official",
"version": "1.3.1",
"version": "1.3.2",
"description": "ChatGPT Client using official OpenAI API",

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

@@ -334,7 +334,7 @@ import axios from "axios";

if(response.data.choices[0]['message']['content']) {
if(response.data.choices[0]['message']['tool_calls']){
if(response.data.choices[0].finish_reason=="tool_calls"){
conversation.messages.push({
id: randomUUID(),
content: response.data.choices[0]['message']['content'],
type: MessageType.Function,
type: MessageType.Assistant,
date: Date.now(),

@@ -465,3 +465,3 @@ name: function_name,

}
return messages; // Devolver los mensajes generados

@@ -468,0 +468,0 @@ }

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