Closed somni1oquist closed 2 months ago
Ref: https://firebase.google.com/docs/vertex-ai/chat?platform=web#chat-non-streaming
Implemented chat session (multi-turn) functionality using structure:
const chat = model.startChat({
history: [
{
role: "user",
parts: [{ text: "Hello, I have 2 dogs in my house." }],
},
{
role: "model",
parts: [{ text: "Great to meet you. What would you like to know?" }],
},
],
generationConfig: {
maxOutputTokens: 100,
},
});
Add service function to enable the model to mutate result data with instructions.