FastChat
FastChat copied to clipboard
chore: let conv.message be str if no image provided in request
Why are these changes needed?
When using langchaingo w/ fastchat, it generates requests with formats like "messages":["text":"given text", "type": "text"] as default, which will be recognized and processed as a request with image since JSON sees it as a list(dict), therefore causing errors at prompt = conv.get_prompt() since most model adapters for normal LLMs could not accept conv.messages as list[tuple].
By adopting this fix, requests will plain texts would be correctly recognized and appended to conv as str.
Related issue number (if applicable)
Checks
- [x] I've run
format.shto lint the changes in this PR. - [x] I've included any doc changes needed.
- [x] I've made sure the relevant tests are passing (if applicable).