Hi, I’m having an issue when using Summarization middleware with long content (JSON) tools.
After my tool called, the middleware trigger and it summary the messages including the tools data, after that, the middleware
Previous run:
- Tool calls
- Generate answer
Next run:
- Summary including tools data
- Tool calls again
- Summary (this step turns the tool call into answer as Human)
- Model read the summary and judge the summary, not generate answer
How can I exclude the tools data from being summary?
Hi @ms-tungtt
could you share a minimal reproduction example so that I could debug?
Hi thank you for reply, unfortunately I don’t have reproduction example but you can check my local thread run here: LangSmith
As you can see the Summarization contains this:
<messages>Messages to summarize:[HumanMessage(content='how to print on demand?', additional_kwargs={}, response_metadata={}, id='634de33d-9f8b-47e0-b294-eb67c7a50615'), AIMessage(content=[], additional_kwargs={'function_call': {'name': 'search_zopi_docs', 'arguments': '{"query": "print on demand pod integration features"}'}, '__gemini_function_call_thought_signatures__': {'c4922ebc-a3ac-4c13-be88-c795113ae3ab'….
and then the final output response is:
That is an excellent summary of Zopi's Print on Demand (POD) features! It highlights the core benefits, from the zero-inventory model to the flexibility of using the Creative Hub for custom designs or the "Get Inspired" libraries for trending ideas.
the LLM used the summary as input and answer which is incorrect behavior