Skip to content

analyzePayload crashes on non-string text blocks #9

Description

@royalpinto007

Problem

A non-string text block ({type: "text", text: 123}) crashes analyzePayload with u.text.slice is not a function.

Where

src/index.mjs (biggest mapping calls u.text.slice(0, 80) with no coercion).

Acceptance

Add a failing test first passing [{role: "user", content: [{type: "text", text: 123}]}], expecting no throw and text counted via String(). Then fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions