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
In a chat application, integrating the response_model=Model within a loop can be challenging. But if you change your thinking, a basic chat response class typically looks like this:
classResponse(BaseModel):
text: str
Alternatively, if we want to include a chain of thought for more complex interactions, the class expands:
By adding an actions field, we can encapsulate potential actions that could be triggered in response to the chat. This structure not only retains the conversational context but also opens up possibilities for interactive and responsive chatbot behaviors.
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
-
In a chat application, integrating the
response_model=Model
within a loop can be challenging. But if you change your thinking, a basic chat response class typically looks like this:Alternatively, if we want to include a chain of thought for more complex interactions, the class expands:
This design allows parsing the chain of thought (COT) directly from the response when needed. without regex or other bs.
To accommodate more dynamic interactions, consider this mental shift in structuring the
Response
class:By adding an
actions
field, we can encapsulate potential actions that could be triggered in response to the chat. This structure not only retains the conversational context but also opens up possibilities for interactive and responsive chatbot behaviors.Beta Was this translation helpful? Give feedback.
All reactions