Skip to content

fix: accept token lists in parse results#8

Merged
suguanYang merged 2 commits into
mainfrom
bugfix/wangbinqi/issue-7-token-payload
Mar 18, 2026
Merged

fix: accept token lists in parse results#8
suguanYang merged 2 commits into
mainfrom
bugfix/wangbinqi/issue-7-token-payload

Conversation

@suguanYang

@suguanYang suguanYang commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fix TextChunk.tokens deserialization so the SDK matches the current knowhere-api list-based token payload
  • remove the old integer/string compatibility path and fail fast if chunks.json contains an outdated token shape
  • update parser/model/docs/tests and refresh the regression fixture to the current response contract

Context

Issue #7 reports that client.parse() crashes after a successful parse job when a text chunk returns tokens as a list instead of an integer. Local inspection of recent knowhere-api changes shows list-based tokens are now the intended backend contract.

Closes #7.

Testing

  • uv run pytest
  • uv run pytest tests/test_result_parser.py tests/test_models.py

@suguanYang suguanYang merged commit 192dac9 into main Mar 18, 2026
5 checks passed
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.

SDK crashes parsing results when text chunk tokens is returned as a list

1 participant