{"id":12,"date":"2024-11-12T19:02:16","date_gmt":"2024-11-12T19:02:16","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/crashtocash\/?p=12"},"modified":"2024-11-12T19:02:16","modified_gmt":"2024-11-12T19:02:16","slug":"designing-ai-powered-dialogue","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/crashtocash\/2024\/11\/12\/designing-ai-powered-dialogue\/","title":{"rendered":"Designing AI-Powered Dialogue"},"content":{"rendered":"\n<p>This post ended up being a little &#8220;stuffy&#8221; as I had the recent design document on my mind. Sorry if it is on the boring side.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">My project<\/h2>\n\n\n\n<p>The Language Immersion Virtual Environment (LIVE) project is a language-learning game that aims to replicate the experience traditional language immersion using AI-powered conversations with non-player characters (NPCs). As the team member responsible for the GPT Integration, my role is to design a system that brings these characters to life by making their responses realistic, contextually appropriate, and engaging. By using OpenAI\u2019s API, our goal is to create dialogue that feels dynamic and encourages players to practice their language skills organically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Objectives of GPT Integration<\/h2>\n\n\n\n<p>The project&#8217;s GPT integration needs to perform three tasks: dynamic dialogue, task completion, and proficiency scoring.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Dynamic Dialogue<\/strong>: Ensure that NPCs respond naturally to player inputs, tailor responses to fit the character\u2019s personality, role, and current context within the game.<\/li>\n\n\n\n<li><strong>Task Completion: <\/strong>Parse input dialogue and determine whether the <\/li>\n\n\n\n<li><strong>Proficiency Scoring<\/strong>: Evaluate player language proficiency in real time, allowing the system to adjust NPC responses based on the player\u2019s fluency and provide a realistic learning experience.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Design Considerations<\/h2>\n\n\n\n<p><strong>System Instructions and Zero-Shot Prompting<\/strong>: Zero-shot prompting will be used to guide the AI\u2019s responses without providing examples, this minimizes token usage and keeps instructions focused.<\/p>\n\n\n\n<p><strong>Handling Context in Dialogue<\/strong>: Each response takes into account the NPC\u2019s personality traits, profession, location, and current game state, ensuring that dialogue feels relevant to the player\u2019s actions and the game\u2019s setting.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example Request and Response<\/h3>\n\n\n\n<p style=\"font-size:12px\"> <img decoding=\"async\" width=\"290\" height=\"482.56743279793875\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXd7hnq2PBQMWeswNJuuKggK4jbZu73PuNG9bpe_755GFX0xZTielFV-OnVfKDYGbfcSfMxjgunwsp-kfqb-0J19QlGdRxNIEnsSZ3FHfABeAxrW5Iwcnzy0-FhL641mrzghs0lfrvnniViUiVZTmpqP_Yoe?key=eubk-u2tGLNQzoMuHufABMAq\">                  <strong><img loading=\"lazy\" decoding=\"async\" width=\"284\" height=\"314\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdC8jioq0Cdc-Q7sgNNeaWFgte2THLBtc7V2UOZbS-3MBzB7WA7aczGAbTz1xVXR9PmwHXi4WnHNIe6I33ZmTjcpgSmFy5OaEol68eaXwyA8c5A7WFoGF_xeZkljekDRX-bOMVIgO30XPfoZ14ETV91DQQA?key=eubk-u2tGLNQzoMuHufABMAq\"><\/strong><br><strong>Fig. 1 &#8211; Example Request to GPT Integration Service<\/strong>           <strong>                      Fig. 2 &#8211; Example Response<\/strong><br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Opinions<\/h2>\n\n\n\n<p>OpenAI&#8217;s API is super slow and super expensive&#8230;.. That&#8217;s it. <\/p>\n\n\n\n<p>On a more serious note, I\u2019ve learned a ton about working with REST APIs when context is key. At first, I planned to fine-tune a model, until I realized it would be both unnecessary and insanely expensive. My next thought was to use few-shot prompting with examples, but after experimenting, I found it to be more complex and again, more expensive. Ultimately, I landed on programmatically filling a straightforward prompt, using prompt engineering best practices (which could easily be a whole post in itself). This approach turned out to be the most efficient, flexible, and cost-effective solution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>bye<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post ended up being a little &#8220;stuffy&#8221; as I had the recent design document on my mind. Sorry if it is on the boring side. My project The Language Immersion Virtual Environment (LIVE) project is a language-learning game that aims to replicate the experience traditional language immersion using AI-powered conversations with non-player characters (NPCs). [&hellip;]<\/p>\n","protected":false},"author":14517,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-uncategorized","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/users\/14517"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":14,"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/posts\/12\/revisions\/14"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/crashtocash\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}