langchain.js
Preparing search index...
@langchain/community
document_compressors/ibm
WatsonxRerank
Class WatsonxRerank
Hierarchy (
View Summary
)
BaseDynamicToolInput
WatsonxRerank
Implements
WatsonxInputRerank
Index
Constructors
constructor
Properties
max
Concurrency?
max
Retries
model
project
Id?
return
Options?
service
service
Url
space
Id?
truncate
Input
Tokens?
version
Methods
compress
Documents
invocation
Params
rerank
scope
Id
Constructors
constructor
new
WatsonxRerank
(
fields
:
WatsonxInputRerank
&
WatsonxAuth
)
:
WatsonxRerank
Parameters
fields
:
WatsonxInputRerank
&
WatsonxAuth
Returns
WatsonxRerank
Properties
Optional
max
Concurrency
maxConcurrency
?:
number
max
Retries
maxRetries
:
number
= 0
model
model
:
string
Optional
project
Id
projectId
?:
string
Optional
return
Options
returnOptions
?:
{
inputs
?:
boolean
;
query
?:
boolean
;
topN
?:
number
}
service
service
:
WatsonxAiMlVml_v1
service
Url
serviceUrl
:
string
Optional
space
Id
spaceId
?:
string
Optional
truncate
Input
Tokens
truncateInputTokens
?:
number
version
version
:
string
= "2024-05-31"
Methods
compress
Documents
compressDocuments
(
documents
:
DocumentInterface
[]
,
query
:
string
,
)
:
Promise
<
DocumentInterface
[]
>
Parameters
documents
:
DocumentInterface
[]
query
:
string
Returns
Promise
<
DocumentInterface
[]
>
invocation
Params
invocationParams
(
options
?:
Partial
<
WatsonxInputRerank
>
,
)
:
{
return_options
:
{
inputs
:
undefined
|
boolean
;
top_n
:
undefined
|
number
;
}
;
truncate_input_tokens
:
undefined
|
number
;
}
Parameters
Optional
options
:
Partial
<
WatsonxInputRerank
>
Returns
{
return_options
:
{
inputs
:
undefined
|
boolean
;
top_n
:
undefined
|
number
;
}
;
truncate_input_tokens
:
undefined
|
number
;
}
rerank
rerank
(
documents
:
any
[]
,
query
:
string
,
options
?:
Partial
<
WatsonxInputRerank
>
,
)
:
Promise
<
{
index
:
number
;
input
?:
string
;
relevanceScore
:
number
}
[]
>
Parameters
documents
:
any
[]
query
:
string
Optional
options
:
Partial
<
WatsonxInputRerank
>
Returns
Promise
<
{
index
:
number
;
input
?:
string
;
relevanceScore
:
number
}
[]
>
scope
Id
scopeId
()
:
|
{
modelId
:
string
;
projectId
:
string
;
spaceId
?:
undefined
}
|
{
modelId
:
string
;
projectId
?:
undefined
;
spaceId
:
undefined
|
string
}
Returns
|
{
modelId
:
string
;
projectId
:
string
;
spaceId
?:
undefined
}
|
{
modelId
:
string
;
projectId
?:
undefined
;
spaceId
:
undefined
|
string
}
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
max
Concurrency
max
Retries
model
project
Id
return
Options
service
service
Url
space
Id
truncate
Input
Tokens
version
Methods
compress
Documents
invocation
Params
rerank
scope
Id
langchain.js
Loading...