GoodMemGoodMem
ReferenceSdkRustTypes

ModelInputFormat

Rust struct goodmem::models::ModelInputFormat: declaration, fields or variants, and implementations.

All types

Struct ModelInputFormat

goodmem::models::ModelInputFormat

Instruction and query/document templates that shape the text GoodMem sends to an embedder or reranker. Each template must output {{ content }} exactly once without filtering it. See Model input formats (<https://docs.goodmem.ai/docs/reference/input-formats>) for provider policy, syntax, limits, updates, and request overrides.

pub struct ModelInputFormat {
    pub instruction: Option<String>,
    pub query_template: Option<String>,
    pub document_template: Option<String>,
}

Fields

instruction

pub instruction: Option<String>

Plain-text task instruction. It is not a template. A blank value counts as not set. Instructions and templates cannot contain U+0000 (NUL). Wire name: instruction.

query_template

pub query_template: Option<String>

Template applied to query text. It can read content and instruction. An empty value counts as not set. Wire name: queryTemplate.

document_template

pub document_template: Option<String>

Template applied to document text. It can read content, memory.metadata.<key> (string, number, and boolean values of top-level metadata keys; anything else renders empty), memory.createdAt (ISO-8601, UTC, three fractional-second digits), and chunk.sequenceNumber (zero-based). These template identifiers keep this spelling in every SDK. Metadata strings are trimmed, whitespace runs become one space, and values are cut to 256 Unicode code points. An empty value counts as not set. Wire name: documentTemplate.

Implementations

validate

pub fn validate(&self) -> crate::Result<()>

Validate the request before sending, without making an HTTP call.

Trait implementations

  • Clone (derived)
  • Default (derived)
  • PartialEq (derived)
  • Serialize (derived)
  • impl<'de> Deserialize<'de> for ModelInputFormat
  • impl std::fmt::Debug for ModelInputFormat

On this page