Uses of Class
com.tnsai.llm.ChatChunk
Packages that use ChatChunk
Package
Description
Agent classes and lifecycle management for the TnsAI framework.
Agent orchestration — chat, streaming, tool execution, and knowledge base management.
Streaming and event-based chat operations with token-level granularity and event publishing.
LLM (Large Language Model) client interfaces and abstractions.
-
Uses of ChatChunk in com.tnsai.agents
Method parameters in com.tnsai.agents with type arguments of type ChatChunkModifier and TypeMethodDescriptionfinal StringAgent.streamChatWithRetrievedContext(String outboundMessage, String historyMessage, Consumer<ChatChunk> handler) Streams canonically fenced retrieved context while persisting only the original user message.final StringAgent.streamChatWithRetrievedContext(String outboundMessage, String historyMessage, Consumer<ChatChunk> handler, ChatRetrievalContext retrievalContext) Streams pre-rendered evidence with request-local retrieval lifecycle context.final StringAgent.streamChatWithTools(String message, Consumer<ChatChunk> handler) Streams response with full tool-calling loop.final StringAgent.streamChatWithTools(String message, Consumer<ChatChunk> handler, ChatRetrievalContext retrievalContext) Streams tools with request-local retrieval isolation and lifecycle context. -
Uses of ChatChunk in com.tnsai.agents.orchestration
Method parameters in com.tnsai.agents.orchestration with type arguments of type ChatChunkModifier and TypeMethodDescriptionAgentOrchestrator.streamChatWithRetrievedContext(String outboundMessage, String historyMessage, Consumer<ChatChunk> handler) AgentOrchestrator.streamChatWithRetrievedContext(String outboundMessage, String historyMessage, Consumer<ChatChunk> handler, ChatRetrievalContext retrievalContext) AgentOrchestrator.streamChatWithTools(String message, Consumer<ChatChunk> handler) AgentOrchestrator.streamChatWithTools(String message, Consumer<ChatChunk> handler, ChatRetrievalContext retrievalContext) -
Uses of ChatChunk in com.tnsai.agents.streaming
Method parameters in com.tnsai.agents.streaming with type arguments of type ChatChunkModifier and TypeMethodDescriptionAgentStreamingSupport.streamChatWithTools(String message, String requestSystemPrompt, Consumer<ChatChunk> handler) AgentStreamingSupport.streamChatWithTools(String message, String requestSystemPrompt, Consumer<ChatChunk> handler, ChatRetrievalContext retrievalContext) AgentStreamingSupport.streamChatWithTools(String message, Consumer<ChatChunk> handler) Streams a response with full tool calling support via ChatChunk callbacks. -
Uses of ChatChunk in com.tnsai.hooks.events
Methods in com.tnsai.hooks.events that return ChatChunkModifier and TypeMethodDescriptionOnChunk.chunk()Returns the value of thechunkrecord component.Methods in com.tnsai.hooks.events with parameters of type ChatChunkModifier and TypeMethodDescriptionBuild a copy withnewChunkreplacingOnChunk.chunk.Constructors in com.tnsai.hooks.events with parameters of type ChatChunkModifierConstructorDescriptionOnChunk(String eventId, Instant timestamp, HookContext context, ChatChunk chunk, long chunkIndex) Creates an instance of aOnChunkrecord class. -
Uses of ChatChunk in com.tnsai.llm
Methods in com.tnsai.llm that return ChatChunkModifier and TypeMethodDescriptionstatic ChatChunkCreates a CONTENT chunk with text token.static ChatChunkCreates a CONTENT chunk with metadata.static ChatChunkCreates a CONTENT chunk with full metadata.static ChatChunkChatChunk.done(ChatChunk.FinishReason reason, int totalTokens) Creates a DONE chunk indicating successful completion.static ChatChunkChatChunk.done(ChatChunk.FinishReason reason, int totalTokens, String model, String requestId) Creates a DONE chunk with full metadata.static ChatChunkCreates an ERROR chunk.static ChatChunkCreates a START chunk indicating stream beginning.static ChatChunkChatChunk.toolCall(ChatResponse.ToolCall toolCall) Creates a TOOL_CALL chunk with structured ToolCall data.static ChatChunkCreates a TOOL_CALL chunk with JSON content.Methods in com.tnsai.llm that return types with arguments of type ChatChunkModifier and TypeMethodDescriptionLLMClient.streamChatWithSpec(ChatRequest request) Streams a chat response with rich metadata using the unifiedChatRequestmodel.LLMClient.streamChatWithSpec(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) Sends a chat message and streams the response with rich metadata.Method parameters in com.tnsai.llm with type arguments of type ChatChunkModifier and TypeMethodDescriptiondefault voidLLMClient.streamChatWithHandler(ChatRequest request, Consumer<ChatChunk> handler) Streams a chat response via callbacks using the unifiedChatRequestmodel.default voidLLMClient.streamChatWithHandler(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools, Consumer<ChatChunk> handler) Streams a chat response via callbacks, supporting both text deltas and tool calls.