Skip to content

Conversation

crazyss
Copy link

@crazyss crazyss commented Aug 14, 2025

Fix KeyError 'model' in message_parser.py

In my macbook, I encountered this issue during try quicky_start.py .

.venv/lib/python3.13/site-packages/claude_code_sdk/_internal/message_parser.py", line 112, in parse_message
         content=content_blocks, model=data["message"]["model"]
                                       ~~~~~~~~~~~~~~~^^^^^^^^^
     KeyError: 'model'

Fix a error about KeyError.
Copy link
Collaborator

@dicksontsai dicksontsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the Anthropic API, we should always expect a "model" string.

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.

2 participants