Context
LlmGenerateTextResult.message.content is typed as string | LlmContentBlock[]. For all currently supported providers (Claude, OpenAI), it is always a LlmContentBlock[] — so the obvious result.data.message.content as string yields [object Object] at runtime. Extracting the plain text requires importing extractText from @loopstack/llm-provider-module, which is not surfaced in any public doc and is only discoverable by reading source.
What to do
Make "give me the text" the obvious operation on an LlmGenerateText result.
Affected area
- Package(s):
@loopstack/llm-provider-module
- Docs:
build/ai/text-generation.md
Acceptance criteria
Additional context
Surfaced during a benchmark agent session where the agent extracted the wrong thing from the result, saved a malformed message document, and could not see why the summary did not render in Studio.
Context
LlmGenerateTextResult.message.contentis typed asstring | LlmContentBlock[]. For all currently supported providers (Claude, OpenAI), it is always aLlmContentBlock[]— so the obviousresult.data.message.content as stringyields[object Object]at runtime. Extracting the plain text requires importingextractTextfrom@loopstack/llm-provider-module, which is not surfaced in any public doc and is only discoverable by reading source.What to do
Make "give me the text" the obvious operation on an
LlmGenerateTextresult.Affected area
@loopstack/llm-provider-modulebuild/ai/text-generation.mdAcceptance criteria
Additional context
Surfaced during a benchmark agent session where the agent extracted the wrong thing from the result, saved a malformed message document, and could not see why the summary did not render in Studio.