-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
📚 The doc issue
According to the docstring for the LLM class's chat()
method,
messages – A list of messages to generate responses for. Each message is a list of dictionaries with ‘role’ and ‘content’ keys.
This implies messages
can be a list containing multiple lists, each of which is one chat conversation with the dictionaries for role and content. However, that's not the case: messages
must be a list of dictionaries, not a list of lists of dictionaries, because only one conversation is supported. See this example: #6416 (comment)
Suggest a potential alternative/fix
Two options:
- The docstring is edited to say "A list of messages to generate responses for. Each message is a dictionary with ‘role’ and ‘content’ keys." Under Returns, say something like "A list containing one RequestOutput object with the generated response."
- Make the function actually do what the docstring says. If you have multiple conversations you want responses to, doing them in a batch is much more efficient than doing them one at a time by repeatedly calling
chat()
. In my application, I need 12,000 chat responses, and callingchat()
12,000 times will take something like 12 hours, whereas callinggenerate()
once with the pre-tokenized prompts takes an hour or two.
Before submitting a new issue...
- Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation