Skip to content

Add wrapper that casts LLM response to a string.#11

Merged
Zsailer merged 1 commit intomainfrom
chat-model
Feb 17, 2025
Merged

Add wrapper that casts LLM response to a string.#11
Zsailer merged 1 commit intomainfrom
chat-model

Conversation

@Zsailer
Copy link
Collaborator

@Zsailer Zsailer commented Feb 13, 2025

Fixes #9

@Zsailer Zsailer added the bug Something isn't working label Feb 13, 2025
@github-actions
Copy link

Binder 👈 Launch a Binder on branch Zsailer/jupyterlab-magic-wand/chat-model

@Zsailer
Copy link
Collaborator Author

Zsailer commented Feb 13, 2025

@jtpio I think this fixes the issue you saw.

@jtpio
Copy link
Member

jtpio commented Feb 13, 2025

Nice, thanks @Zsailer!

So does it mean the response may be different depending on the provider being used?

Out of curiosity, which provider are you using for testing locally? (to check if I could also try to reproduce in my environment)

@Zsailer
Copy link
Collaborator Author

Zsailer commented Feb 14, 2025

So does it mean the response may be different depending on the provider being used?

Yes, although it's really just two output types from langchain. Jupyter AI has to handle this too: https://github.com/jupyterlab/jupyter-ai/blob/7b4586ef2adc560b457731ae07be87e348a8769e/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py#L454-L461

I'm checking against BaseMessage here since it's more generic than AIMessage (which is used in Jupyter AI).

Out of curiosity, which provider are you using for testing locally? (to check if I could also try to reproduce in my environment)

I'm using an internal provider :).

Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried locally using the wheel built by check-release on CI, and it works fine, thanks!

@Zsailer
Copy link
Collaborator Author

Zsailer commented Feb 17, 2025

Thank you, @jtpio!

@Zsailer Zsailer merged commit a138154 into main Feb 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'AIMessage' object has no attribute 'strip'

2 participants