Skip to content

Commit

Permalink
refactor: improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedied committed Sep 1, 2023
1 parent 40e772c commit 4983a2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/api/src/lib/approaches/ask-retrieve-then-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ export class AskRetrieveThenRead extends ApproachBase implements AskApproach {
super(search, openai, chatGptModel, sourcePageField, contentField);
}

async run(q: string, overrides: Record<string, any>): Promise<any> {
const { query, results, content } = await this.searchDocuments(q, overrides);
async run(userQuery: string, overrides: Record<string, any>): Promise<any> {
const { query, results, content } = await this.searchDocuments(userQuery, overrides);
const messageBuilder = new MessageBuilder(overrides?.prompt_template || SYSTEM_CHAT_TEMPLATE, this.chatGptModel);

// Add user question
const userContent = `${q}\nSources:\n${content}`;
const userContent = `${userQuery}\nSources:\n${content}`;
messageBuilder.appendMessage('user', userContent);

// Add shots/samples. This helps model to mimic response and make sure they match rules laid out in system message.
Expand Down

0 comments on commit 4983a2c

Please sign in to comment.