Skip to content

Add getTextContent for array-format message content#11

Merged
jpr5 merged 1 commit intomainfrom
feat/array-content-support
Mar 5, 2026
Merged

Add getTextContent for array-format message content#11
jpr5 merged 1 commit intomainfrom
feat/array-content-support

Conversation

@jpr5
Copy link
Copy Markdown
Contributor

@jpr5 jpr5 commented Mar 4, 2026

Summary

  • matchFixture now handles message content sent as [{type: "text", text: "..."}] (used by Strands SDK and others) in addition to plain strings
  • Previously rejected non-string content with typeof msg.content !== "string", causing all array-content requests to fall through to the catch-all fixture
  • Exports getTextContent from the package index for external consumers
  • Adds typed ContentPart to ChatMessage.content type union

Test plan

  • 390 existing + new tests pass
  • New tests cover: array content matching, regexp matching, multi-part concatenation, non-text parts skipping

🤖 Generated with Claude Code

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 4, 2026

Open in StackBlitz

npm i https://pkg.pr.new/CopilotKit/llmock/@copilotkit/llmock@11

commit: 3c49c35

@jpr5 jpr5 force-pushed the feat/array-content-support branch from 78ddbd3 to a5dac15 Compare March 4, 2026 23:01
getTextContent now supports ContentPart[] content (e.g. [{type:"text", text:"..."}])
as sent by some SDKs like Strands. Empty-string text parts are filtered out,
returning null instead of "".
@jpr5 jpr5 force-pushed the feat/array-content-support branch from a5dac15 to e52cbeb Compare March 4, 2026 23:04
@jpr5 jpr5 merged commit c7c6a81 into main Mar 5, 2026
8 checks passed
@jpr5 jpr5 deleted the feat/array-content-support branch March 16, 2026 02:25
@jpr5 jpr5 mentioned this pull request Mar 19, 2026
4 tasks
jpr5 added a commit that referenced this pull request Apr 3, 2026
Add getTextContent for array-format message content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant