new Summarizer(openaiApiKey)
Parameters:
Name | Type | Description |
---|---|---|
openaiApiKey |
string |
- Source:
Methods
(async) openAIComplete(prompt)
Parameters:
Name | Type | Description |
---|---|---|
prompt |
Array.<{role: string, content: string}> |
- Source:
(async) parallelizeSummarization(context, text, maxTokens, parallelProcesses) → {Promise.<string>}
Parallelizes the summarization process.
Parameters:
Name | Type | Description |
---|---|---|
context |
Object | |
text |
string | |
maxTokens |
number | |
parallelProcesses |
number |
- Source:
Returns:
The summarized text.
- Type
- Promise.<string>
(async) retrySummarization(context, text, maxTokens)
Parameters:
Name | Type | Description |
---|---|---|
context |
Object | |
text |
string | |
maxTokens |
number |
- Source:
summarizePrompt(textData, chunkDataopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
textData |
Object | ||
chunkData |
Object |
<optional> |
- Source:
(async) summarizeText(textData, chunkDataopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
textData |
Object | ||
chunkData |
Object |
<optional> |
- Source:
(async, static) splitLongSentenceIntoChunks(sentence, maxTokens)
Parameters:
Name | Type | Description |
---|---|---|
sentence |
string | |
maxTokens |
number |
- Source:
(async, static) splitTextIntoChunks(text, maxTokens)
Parameters:
Name | Type | Description |
---|---|---|
text |
string | |
maxTokens |
number |
- Source: