chatgpt-optimized-official
Advanced tools
Comparing version 1.1.3 to 1.1.5
@@ -19,2 +19,3 @@ import Usage from "../models/chatgpt-usage.js"; | ||
askStream(data: (arg0: string) => void, usage: (usage: Usage) => void, prompt: string, conversationId?: string, userName?: string): Promise<string>; | ||
askV1(prompt: string, conversationId?: string, userName?: string, type?: number): Promise<any>; | ||
askPost(data: (arg0: string) => void, usage: (usage: Usage) => void, prompt: string, conversationId?: string, userName?: string, type?: number): Promise<any>; | ||
@@ -21,0 +22,0 @@ moderate(prompt: string, key: string): Promise<boolean>; |
@@ -115,3 +115,2 @@ import axios from "axios"; | ||
let conversation = this.db.conversations.Where((conversation) => conversation.id == conversationId).FirstOrDefault(); | ||
console.log(conversation); | ||
if (conversation) { | ||
@@ -140,3 +139,2 @@ conversation.messages = []; | ||
let promptStr = this.generatePrompt(conversation, prompt); | ||
console.log(promptStr); | ||
let prompt_tokens = this.countTokens(promptStr); | ||
@@ -223,2 +221,5 @@ try { | ||
} | ||
async askV1(prompt, conversationId = "default", userName = "User", type = 1) { | ||
return await this.askPost((data) => { }, (data) => { }, prompt, conversationId, userName, type); | ||
} | ||
async askPost(data, usage, prompt, conversationId = "default", userName = "User", type = MessageType.User) { | ||
@@ -225,0 +226,0 @@ let oAIKey = this.getOpenAIKey(); |
{ | ||
"name": "chatgpt-optimized-official", | ||
"version": "1.1.3", | ||
"version": "1.1.5", | ||
"description": "ChatGPT Client using official OpenAI API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -167,3 +167,3 @@ import axios from "axios"; | ||
let promptStr = this.generatePrompt(conversation, prompt); | ||
console.log(promptStr); | ||
//console.log(promptStr); | ||
let prompt_tokens = this.countTokens(promptStr); | ||
@@ -170,0 +170,0 @@ try { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
117917
1686