View Source Magma.Concept (Magma v0.2.0)

The basic Magma document type used for generating concrete artefacts.

It contains all user-contributed content necessary for artefact generation, such as descriptions of the subject matter, background knowledge, and task descriptions for various artefacts.

This module provides functions for creating, loading and updating these concept documents, as well as functions for accessing specific sections of the document such as the description and context knowledge sections. It also allows for the creation of prompts based on a concept.

Summary

Functions

Creates a new concept document for a given subject matter in the Magma.Vault.

Creates a new concept document for a given subject matter in the Magma.Vault.

Fetches a document from a related document and immediately loads it with load!/1

Loads a document from the given path or document.

Loads a document from the given path or document and raises an exception in error cases.

Loads a document from the given Obsidian link, i.e. a string of the form "[[name]]".

Creates a new concept document struct for a given subject matter.

Types

@type t() :: %Magma.Concept{
  aliases: term(),
  content: term(),
  created_at: term(),
  custom_metadata: term(),
  name: term(),
  path: term(),
  prologue: term(),
  sections: term(),
  subject: term(),
  tags: term(),
  title: term()
}

Functions

Link to this function

context_knowledge_section(concept)

View Source
Link to this function

context_knowledge_section_title()

View Source
Link to this function

create(subject, attrs \\ [], opts \\ [])

View Source

Creates a new concept document for a given subject matter in the Magma.Vault.

Link to this function

create!(subject, attrs \\ [], opts \\ [])

View Source

Creates a new concept document for a given subject matter in the Magma.Vault.

Fails in error cases.

Link to this function

create_prompts(concept, opts \\ [])

View Source
Link to this function

description_section(concept)

View Source
Link to this function

description_section_title()

View Source

See Magma.DocumentStruct.fetch/2.

Fetches a document from a related document and immediately loads it with load!/1

Loads a document from the given path or document.

If the loaded document is not of the proper document type an Magma.InvalidDocumentType exception is returned in an :error tuple.

Loads a document from the given path or document and raises an exception in error cases.

Loads a document from the given Obsidian link, i.e. a string of the form "[[name]]".

If the referenced document is not of the proper document type an Magma.InvalidDocumentType exception is returned in an :error tuple.

Link to this function

new(subject, attrs \\ [])

View Source

Creates a new concept document struct for a given subject matter.

Note, this function doesn't create the document in the Magma.Vault. Use create/3 for this purpose.

Link to this function

new!(subject, attrs \\ [])

View Source
Link to this function

update_content_from_ast(concept)

View Source
@spec update_content_from_ast(t()) :: t()