Package com.tnsai.integration.activity
Class ActivityBlock
java.lang.Object
com.tnsai.integration.activity.ActivityBlock
Renders an agent's
AgentActivity as the block its LLM reads: one line per entry, oldest
first, written to the agent in the second person.
Peers are named by the function the caller passes, so the block names them the way the rest
of the agent's prompt does; those names are rendered as the function gives them, neither
redacted nor cut short. Every line is kept on one line: a line break or a separator control
character (U+001C to U+001E) in a text, a peer's name or a type is rendered as a
space, so what an entry carries cannot start a line of its own. A text that was cut short ends
with " [cut]".
- Since:
- 0.18.5
-
Method Summary
-
Method Details
-
render
public static <P> String render(List<? extends AgentActivity.Entry<P>> entries, Function<? super P, String> name) Renders entries as the block.- Type Parameters:
P- how the record identifies a peer- Parameters:
entries- the record's entries, oldest firstname- names a peer; anullname falls back toString.valueOf(peer)- Returns:
- the block, ending with a line break, or the empty string when there are no entries
- Throws:
NullPointerException- ifentriesornameisnull- Since:
- 0.18.5
-