---
title: "LLM Streaming in the Embabel Agentic AI Framework"
url: https://daily.dev/posts/llm-streaming-in-the-embabel-agentic-ai-framework-sucft0aas
source_url: https://feeds.feedblitz.com/~/968282549/0/baeldung
type: article
source: "Baeldung"
published: 2026-08-26T22:15:00.693Z
updated: 2026-08-26T22:21:28.221Z
tags: ["java", "spring-ai", "langchain4j"]
reading_time: 13
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# LLM Streaming in the Embabel Agentic AI Framework

**[Baeldung](https://daily.dev/sources/baeldung)** · 13 min read · 0 upvotes · 0 comments

## Summary

A tutorial demonstrates how to stream structured output from LLMs using the Embabel Agentic AI Framework in Java, contrasting it with Spring AI and LangChain4j, which only support raw text streaming and not native parsing into typed objects. It walks through four progressively complex scenarios using Anthropic's claude-sonnet-4-5 model: streaming a single object, multiple objects, objects with reasoning (thinking blocks), and objects combined with tool calls and reasoning. Embabel's createObjectStream() and createObjectStreamWithThinking() APIs handle buffering, JSON parsing, and separating reasoning from structured objects automatically, removing boilerplate developers would otherwise need to write themselves.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://feeds.feedblitz.com/~/968282549/0/baeldung>

## Questions this post answers

### Can Spring AI's ChatClient entity() method be used with the reactive stream() method to get typed objects?

No, Spring AI's entity() method for converting model output into a Java object only works with the blocking call() method, not with stream(). The ChatClient API reference states a convenience method for returning a Java entity with the reactive stream() method is planned for the future, and recommends using the Structured Output Converter in the meantime.

_Developers wiring up structured LLM streaming in Spring AI can track framework gaps like this via daily.dev._

### How do I stream typed Java objects with reasoning and tool calls using Embabel?

Use createObjectStreamWithThinking() from StreamingPromptRunnerBuilder, which returns a Flux of StreamingEvent wrapping typed objects and reasoning fragments. Check event.isObject() and event.isThinking() in doOnNext() to separate parsed objects from reasoning text. When tools are registered via withToolObject(), the model calls tools first, reasons over results, then emits objects, followed by a reasoning summary.

_Teams building agentic Java apps with reasoning and tool calls can compare approaches like this on daily.dev._

### Does LangChain4j's AiServices support returning custom POJOs when streaming LLM responses?

No, LangChain4j's AiServices only allows returning custom POJOs, lists, and enums for non-streaming calls. For streaming, the return type must be a TokenStream, which provides raw text as it arrives plus callback hooks, but does not provide typed objects as stream output.

_Java developers evaluating LangChain4j versus alternatives for structured streaming can dig deeper on daily.dev._

## Similar posts on daily.dev

- [LLM Tool Call Reasoning Using Embabel Agentic AI Framework](https://daily.dev/posts/llm-tool-call-reasoning-using-embabel-agentic-ai-framework-uucsie3do) · Baeldung · 2 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#spring-ai](https://daily.dev/tags/spring-ai), [#langchain4j](https://daily.dev/tags/langchain4j)

[View this post on daily.dev](https://daily.dev/posts/llm-streaming-in-the-embabel-agentic-ai-framework-sucft0aas)
