RerankerCreationRequest
Rust struct goodmem::models::RerankerCreationRequest: declaration, fields or variants, and implementations.
Struct RerankerCreationRequest
goodmem::models::RerankerCreationRequest
Request body for creating a new Reranker. A Reranker represents a configuration for reranking search results.
pub struct RerankerCreationRequest {
pub display_name: String,
pub description: Option<String>,
pub provider_type: ProviderType,
pub endpoint_url: String,
pub api_path: Option<String>,
pub model_identifier: String,
pub supported_modalities: Option<Vec<Modality>>,
pub credentials: Option<Box<EndpointAuthentication>>,
pub labels: Option<BTreeMap<String, String>>,
pub version: Option<String>,
pub monitoring_endpoint: Option<String>,
pub owner_id: Option<String>,
pub reranker_id: Option<String>,
pub dashscope_api_dialect: Option<DashScopeApiDialect>,
pub input_format: Option<Box<ModelInputFormat>>,
}Referenced types: DashScopeApiDialect, EndpointAuthentication, Modality, ModelInputFormat, ProviderType.
Fields
display_name
pub display_name: String
User-facing name of the reranker
Wire name: displayName.
description
pub description: Option<String>
Description of the reranker
Wire name: description.
provider_type
pub provider_type: ProviderType
Type of reranking provider
Wire name: providerType.
endpoint_url
pub endpoint_url: String
API endpoint URL
Wire name: endpointUrl.
api_path
pub api_path: Option<String>
API path for reranking request (defaults: Cohere /v2/rerank, Jina /v1/rerank, others /rerank)
Wire name: apiPath.
model_identifier
pub model_identifier: String
Model identifier
Wire name: modelIdentifier.
supported_modalities
pub supported_modalities: Option<Vec<Modality>>
Supported content modalities (defaults to TEXT if not provided)
Wire name: supportedModalities.
credentials
pub credentials: Option<Box<EndpointAuthentication>>
Structured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers.
Wire name: credentials.
labels
pub labels: Option<BTreeMap<String, String>>
User-defined labels for categorization
Wire name: labels.
version
pub version: Option<String>
Version information
Wire name: version.
monitoring_endpoint
pub monitoring_endpoint: Option<String>
Monitoring endpoint URL
Wire name: monitoringEndpoint.
owner_id
pub owner_id: Option<String>
Optional owner principal UUID. If omitted, defaults to the authenticated principal. CREATE_RERANKER is evaluated against the proposed reranker and owner.
Wire name: ownerId.
reranker_id
pub reranker_id: Option<String>
Optional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use.
Wire name: rerankerId.
dashscope_api_dialect
pub dashscope_api_dialect: Option<DashScopeApiDialect>
DashScope request and response API dialect. Valid only for the DASHSCOPE provider. Omit to infer the dialect from apiPath, the model catalog, or the native reranking default.
Wire name: dashscopeApiDialect.
input_format
pub input_format: Option<Box<ModelInputFormat>>
Instruction and templates applied to query and candidate text before reranking. Accepted for every provider. An instruction that queryTemplate does not read is sent in the provider's instruction field, which the VLLM and DASHSCOPE providers have; for any other provider it is rejected.
Wire name: inputFormat.
Implementations
validate
pub fn validate(&self) -> crate::Result<()>
Validate the request before sending, without making an HTTP call.
from_model
pub fn from_model(model: &str, api_key: Option<&str>) ->Result<Self>
Fill known provider defaults; explicit request structs support custom models.
Trait implementations
Clone(derived)Default(derived)PartialEq(derived)Serialize(derived)impl<'de> Deserialize<'de> for RerankerCreationRequestimpl std::fmt::Debug for RerankerCreationRequest