Normandy.Components.ContextProvider protocol (normandy v0.2.0)
View SourceProtocol for providing additional context information to agents.
Context providers supply extra information that can be included in system prompts, such as current date/time, user preferences, system state, etc.
Example
defmodule DateTimeProvider do
defstruct []
defimpl Normandy.Components.ContextProvider do
def title(_), do: "Current Date and Time"
def get_info(_) do
DateTime.utc_now() |> DateTime.to_string()
end
end
end
Summary
Functions
Returns the context information as a string.
Returns the title for this context section in the prompt.
Types
@type t() :: term()
All the types that implement this protocol.