Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "OpenAI.Chat.CompletionCreateParams" to "OpenAI.Chat.ChatCompletionCreateParams" #14

Closed
plungarini opened this issue Sep 26, 2023 · 1 comment · Fixed by #15
Closed

Comments

@plungarini
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

OpenAi upgraded the packages modifying the typo.

Here is the diff that solved my problem:

diff --git a/node_modules/openai-chat-tokens/dist/functions.d.ts b/node_modules/openai-chat-tokens/dist/functions.d.ts
index ffe11a1..6bdc60f 100644
--- a/node_modules/openai-chat-tokens/dist/functions.d.ts
+++ b/node_modules/openai-chat-tokens/dist/functions.d.ts
@@ -1,5 +1,5 @@
 import OpenAI from "openai";
-type OpenAIFunction = OpenAI.Chat.CompletionCreateParams.Function;
+type OpenAIFunction = OpenAI.Chat.ChatCompletionCreateParams.Function;
 export interface FunctionDef extends Omit<OpenAIFunction, "parameters"> {
     name: string;
     description?: string;
@@ -31,4 +31,5 @@ type Prop = {
     items?: Prop;
 });
 export declare function formatFunctionDefinitions(functions: FunctionDef[]): string;
-export {};
+export { };
+
diff --git a/node_modules/openai-chat-tokens/dist/index.d.ts b/node_modules/openai-chat-tokens/dist/index.d.ts
index 6a4ae41..59a9bd5 100644
--- a/node_modules/openai-chat-tokens/dist/index.d.ts
+++ b/node_modules/openai-chat-tokens/dist/index.d.ts
@@ -1,8 +1,8 @@
 import OpenAI from "openai";
 import { FunctionDef } from "./functions";
 type Message = OpenAI.Chat.CreateChatCompletionRequestMessage;
-type Function = OpenAI.Chat.CompletionCreateParams.Function;
-type FunctionCall = OpenAI.Chat.CompletionCreateParams.FunctionCallOption;
+type Function = OpenAI.Chat.ChatCompletionCreateParams.Function;
+type FunctionCall = OpenAI.Chat.ChatCompletionCreateParams.FunctionCallOption;
 /**
  * Estimate the number of tokens a prompt will use.
  * @param {Object} prompt OpenAI prompt data
@@ -35,4 +35,5 @@ export declare function messageTokensEstimate(message: Message): number;
  * @returns An estimate for the number of tokens the function definitions will use
  */
 export declare function functionsTokensEstimate(funcs: FunctionDef[]): number;
-export {};
+export { };
+

This issue body was partially generated by patch-package.

hmarr added a commit that referenced this issue Sep 28, 2023
@hmarr hmarr closed this as completed in #15 Sep 28, 2023
hmarr added a commit that referenced this issue Sep 28, 2023
@hmarr
Copy link
Owner

hmarr commented Sep 28, 2023

Thanks for reporting! Fixed in #15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants