GoodMemGoodMem
ReferenceSdkRustTypes

JsonMemoryCreationRequest

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

All types

Struct JsonMemoryCreationRequest

goodmem::models::JsonMemoryCreationRequest

Request body for creating a new Memory. A Memory represents content stored in a space.

pub struct JsonMemoryCreationRequest {
    pub memory_id: Option<String>,
    pub space_id: String,
    pub original_content: Option<String>,
    pub original_content_b64: Option<String>,
    pub original_content_ref: Option<String>,
    pub content_type: String,
    pub metadata: Option<BTreeMap<String, serde_json::Value>>,
    pub chunking_config: Option<Box<ChunkingConfiguration>>,
    pub extract_page_images: Option<bool>,
    pub file_field: Option<String>,
}

Referenced types: ChunkingConfiguration.

Fields

memory_id

pub memory_id: Option<String>

Optional client-provided UUID for the memory. If omitted, the server generates one. Returns ALREADY_EXISTS if the ID is already in use. Wire name: memoryId.

space_id

pub space_id: String

ID of the space where this memory will be stored Wire name: spaceId.

original_content

pub original_content: Option<String>

Original content as plain text (use either this or originalContentB64) Wire name: originalContent.

original_content_b64

pub original_content_b64: Option<String>

Original content as base64-encoded binary data (use either this or originalContent) Wire name: originalContentB64.

original_content_ref

pub original_content_ref: Option<String>

Reference to external content location Wire name: originalContentRef.

content_type

pub content_type: String

MIME type of the content Wire name: contentType.

metadata

pub metadata: Option<BTreeMap<String, serde_json::Value>>

Additional metadata for the memory. A top-level textual title is an optional document-title hint for embedding providers that support one; blank or non-string titles are ignored. Later metadata edits do not automatically re-embed existing chunks. Wire name: metadata.

chunking_config

pub chunking_config: Option<Box<ChunkingConfiguration>>

Chunking strategy for this memory (if not provided, uses space default) Wire name: chunkingConfig.

extract_page_images

pub extract_page_images: Option<bool>

Optional hint to extract page images for eligible document types (for example, PDFs) Wire name: extractPageImages.

file_field

pub file_field: Option<String>

Optional multipart file field name to bind binary content; required when multiple files are uploaded in a batch multipart request. Wire name: fileField.

Implementations

validate

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

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

text

pub fn text(space_id: impl Into<String>, text: impl Into<String>) -> Self

Create a plain-text memory request.

bytes

pub fn bytes( space_id: impl Into<String>, bytes: &[u8], content_type: impl Into<String>, ) -> Self

Encode binary content as base64 with an explicit MIME type.

Trait implementations

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

On this page