Skip to content

Custom prompt in summarization chain #1072

Answered by giuice
giuice asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know if works, but I'm doing this way with map_reduce(I believe this will work better for stuff, just to exemplify)

const output = await this.splitter.createDocuments([t.text]);
      const template = `TLDR; the following text,  The focus should be on identifying and analyzing the strategies the author uses to make their point, rather than summarizing the passage:
			Title: ${t.title}

			"{text}"


			CONCISE SUMMARY:`;
      const myPrompt = new PromptTemplate({
        template,
        inputVariables: ["text"],
      });
      const res = await loadSummarizationChain(this.model, {
        type: "map_reduce",
        combineMapPrompt: myPrompt,
      }).call({
        input_doc…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by giuice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant