How to Create an AI Chat with Gemini in Construct 3

You're viewing a single comment in a conversation. View all the comments
  • 1 Comments

  • Order by
  • Hi, thank you for the comment!

    You're right, sending the full history increases token usage. This method is necessary because models like Gemini are stateless and need that history for context. For a real application, it's vital to manage this to control costs. Common solutions include using a "sliding window" of recent messages or summarizing the chat.

    From a game design perspective, I also believe it's better to guide the AI instead of allowing completely free chat. Using structured output helps maintain creative control over the game's narrative, a topic I hope to explore soon.