Package com.tnsai.integration.scop
Class ChatTurn.Builder
java.lang.Object
com.tnsai.integration.scop.ChatTurn.Builder
- Enclosing class:
ChatTurn
Builds a
ChatTurn. Each setter replaces what an earlier call to
it set.- Since:
- 0.18.6
-
Method Summary
Modifier and TypeMethodDescriptionbindings(com.tnsai.rag.ChatKnowledgeBinding... bindings) Exact-owner-scoped live retrieval bindings: per listed owner at most one checked against its declarations and any number undeclared, no two of an owner searching the same source name, in any order.bindings(ChatKnowledgeBinding...)from a list.build()context(com.tnsai.rag.ChatRetrievalContext context) The immutable request-local scope and lifecycle context under which the owners' knowledge is given and searched.The exact objects whose@Stateand chat knowledge apply, such as an agent followed by every@RoleSpecrole it plays.owners(Object...)from a list.requestSection(String requestSection) A section the caller renders for this request alone, such as an agent's recent activity.tools(org.json.JSONArray tools)
-
Method Details
-
tools
- Parameters:
tools- provider-neutral tool declarations, ornullfor none- Returns:
- this builder
-
owners
The exact objects whose@Stateand chat knowledge apply, such as an agent followed by every@RoleSpecrole it plays. Each owner is passed itself, not inside aCollection.- Parameters:
owners- the owners, in order; none for a plain dispatch- Returns:
- this builder
- Throws:
NullPointerException- if the array isnull
-
owners
owners(Object...)from a list.- Parameters:
owners- the owners, in order; empty for a plain dispatch- Returns:
- this builder
- Throws:
NullPointerException- if the list isnull
-
bindings
Exact-owner-scoped live retrieval bindings: per listed owner at most one checked against its declarations and any number undeclared, no two of an owner searching the same source name, in any order.build()checks that each belongs to a listed owner; the rules among one owner's bindings are checked when the turn is sent. A turn without bindings leaves this out; anullbinding is refused.- Parameters:
bindings- the bindings- Returns:
- this builder
- Throws:
NullPointerException- if the array isnull
-
bindings
bindings(ChatKnowledgeBinding...)from a list.- Parameters:
bindings- the bindings- Returns:
- this builder
- Throws:
NullPointerException- if the list isnull
-
context
The immutable request-local scope and lifecycle context under which the owners' knowledge is given and searched.- Parameters:
context- the context, ornullfor no retrieval; a context needs at least one owner, as only owners have knowledge to retrieve- Returns:
- this builder
-
requestSection
A section the caller renders for this request alone, such as an agent's recent activity. It is added only to the outbound copy, at the end of the last system message and before any refreshed state, or as a new system message when there is none; its dynamic state markers are escaped.- Parameters:
requestSection- the section, ornullor blank for none- Returns:
- this builder
-
build
- Returns:
- the turn
- Throws:
NullPointerException- if an owner or a binding isnullIllegalArgumentException- if an owner is aCollectionor is listed twice, bindings or a retrieval context are given without owners, or a binding belongs to no listed owner
-