Dsxir. Primitives. History
(dsxir v0.1.0)
Copy Markdown
Multi-turn conversation value type. Bind one to a signature input field whose
Zoi type is Dsxir.Primitives.History; the chat adapter materializes the
conversation into the prompt sequence.
Distinct from Dsxir.History (the inspect_history developer tool). The
name overlap mirrors DSPy's dspy.History (the value type) and
dspy.inspect_history (the debug helper).
Entries are plain maps to keep the struct cheap and serializable:
%Dsxir.Primitives.History{
messages: [
%{role: :user, content: "What is the capital of France?"},
%{role: :assistant, content: "Paris."}
]
}
Summary
Functions
Build a new conversation, optionally seeded with messages.
Append a message with the given role and content to the conversation.
Materialize as a list of %Sycophant.Message{} for adapter consumption.
Types
Functions
Build a new conversation, optionally seeded with messages.
Append a message with the given role and content to the conversation.
@spec to_messages(t()) :: [Sycophant.Message.t()]
Materialize as a list of %Sycophant.Message{} for adapter consumption.