FastChat icon indicating copy to clipboard operation
FastChat copied to clipboard

chore: let conv.message be str if no image provided in request

Open Lanture1064 opened this issue 10 months ago • 0 comments

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.sh to 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).

Lanture1064 avatar Apr 07 '24 10:04 Lanture1064