{"id":2398,"date":"2024-10-29T13:35:35","date_gmt":"2024-10-29T18:35:35","guid":{"rendered":"https:\/\/www.rodaportal.net\/?p=2398"},"modified":"2024-10-29T13:35:36","modified_gmt":"2024-10-29T18:35:36","slug":"building_an_interactive_ai_debate_simulation","status":"publish","type":"post","link":"https:\/\/www.rodaportal.net\/?p=2398","title":{"rendered":"Building an Interactive AI Debate Simulation with OpenAI and Streamlit"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"youtube-embed\" data-video_id=\"xvhoJcyvmPQ\"><iframe loading=\"lazy\" title=\"How to use AI Agents with OPEN AI API, PYTHON and Streamlit - Simple example with Free code\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/xvhoJcyvmPQ?feature=oembed&#038;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>Welcome to an exciting journey into the world of AI agents! In this blog post, we&#8217;ll explore how to create a fun and interactive debate simulation between a Data Analyst and a Data Scientist using OpenAI&#8217;s GPT models and Streamlit. This application not only showcases the power of AI but also adds a humorous twist to the age-old debate between these two roles.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What You&#8217;ll Learn<\/strong><\/h2>\n\n\n\n<p>By the end of this tutorial, you will know how to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set up a multi-agent debate using OpenAI models.<\/li>\n\n\n\n<li>Add humor and creativity to AI-generated responses.<\/li>\n\n\n\n<li>Convert text into audio using gTTS and play it back in Streamlit.<\/li>\n\n\n\n<li>Build a fun, interactive Streamlit app that brings the debate to life with both text and voice.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Setting Up Your Environment<\/strong><\/h2>\n\n\n\n<p>Before diving into the code, ensure you have the required libraries installed. You will need:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Streamlit<\/strong> &#8211; for building the web application.<\/li>\n\n\n\n<li><strong>OpenAI<\/strong> &#8211; to access the GPT models.<\/li>\n\n\n\n<li><strong>gTTS<\/strong> &#8211; for converting text to speech.<\/li>\n\n\n\n<li><strong>PIL<\/strong> &#8211; for image processing.<\/li>\n<\/ul>\n\n\n\n<p>Make sure to install these libraries using pip:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install streamlit openai gtts pillow<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Testing Your OpenAI API Key<\/strong><\/h2>\n\n\n\n<p>Before you start coding, it&#8217;s important to test if your OpenAI API key works. Create a function to verify the key:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def test_openai_key(api_key):<br>\n    import openai<br>\n    openai.api_key = api_key<br>\n    response = openai.ChatCompletion.create(<br>\n        model=\"gpt-3.5-turbo\",<br>\n        messages=&#91;{\"role\": \"user\", \"content\": \"Hello!\"}]<br>\n    )<br>\n    return response.choices&#91;0].message.content<\/code><\/pre>\n\n\n\n<p>Make sure to replace <code>api_key<\/code> with your actual API key.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Understanding AI Agents<\/strong><\/h2>\n\n\n\n<p>In the context of AI and LLMs (Large Language Models), agents refer to distinct roles or personas that simulate different characters during a conversation or task. In our application, we will create two agents:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Data Analyst<\/strong> &#8211; defends their job while throwing playful insults at the Data Scientist.<\/li>\n\n\n\n<li><strong>Data Scientist<\/strong> &#8211; responds to the Data Analyst&#8217;s arguments while defending their role.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Creating the Agents<\/strong><\/h2>\n\n\n\n<p>To create our agents, we will define a function that generates responses based on the role assigned to the agent. Here\u2019s how it looks:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def generate_agent_response(role_name, prompt):<br>\n    response = openai.ChatCompletion.create(<br>\n        model=\"gpt-3.5-turbo\",<br>\n        messages=&#91;{\"role\": \"system\", \"content\": f\"You are a witty and sarcastic {role_name}. You are here to defend your job while throwing in some insults.\"},<br>\n                  {\"role\": \"user\", \"content\": prompt}]<br>\n    )<br>\n    return response.choices&#91;0].message.content<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Building the Debate Logic<\/strong><\/h2>\n\n\n\n<p>Now that we have our agents, we can start building the debate logic. We will run a loop for multiple rounds of debate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def start_debate():<br>\n    analyst_prompt = \"Explain why being a Data Analyst is the best job compared to a Data Scientist.\"<br>\n    data_scientist_prompt = \"Explain why being a Data Scientist is the best job compared to a Data Analyst.\"<br>\n\n    for round in range(3):<br>\n        analyst_response = generate_agent_response(\"Data Analyst\", analyst_prompt)<br>\n        print(f\"Data Analyst: {analyst_response}\")<br>\n\n        data_scientist_response = generate_agent_response(\"Data Scientist\", data_scientist_prompt)<br>\n        print(f\"Data Scientist: {data_scientist_response}\")<br>\n\n        analyst_prompt = data_scientist_response<br>\n        data_scientist_prompt = analyst_response<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Building the Streamlit App<\/strong><\/h2>\n\n\n\n<p>Now, let\u2019s integrate everything into a Streamlit app. We will create a simple layout with a button to start the debate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import streamlit as st<br>\nfrom gtts import gTTS<br>\nimport os<br>\n\nst.set_page_config(layout=\"wide\")<br>\nst.title(\"Data Analyst vs Data Scientist Debate\")<br>\n\nif st.button(\"Start the Debate\"):<br>\n    start_debate()<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Adding Text-to-Speech Functionality<\/strong><\/h2>\n\n\n\n<p>To enhance user experience, we can add a feature to convert the text responses into audio. Here\u2019s how you can implement this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def text_to_speech(text, filename):<br>\n    tts = gTTS(text=text, lang='en')<br>\n    tts.save(filename)<br>\n    return filename<\/code><\/pre>\n\n\n\n<p>Then, call this function after generating each response:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>audio_file = text_to_speech(analyst_response, \"analyst.mp3\")<br>\nst.audio(audio_file)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Deploying the Streamlit App<\/strong><\/h2>\n\n\n\n<p>Once you have everything working locally, you can deploy your Streamlit app using Streamlit Community Cloud. Follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a new GitHub repository and push your code.<\/li>\n\n\n\n<li>Navigate to <a href=\"https:\/\/streamlit.io\/cloud\">Streamlit Community Cloud<\/a>, click on &#8220;New app&#8221;.<\/li>\n\n\n\n<li>Select your repository, branch, and the main file of your app.<\/li>\n\n\n\n<li>Click &#8220;Deploy&#8221;.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Congratulations! You&#8217;ve successfully built an interactive AI debate simulation using OpenAI&#8217;s GPT models and Streamlit. This project demonstrates the capabilities of AI agents in generating dynamic content and how to create engaging applications.<\/p>\n\n\n\n<p>Feel free to experiment with adding more agents or enhancing the debate structure. If you have any questions or suggestions, let me know in the comments below!<\/p>\n\n\n\n<p>Happy coding! \ud83c\udf88<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FwzkQTqtyHbVuk1XTHZGc%2Fscreenshots%2Fa6a575e6-2018-4f3d-a17b-bf08be2c6277.webp?alt=media&amp;token=22881893-0491-4bd7-8876-ede75d147b35\" alt=\"Data Analyst vs Data Scientist Debate\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to an exciting journey into the world of AI agents! In this blog post, we&#8217;ll explore how to create a fun and interactive debate simulation between a Data Analyst and a Data Scientist using OpenAI&#8217;s GPT models and Streamlit. This application not only showcases the power of AI but also adds a humorous twist [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2400,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2950,1544],"tags":[2955,3057,3058,3056,2954],"class_list":{"0":"post-2398","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data_analytics_101","8":"category-video","9":"tag-ai","10":"tag-debate","11":"tag-interactive","12":"tag-openai","13":"tag-streamlit"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Building an Interactive AI Debate Simulation with OpenAI and Streamlit - Rodaportal<\/title>\n<meta name=\"description\" content=\"Learn to build an engaging AI debate simulation using OpenAI and Streamlit. Discover how to set up agents, add humor, and create an interactive experience!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.18-220-63-061.plesk.page\/?p=2398\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building an Interactive AI Debate Simulation with OpenAI and Streamlit\" \/>\n<meta property=\"og:description\" content=\"\ud83d\ude80 Ready to spice up your AI skills? Check out our latest blog post on creating an interactive debate simulation with OpenAI and Streamlit! \ud83e\udd16\ud83d\udcac Join the fun and learn how to bring humor into AI! #AI #Streamlit #OpenAI\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.18-220-63-061.plesk.page\/?p=2398\" \/>\n<meta property=\"og:site_name\" content=\"Rodaportal\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Rodaportal\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-29T18:35:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-29T18:35:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.18-220-63-061.plesk.page\/wp-content\/uploads\/2024\/10\/xvhoJcyvmPQ-HD.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rodaportal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Building an Interactive AI Debate Simulation with OpenAI and Streamlit\" \/>\n<meta name=\"twitter:description\" content=\"\ud83d\ude80 Ready to spice up your AI skills? Check out our latest blog post on creating an interactive debate simulation with OpenAI and Streamlit! \ud83e\udd16\ud83d\udcac Join the fun and learn how to bring humor into AI! #AI #Streamlit #OpenAI\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/10\/xvhoJcyvmPQ-HD.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@RodaPP1\" \/>\n<meta name=\"twitter:site\" content=\"@RodaPP1\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rodaportal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398\"},\"author\":{\"name\":\"Rodaportal\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/person\\\/1ed067be473943abefead5f395f0bf70\"},\"headline\":\"Building an Interactive AI Debate Simulation with OpenAI and Streamlit\",\"datePublished\":\"2024-10-29T18:35:35+00:00\",\"dateModified\":\"2024-10-29T18:35:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398\"},\"wordCount\":528,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/xvhoJcyvmPQ-HD.jpg\",\"keywords\":[\"AI\",\"Debate\",\"Interactive\",\"OpenAI\",\"Streamlit\"],\"articleSection\":[\"Data Analytics 101\",\"Video\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398\",\"url\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398\",\"name\":\"Building an Interactive AI Debate Simulation with OpenAI and Streamlit - Rodaportal\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/xvhoJcyvmPQ-HD.jpg\",\"datePublished\":\"2024-10-29T18:35:35+00:00\",\"dateModified\":\"2024-10-29T18:35:36+00:00\",\"description\":\"Learn to build an engaging AI debate simulation using OpenAI and Streamlit. Discover how to set up agents, add humor, and create an interactive experience!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398#primaryimage\",\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/xvhoJcyvmPQ-HD.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/xvhoJcyvmPQ-HD.jpg\",\"width\":1280,\"height\":720,\"caption\":\"How to use AI Agents with OPEN AI API, PYTHON and Streamlit - Simple example with Free code\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.18-220-63-061.plesk.page\\\/?p=2398#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rodaportal.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building an Interactive AI Debate Simulation with OpenAI and Streamlit\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#website\",\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/\",\"name\":\"Rodaportal\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rodaportal.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\",\"name\":\"Rodaportal\",\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"http:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/imageedit_1_9835162131.png\",\"contentUrl\":\"http:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/imageedit_1_9835162131.png\",\"width\":112,\"height\":112,\"caption\":\"Rodaportal\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Rodaportal\",\"https:\\\/\\\/x.com\\\/RodaPP1\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/person\\\/1ed067be473943abefead5f395f0bf70\",\"name\":\"Rodaportal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"caption\":\"Rodaportal\"},\"sameAs\":[\"http:\\\/\\\/www.rodaportal.net\"],\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building an Interactive AI Debate Simulation with OpenAI and Streamlit - Rodaportal","description":"Learn to build an engaging AI debate simulation using OpenAI and Streamlit. Discover how to set up agents, add humor, and create an interactive experience!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398","og_locale":"en_US","og_type":"article","og_title":"Building an Interactive AI Debate Simulation with OpenAI and Streamlit","og_description":"\ud83d\ude80 Ready to spice up your AI skills? Check out our latest blog post on creating an interactive debate simulation with OpenAI and Streamlit! \ud83e\udd16\ud83d\udcac Join the fun and learn how to bring humor into AI! #AI #Streamlit #OpenAI","og_url":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398","og_site_name":"Rodaportal","article_publisher":"https:\/\/www.facebook.com\/Rodaportal","article_published_time":"2024-10-29T18:35:35+00:00","article_modified_time":"2024-10-29T18:35:36+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.18-220-63-061.plesk.page\/wp-content\/uploads\/2024\/10\/xvhoJcyvmPQ-HD.jpg","type":"image\/jpeg"}],"author":"Rodaportal","twitter_card":"summary_large_image","twitter_title":"Building an Interactive AI Debate Simulation with OpenAI and Streamlit","twitter_description":"\ud83d\ude80 Ready to spice up your AI skills? Check out our latest blog post on creating an interactive debate simulation with OpenAI and Streamlit! \ud83e\udd16\ud83d\udcac Join the fun and learn how to bring humor into AI! #AI #Streamlit #OpenAI","twitter_image":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/10\/xvhoJcyvmPQ-HD.jpg","twitter_creator":"@RodaPP1","twitter_site":"@RodaPP1","twitter_misc":{"Written by":"Rodaportal","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398#article","isPartOf":{"@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398"},"author":{"name":"Rodaportal","@id":"https:\/\/www.rodaportal.net\/#\/schema\/person\/1ed067be473943abefead5f395f0bf70"},"headline":"Building an Interactive AI Debate Simulation with OpenAI and Streamlit","datePublished":"2024-10-29T18:35:35+00:00","dateModified":"2024-10-29T18:35:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398"},"wordCount":528,"commentCount":0,"publisher":{"@id":"https:\/\/www.rodaportal.net\/#organization"},"image":{"@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398#primaryimage"},"thumbnailUrl":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/10\/xvhoJcyvmPQ-HD.jpg","keywords":["AI","Debate","Interactive","OpenAI","Streamlit"],"articleSection":["Data Analytics 101","Video"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.18-220-63-061.plesk.page\/?p=2398#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398","url":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398","name":"Building an Interactive AI Debate Simulation with OpenAI and Streamlit - Rodaportal","isPartOf":{"@id":"https:\/\/www.rodaportal.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398#primaryimage"},"image":{"@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398#primaryimage"},"thumbnailUrl":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/10\/xvhoJcyvmPQ-HD.jpg","datePublished":"2024-10-29T18:35:35+00:00","dateModified":"2024-10-29T18:35:36+00:00","description":"Learn to build an engaging AI debate simulation using OpenAI and Streamlit. Discover how to set up agents, add humor, and create an interactive experience!","breadcrumb":{"@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.18-220-63-061.plesk.page\/?p=2398"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398#primaryimage","url":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/10\/xvhoJcyvmPQ-HD.jpg","contentUrl":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/10\/xvhoJcyvmPQ-HD.jpg","width":1280,"height":720,"caption":"How to use AI Agents with OPEN AI API, PYTHON and Streamlit - Simple example with Free code"},{"@type":"BreadcrumbList","@id":"https:\/\/www.18-220-63-061.plesk.page\/?p=2398#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rodaportal.net\/"},{"@type":"ListItem","position":2,"name":"Building an Interactive AI Debate Simulation with OpenAI and Streamlit"}]},{"@type":"WebSite","@id":"https:\/\/www.rodaportal.net\/#website","url":"https:\/\/www.rodaportal.net\/","name":"Rodaportal","description":"","publisher":{"@id":"https:\/\/www.rodaportal.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rodaportal.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rodaportal.net\/#organization","name":"Rodaportal","url":"https:\/\/www.rodaportal.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rodaportal.net\/#\/schema\/logo\/image\/","url":"http:\/\/www.rodaportal.net\/wp-content\/uploads\/2023\/10\/imageedit_1_9835162131.png","contentUrl":"http:\/\/www.rodaportal.net\/wp-content\/uploads\/2023\/10\/imageedit_1_9835162131.png","width":112,"height":112,"caption":"Rodaportal"},"image":{"@id":"https:\/\/www.rodaportal.net\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Rodaportal","https:\/\/x.com\/RodaPP1"]},{"@type":"Person","@id":"https:\/\/www.rodaportal.net\/#\/schema\/person\/1ed067be473943abefead5f395f0bf70","name":"Rodaportal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","caption":"Rodaportal"},"sameAs":["http:\/\/www.rodaportal.net"],"url":"https:\/\/www.rodaportal.net\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/posts\/2398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2398"}],"version-history":[{"count":1,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/posts\/2398\/revisions"}],"predecessor-version":[{"id":2402,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/posts\/2398\/revisions\/2402"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/media\/2400"}],"wp:attachment":[{"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}