Skip to content

Commit

Permalink
feat: rename PromptService to ConversationPromptService
Browse files Browse the repository at this point in the history
  • Loading branch information
Yengas committed Dec 29, 2022
1 parent 5c49054 commit 417635f
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Types and utility functions to easily generate OpenAI GPT prompts for chatting w

```typescript
import { Configuration, OpenAIApi } from "openai";
import { AIPersona, ModelConfiguration, PromptService } from "@wisegpt/gpt-conversation-prompt";
import { AIPersona, ModelConfiguration, ConversationPromptService } from "@wisegpt/gpt-conversation-prompt";

const aiPersona: AIPersona = {
name: "wiseGPT",
Expand All @@ -21,10 +21,10 @@ const modelConfiguration: ModelConfiguration = {
};

const openAIApi = new OpenAIApi(new Configuration({ apiKey: "<<your-secret>>" }));
const promptService = new PromptService(openAIApi);
const conversationPromptService = new ConversationPromptService(openAIApi);

async function exampleUsage() {
const { text, usage } = await promptService.conversationCompletion({
const { text, usage } = await conversationPromptService.conversationCompletion({
prompt: {
conversation: {
messages: [
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ConversationCompleteOutput,
} from "./prompt.dto";

export class PromptService {
export class ConversationPromptService {
constructor(private readonly openAIApi: OpenAIApi) {}

async conversationCompletion(
Expand Down
2 changes: 2 additions & 0 deletions src/conversation-prompt/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./prompt.dto";
export { ConversationPromptService } from "./conversation-prompt.service";
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./types";
export * from "./prompt-service";
export * from "./conversation-prompt";
2 changes: 0 additions & 2 deletions src/prompt-service/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AIPersona } from "../../src";
import { createConversationCompletionPrompt } from "../../src/prompt-service/create-conversation-completion-prompt";
import { createConversationCompletionPrompt } from "../../src/conversation-prompt/create-conversation-completion-prompt";

describe("createConversationCompletionPrompt", () => {
it("should work with example conversations", () => {
Expand Down

0 comments on commit 417635f

Please sign in to comment.