Skip to content

Commit

Permalink
Delete keyword Chat-GPT
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo-ma committed Feb 7, 2023
1 parent 079196d commit c1c12e6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ await new Command()
new Command()
.option(
"-t, --target <target:string>",
"Specify the target data name or file path to send to ChatGPT.",
"Specify the target data name or file path to send to GPT-3 API.",
)
.option(
"-o, --output <output:string>",
"Specify to output file path of generated post-process.",
)
.arguments("<prompt:string>")
.description(
"Auto-generate code about target data using ChatGPT. \nFor example, conversion processing, visualization processing, etc.",
"Auto-generate code about target data using GPT-3 API. \nFor example, conversion processing, visualization processing, etc.",
)
.action(new GenerateAction().execute),
)
Expand Down
6 changes: 3 additions & 3 deletions libs/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DimFileAccessor, DimLockFileAccessor } from "./accessor.ts";
import { CkanApiClient } from "./ckan_api_client.ts";
import { createDataFilesDir, initDimFile, initDimLockFile } from "./action_helper/initializer.ts";
import { installFromDimFile, installFromURL, interactiveInstall, parseHeader } from "./action_helper/installer.ts";
import { ChatGPTClient } from "./chatgpt_client.ts";
import { OpenAIClient } from "./openai_client.ts";
import { ConsoleAnimation } from "./console_animation.ts";

export class InitAction {
Expand Down Expand Up @@ -376,7 +376,7 @@ export class GenerateAction {
const dataNameList = dimLockFileAccessor.getContents().map((c) => c.name);
if (!target) {
target = await Input.prompt({
message: "Enter the target data name or file path to send to ChatGPT.",
message: "Enter the target data name or file path to send to GPT-3 API.",
hint: `${dataNameList.join(", ").slice(0, 50)}... or target file path])`,
suggestions: dataNameList,
validate: (text) => {
Expand All @@ -403,7 +403,7 @@ export class GenerateAction {
`Generate a code ...`,
);
consoleAnimation.start(100);
const response = await new ChatGPTClient().request(`${targetData}\n${prompt}`);
const response = await new OpenAIClient().request(`${targetData}\n${prompt}`);
if (!response) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/chatgpt_client.ts → libs/openai_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Colors, ky } from "../deps.ts";
import { OPENAPI_COMPLETIONS_ENDPOINT } from "./consts.ts";
import { OpenAICompletionsResponse } from "./types.ts";

export class ChatGPTClient {
export class OpenAIClient {
private apiKey;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion tests/libs/actions.generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe("GenerateAction", () => {
);
assertEquals(
targetInputPromptMessage,
"Enter the target data name or file path to send to ChatGPT.",
"Enter the target data name or file path to send to GPT-3 API.",
);
assert(targetInputPromptValidate("test"));
assertFalse(targetInputPromptValidate(""));
Expand Down

0 comments on commit c1c12e6

Please sign in to comment.