GenkitG
Genkitโ€ข8mo ago
forward-apricot

When you say previous chat, what do you

When you say previous chat, what do you mean? A historical chat from some time ago, that you want to refer back to? Or do you mean just generally building a chat-like UX where you want to continue the converation where it last left off? Is the "chat" an interaction with the model?

Generally speaking, any "context" you want to provide to the model should be present in the "prompt" (i.e. messages). If you're using dotprompt you can use the history param to do this.

If you don't consider it part of the current interaction, and you want to just refer back to some details from a log of some kind (chat in this case), you could probably use a tool to do that lookup. But you'll have to do some prompt engineering to make sure the model recognizes that it needs to go back and get some history. If you don't need the model to "decide" though, you're probably better off including the history in the prompt from the get go.
Was this page helpful?