这是indexloc提供的服务,不要输入任何密码
Skip to content

[Feature]: Add ContextWindowExceeded error and SDK pre-check #1074

@shahmeersensei

Description

@shahmeersensei

Feature Description

Add support in the Python SDK for detecting and handling when user input exceeds the model's context window (token limit) before sending the request. Raise a new error class (ContextWindowExceeded) when this occurs, and update SDK docs with an example of how to handle this error. This makes it easier for developers to catch and handle oversized requests gracefully, improving reliability and user experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions