Skip to content

[FEATURE]: Make MaxTokens handling Configurable and add additional Exceptions on terminal events #637

@dbschmigelski

Description

@dbschmigelski

Problem Statement

In #607, default behavior is applied to prevent invalid ToolUse blocks from entering the messages array.

This behavior is applied by default. Instead it should be more configurable living in an interface like ConversationManager or applied in some default hook pool.

Additionally, after encountering max_tokens we throw MaxTokensReachedException. We should sync with other stop reasons and also throw for things like guardrail_intervened and content_filtered

Proposed Solution

No response

Use Case

Customers should have configurability for their handling of max_tokens.

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

area-contextSession or context relatedenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions