deepagents
deepagents copied to clipboard
Some models have a max_token that does not reach 170,000. Is it possible to enable the setting for max_tokens_before_summary?
Some models have a max_token that does not reach 170,000. Is it possible to enable the setting for max_tokens_before_summary?
I created a class CustomSummarizationMiddleware(SummarizationMiddleware): """Custom summarization middleware with 4000 token threshold.""" pass
then used in create_deep_agent CustomSummarizationMiddleware( model=GPT_OSS_OLLAMA, max_tokens_before_summary=4000, ), ],
hope it helps
We'll start configuring this off the context window of the model soon (which will be available with langchain 1.1 via model profiles)