Mnemosyne.Prompt behaviour (mnemosyne v0.1.6)

Copy Markdown View Source

Behaviour for building LLM prompts and parsing responses.

Implementations construct message lists from template variables and extract structured data from raw LLM output.

Summary

Callbacks

build_messages(variables)

@callback build_messages(variables :: map()) :: [%{role: atom(), content: String.t()}]

parse_response(response)

@callback parse_response(response :: String.t()) ::
  {:ok, term()} | {:error, Mnemosyne.Errors.Invalid.PromptError.t()}