Skip to content

fix: normalize summary content to string using StrOutputParser#137

Open
daniel-mallett wants to merge 1 commit intolangchain-ai:mainfrom
daniel-mallett:danielmallett/fix-summary-type-error
Open

fix: normalize summary content to string using StrOutputParser#137
daniel-mallett wants to merge 1 commit intolangchain-ai:mainfrom
daniel-mallett:danielmallett/fix-summary-type-error

Conversation

@daniel-mallett
Copy link

Fixes #135

RunningSummary.summary was typed as str but could contain Union[str, list[Union[str,dict]]] causing a type error for string comparison operations.

This fix uses LangChains StrOutputParser to normalize the summary models response as a string for better compatability with gemini and claude.

The fix was applied in both summarize_messages and asummarize_messages

Fixes langchain-ai#135

RunningSummary.summary was typed as str but could contain Union[str, list[Union[str,dict]]] causing a type error for string comparison operations.

This fix uses LangChains StrOutputParser to normalize the summary models response as a string for better compatability with gemini and claude.

The fix was applied in both summarize_messages and asummarize_messages
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.

Bug: TypeError: 'in <string>' requires string as left operand, not list in _prepare_summarization_result with gemini

1 participant