Remove getTime model function
it lead to higher usage of tokens.
This commit is contained in:
parent
722862ded3
commit
02a5b0f7b9
2 changed files with 1 additions and 28 deletions
|
@ -1,7 +1,5 @@
|
|||
import { ChatCompletionCreateParams, ChatCompletionMessage, ChatCompletionMessageParam } from "openai/resources/chat";
|
||||
|
||||
import { config } from "./index";
|
||||
|
||||
type parameterMap = {
|
||||
string: string,
|
||||
number: number,
|
||||
|
@ -53,7 +51,7 @@ export default class FunctionManager {
|
|||
store = new Map<string, OpenAIFunction>();
|
||||
|
||||
constructor() {
|
||||
this.store.set("getTime", new GetTime());
|
||||
// TODO: import functions from functions directory
|
||||
}
|
||||
|
||||
public getFunctions(): ChatCompletionFunctions[] {
|
||||
|
@ -95,18 +93,3 @@ export default class FunctionManager {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
// buildins
|
||||
|
||||
class GetTime extends OpenAIFunction<Record<string, never>> {
|
||||
name = "getTime";
|
||||
description = "Gets current date and time with a timezone attached";
|
||||
parameters = {
|
||||
type: "object" as const,
|
||||
properties: {} as Record<string, never>,
|
||||
};
|
||||
|
||||
execute(): string {
|
||||
return `${Intl.DateTimeFormat().resolvedOptions().timeZone}): ${new Date().toLocaleString("en-US", config.calendarParams)}`;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue