You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched existing ideas and did not find a similar one
I added a very descriptive title
I've clearly described the feature request and motivation for it
Feature request
Richer ChatModel.invoke,stream,batch etc outputs
Motivation
Current the main Runnable methods on ChatModels return a Message (or MessageChunks, or list of Messages, etc.) This loses some of the model response information. For example if there are multiple candidate generations, or if logprobs are returned. There should be an easy way to use ChatModel's runnable interface and get the full model response
Proposal (If applicable)
The two main ways I can think to do this are:
Have an invoke argument ChatModel.invoke(..., return_type="...") that let's you determine what the output type. You could then do ChatModel.bind(return_type="...") to create an object that always returns your chosen type. Here's a sketch of what this could look like: rfc: return full llm res #17188
Have some ChatModelLLMResult wrapper class that returns LLMResult instead of Message and a ChatModel.return_llm_results() class method that generates the ChatModelLLMResult for that ChatModel
Would love to hear other ideas and thoughts on the ideal solution
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Checked
Feature request
Richer ChatModel.invoke,stream,batch etc outputs
Motivation
Current the main Runnable methods on ChatModels return a Message (or MessageChunks, or list of Messages, etc.) This loses some of the model response information. For example if there are multiple candidate generations, or if logprobs are returned. There should be an easy way to use ChatModel's runnable interface and get the full model response
Proposal (If applicable)
The two main ways I can think to do this are:
Would love to hear other ideas and thoughts on the ideal solution
Beta Was this translation helpful? Give feedback.
All reactions