From 91517659238fc8db896cba6775c73d36575c8782 Mon Sep 17 00:00:00 2001 From: emmanuel Date: Sun, 15 Dec 2024 02:00:43 +0100 Subject: [PATCH] clean up cell --- week1/day2 EXERCISE.ipynb | 236 +-------- week2/.~day1.ipynb | 1002 +++++++++++++++++++++++++++++++++++++ week2/day1.ipynb | 65 ++- 3 files changed, 1086 insertions(+), 217 deletions(-) create mode 100644 week2/.~day1.ipynb diff --git a/week1/day2 EXERCISE.ipynb b/week1/day2 EXERCISE.ipynb index 3f2060d..488a730 100644 --- a/week1/day2 EXERCISE.ipynb +++ b/week1/day2 EXERCISE.ipynb @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "4e2a9393-7767-488e-a8bf-27c12dca35bd", "metadata": {}, "outputs": [], @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "29ddd15d-a3c5-4f4e-a678-873f56162724", "metadata": {}, "outputs": [], @@ -96,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "dac0a679-599c-441f-9bf2-ddc73d35b940", "metadata": {}, "outputs": [], @@ -110,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "7bb9c624-14f0-4945-a719-8ddb64f66f47", "metadata": {}, "outputs": [], @@ -124,37 +124,10 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "42b9f644-522d-4e05-a691-56e7658c0ea9", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Generative AI has numerous business applications across various industries. Here are some examples:\n", - "\n", - "1. **Content Creation**: Generative AI can create high-quality content, such as articles, social media posts, and product descriptions, in a matter of minutes. This can be particularly useful for businesses that need to generate large amounts of content quickly.\n", - "2. **Marketing Automation**: Generative AI can help automate marketing processes, such as personalized email campaigns, ad copywriting, and lead generation. By analyzing customer data and behavior, generative AI can create targeted and relevant content that resonates with customers.\n", - "3. **Product Design and Development**: Generative AI can assist in the design and development of new products by generating 2D and 3D designs, prototypes, and even entire product lines. This can help reduce costs and speed up the product development process.\n", - "4. **Image and Video Generation**: Generative AI can create realistic images and videos that can be used for various business purposes, such as advertising, e-commerce, and social media content creation.\n", - "5. **Chatbots and Virtual Assistants**: Generative AI can power chatbots and virtual assistants that can engage with customers, provide support, and answer frequently asked questions. This can help businesses improve customer service and reduce the workload of human customer support agents.\n", - "6. **Supply Chain Optimization**: Generative AI can analyze supply chain data and generate optimized routes, schedules, and inventory management plans to improve logistics efficiency and reduce costs.\n", - "7. **Predictive Maintenance**: Generative AI can analyze equipment sensor data and predict maintenance needs, allowing businesses to schedule maintenance activities before equipment failures occur, reducing downtime and increasing overall efficiency.\n", - "8. **Financial Analysis and Forecasting**: Generative AI can analyze financial data and generate forecasts, identifying trends and patterns that can help businesses make informed investment decisions.\n", - "9. **Customer Service Chatbots**: Generative AI can create personalized chatbots that can engage with customers, answer questions, and provide support in multiple languages.\n", - "10. **Education and Training**: Generative AI can create personalized learning plans, generate educational content, and even develop adaptive learning systems that adjust to individual student needs.\n", - "\n", - "Some specific business applications of generative AI include:\n", - "\n", - "* **Amazon's Product Recommendations**: Amazon uses generative AI to recommend products based on customer behavior and preferences.\n", - "* **Google's Content Generation**: Google uses generative AI to create high-quality content for its search engine, such as news summaries and product descriptions.\n", - "* **IBM's Watson**: IBM uses generative AI in its Watson platform to analyze large amounts of data and provide insights for various industries, including healthcare and finance.\n", - "\n", - "Overall, the business applications of generative AI are vast and continue to expand as the technology improves.\n" - ] - } - ], + "outputs": [], "source": [ "response = requests.post(OLLAMA_API, json=payload, headers=HEADERS)\n", "print(response.json()['message']['content'])" @@ -174,50 +147,10 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "7745b9c4-57dc-4867-9180-61fa5db55eb8", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Generative AI has numerous business applications across various industries, including:\n", - "\n", - "1. **Content Generation**: Use AI to generate high-quality content such as blog posts, social media posts, product descriptions, and more.\n", - "2. **Marketing Automation**: Utilize generative AI to personalize marketing messages, create targeted advertising campaigns, and automate lead generation.\n", - "3. **Product Design and Development**: Leverage generative AI to design and develop new products, such as 3D models, prototypes, and designs for packaging and branding materials.\n", - "4. **Customer Service Chatbots**: Create chatbots that use generative AI to understand customer inquiries and provide personalized responses.\n", - "5. **Language Translation**: Apply generative AI to translate text, speech, and audio content in real-time.\n", - "6. **Image Generation**: Use generative AI to create high-quality images for marketing materials, product packaging, and more.\n", - "7. **Music Composition**: Utilize generative AI to compose original music tracks, sound effects, and audio loops for various industries.\n", - "8. **Predictive Analytics**: Leverage generative AI to analyze large datasets, identify patterns, and make predictions about customer behavior, market trends, and more.\n", - "9. **Financial Modeling**: Apply generative AI to create financial models, forecast revenue, and predict potential risks.\n", - "10. **Creative Writing**: Use generative AI to assist in creative writing tasks such as generating plot outlines, character development, and dialogue.\n", - "\n", - "Industry-specific applications:\n", - "\n", - "1. **Healthcare**: Generate medical imaging reports, create personalized patient profiles, and develop new treatment options using generative AI.\n", - "2. **Finance**: Analyze financial data, identify trends, and predict market movements using generative AI.\n", - "3. **Education**: Develop personalized learning plans, create adaptive assessments, and generate educational content using generative AI.\n", - "4. **Retail**: Generate product descriptions, optimize pricing strategies, and create targeted marketing campaigns using generative AI.\n", - "\n", - "Benefits of Generative AI:\n", - "\n", - "1. **Increased Efficiency**: Automate repetitive tasks, reduce manual labor, and increase productivity.\n", - "2. **Improved Accuracy**: Reduce human error, improve data accuracy, and enhance decision-making.\n", - "3. **Enhanced Creativity**: Unlock new creative possibilities, generate innovative ideas, and discover new opportunities.\n", - "\n", - "However, there are also challenges associated with Generative AI, such as:\n", - "\n", - "1. **Bias and Fairness**: Ensure that generative models do not perpetuate existing biases or discriminatory practices.\n", - "2. **Explainability and Transparency**: Develop techniques to understand how generative models make decisions and provide transparency into their decision-making processes.\n", - "3. **Job Displacement**: Prepare employees for the impact of automation on jobs and develop new skills to work alongside AI systems.\n", - "\n", - "Overall, Generative AI has the potential to transform various industries and bring about significant benefits, but it is crucial to address the associated challenges to maximize its value.\n" - ] - } - ], + "outputs": [], "source": [ "import ollama\n", "\n", @@ -266,7 +199,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "2cedd52a-cb2e-4cfb-8e48-176954cd64e7", "metadata": {}, "outputs": [], @@ -282,7 +215,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "402d5686-4e76-4110-b65a-b3906c35c0a4", "metadata": {}, "outputs": [], @@ -296,7 +229,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "be0c1b6e-8d7c-446f-8a9c-18b1c33078d8", "metadata": {}, "outputs": [], @@ -326,63 +259,10 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "265f85c4-132d-4bb8-bda2-792e0b0da017", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Home - Edward Donner\n", - "Home\n", - "Outsmart\n", - "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", - "About\n", - "Posts\n", - "Well, hi there.\n", - "I’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\n", - "very\n", - "amateur) and losing myself in\n", - "Hacker News\n", - ", nodding my head sagely to things I only half understand.\n", - "I’m the co-founder and CTO of\n", - "Nebula.io\n", - ". We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\n", - "acquired in 2021\n", - ".\n", - "We work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\n", - "patented\n", - "our matching model, and our award-winning platform has happy customers and tons of press coverage.\n", - "Connect\n", - "with me for more!\n", - "November 13, 2024\n", - "Mastering AI and LLM Engineering – Resources\n", - "October 16, 2024\n", - "From Software Engineer to AI Data Scientist – resources\n", - "August 6, 2024\n", - "Outsmart LLM Arena – a battle of diplomacy and deviousness\n", - "June 26, 2024\n", - "Choosing the Right LLM: Toolkit and Resources\n", - "Navigation\n", - "Home\n", - "Outsmart\n", - "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", - "About\n", - "Posts\n", - "Get in touch\n", - "ed [at] edwarddonner [dot] com\n", - "www.edwarddonner.com\n", - "Follow me\n", - "LinkedIn\n", - "Twitter\n", - "Facebook\n", - "Subscribe to newsletter\n", - "Type your email…\n", - "Subscribe\n" - ] - } - ], + "outputs": [], "source": [ "# Let's try one out. Change the website and add print statements to follow along.\n", "\n", @@ -393,65 +273,10 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "24ea875b-2ba0-41ad-b6be-4be8baeac16e", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "You are looking at a website titled Home - Edward Donner\n", - "The contents of this website is as follows; please provide a short summary of this website in markdown. If it includes news or announcements, then summarize these too.\n", - "\n", - "Home\n", - "Outsmart\n", - "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", - "About\n", - "Posts\n", - "Well, hi there.\n", - "I’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\n", - "very\n", - "amateur) and losing myself in\n", - "Hacker News\n", - ", nodding my head sagely to things I only half understand.\n", - "I’m the co-founder and CTO of\n", - "Nebula.io\n", - ". We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\n", - "acquired in 2021\n", - ".\n", - "We work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\n", - "patented\n", - "our matching model, and our award-winning platform has happy customers and tons of press coverage.\n", - "Connect\n", - "with me for more!\n", - "November 13, 2024\n", - "Mastering AI and LLM Engineering – Resources\n", - "October 16, 2024\n", - "From Software Engineer to AI Data Scientist – resources\n", - "August 6, 2024\n", - "Outsmart LLM Arena – a battle of diplomacy and deviousness\n", - "June 26, 2024\n", - "Choosing the Right LLM: Toolkit and Resources\n", - "Navigation\n", - "Home\n", - "Outsmart\n", - "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", - "About\n", - "Posts\n", - "Get in touch\n", - "ed [at] edwarddonner [dot] com\n", - "www.edwarddonner.com\n", - "Follow me\n", - "LinkedIn\n", - "Twitter\n", - "Facebook\n", - "Subscribe to newsletter\n", - "Type your email…\n", - "Subscribe\n" - ] - } - ], + "outputs": [], "source": [ "# Define our system/user prompt - you can experiment with this later, changing the last sentence to 'Respond in markdown in Spanish.\"\n", "\n", @@ -476,7 +301,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "6d5f0f47-58a2-43b7-87a9-181a87e08081", "metadata": {}, "outputs": [], @@ -491,25 +316,17 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "55454071-faa1-4cb1-a8dc-1f93abad6718", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[{'role': 'system', 'content': 'You are an assistant that analyzes the contents of a website and provides a short summary, ignoring text that might be navigation related. Respond in markdown.'}, {'role': 'user', 'content': 'You are looking at a website titled Home - Edward Donner\\nThe contents of this website is as follows; please provide a short summary of this website in markdown. If it includes news or announcements, then summarize these too.\\n\\nHome\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nWell, hi there.\\nI’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\\nvery\\namateur) and losing myself in\\nHacker News\\n, nodding my head sagely to things I only half understand.\\nI’m the co-founder and CTO of\\nNebula.io\\n. We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\\nacquired in 2021\\n.\\nWe work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\\npatented\\nour matching model, and our award-winning platform has happy customers and tons of press coverage.\\nConnect\\nwith me for more!\\nNovember 13, 2024\\nMastering AI and LLM Engineering – Resources\\nOctober 16, 2024\\nFrom Software Engineer to AI Data Scientist – resources\\nAugust 6, 2024\\nOutsmart LLM Arena – a battle of diplomacy and deviousness\\nJune 26, 2024\\nChoosing the Right LLM: Toolkit and Resources\\nNavigation\\nHome\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nGet in touch\\ned [at] edwarddonner [dot] com\\nwww.edwarddonner.com\\nFollow me\\nLinkedIn\\nTwitter\\nFacebook\\nSubscribe to newsletter\\nType your email…\\nSubscribe'}]\n" - ] - } - ], + "outputs": [], "source": [ "print(messages_for(ed))" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "42e0d73b-7db5-431f-bf97-4767be627056", "metadata": {}, "outputs": [], @@ -524,21 +341,10 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "419d4c04-a3c4-43d2-ac1f-5f7f3b84c92a", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'**Website Summary**\\n======================\\n\\n* The website is owned by Edward Donner, a co-founder and CTO of Nebula.io.\\n* It appears to be primarily focused on his experiences with Large Language Models (LLMs) and AI engineering.\\n\\n**News and Announcements**\\n---------------------------\\n\\n* **Mastering AI and LLM Engineering - Resources**: A collection of resources for learning about mastering AI and LLM engineering, announced on November 13, 2024.\\n* **From Software Engineer to AI Data Scientist – resources**: A list of resources to help move from a software engineer role to an AI data scientist, shared on October 16, 2024.\\n* **Outsmart LLM Arena – a battle of diplomacy and deviousness**: An introduction to the Outsmart arena where LLMs compete in a battle of diplomacy and strategy, announced on June 26, 2024.\\n\\n**Additional Information**\\n-------------------------\\n\\n* Edward Donner is also involved with various projects and companies, including Nebula.io and untapt (acquired in 2021).\\n* He shares his interests in DJing, electronic music production, and amateur coding endeavors.\\n* The website contains links to his social media profiles and a newsletter sign-up.'" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "summarize(\"https://edwarddonner.com\")" ] diff --git a/week2/.~day1.ipynb b/week2/.~day1.ipynb new file mode 100644 index 0000000..a8e0314 --- /dev/null +++ b/week2/.~day1.ipynb @@ -0,0 +1,1002 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "06cf3063-9f3e-4551-a0d5-f08d9cabb927", + "metadata": {}, + "source": [ + "# Welcome to Week 2!\n", + "\n", + "## Frontier Model APIs\n", + "\n", + "In Week 1, we used multiple Frontier LLMs through their Chat UI, and we connected with the OpenAI's API.\n", + "\n", + "Today we'll connect with the APIs for Anthropic and Google, as well as OpenAI." + ] + }, + { + "cell_type": "markdown", + "id": "2b268b6e-0ba4-461e-af86-74a41f4d681f", + "metadata": {}, + "source": [ + "\n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \n", + "

Important Note - Please read me

\n", + " I'm continually improving these labs, adding more examples and exercises.\n", + " At the start of each week, it's worth checking you have the latest code.
\n", + " First do a git pull and merge your changes as needed. Any problems? Try asking ChatGPT to clarify how to merge - or contact me!

\n", + " After you've pulled the code, from the llm_engineering directory, in an Anaconda prompt (PC) or Terminal (Mac), run:
\n", + " conda env update --f environment.yml --prune
\n", + " Or if you used virtualenv rather than Anaconda, then run this from your activated environment in a Powershell (PC) or Terminal (Mac):
\n", + " pip install -r requirements.txt\n", + "
Then restart the kernel (Kernel menu >> Restart Kernel and Clear Outputs Of All Cells) to pick up the changes.\n", + "
\n", + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \n", + "

Reminder about the resources page

\n", + " Here's a link to resources for the course. This includes links to all the slides.
\n", + " https://edwarddonner.com/2024/11/13/llm-engineering-resources/
\n", + " Please keep this bookmarked, and I'll continue to add more useful links there over time.\n", + "
\n", + "
" + ] + }, + { + "cell_type": "markdown", + "id": "85cfe275-4705-4d30-abea-643fbddf1db0", + "metadata": {}, + "source": [ + "## Setting up your keys\n", + "\n", + "If you haven't done so already, you could now create API keys for Anthropic and Google in addition to OpenAI.\n", + "\n", + "**Please note:** if you'd prefer to avoid extra API costs, feel free to skip setting up Anthopic and Google! You can see me do it, and focus on OpenAI for the course. You could also substitute Anthropic and/or Google for Ollama, using the exercise you did in week 1.\n", + "\n", + "For OpenAI, visit https://openai.com/api/ \n", + "For Anthropic, visit https://console.anthropic.com/ \n", + "For Google, visit https://ai.google.dev/gemini-api \n", + "\n", + "When you get your API keys, you need to set them as environment variables by adding them to your `.env` file.\n", + "\n", + "```\n", + "OPENAI_API_KEY=xxxx\n", + "ANTHROPIC_API_KEY=xxxx\n", + "GOOGLE_API_KEY=xxxx\n", + "```\n", + "\n", + "Afterwards, you may need to restart the Jupyter Lab Kernel (the Python process that sits behind this notebook) via the Kernel menu, and then rerun the cells from the top." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "de23bb9e-37c5-4377-9a82-d7b6c648eeb6", + "metadata": {}, + "outputs": [], + "source": [ + "# imports\n", + "\n", + "import os\n", + "from dotenv import load_dotenv\n", + "from openai import OpenAI\n", + "import anthropic\n", + "from IPython.display import Markdown, display, update_display" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "f0a8ab2b-6134-4104-a1bc-c3cd7ea4cd36", + "metadata": {}, + "outputs": [], + "source": [ + "# import for google\n", + "# in rare cases, this seems to give an error on some systems, or even crashes the kernel\n", + "# If this happens to you, simply ignore this cell - I give an alternative approach for using Gemini later\n", + "\n", + "import google.generativeai" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "1179b4c5-cd1f-4131-a876-4c9f3f38d2ba", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "OpenAI API Key exists and begins sk-proj-\n", + "Anthropic API Key exists and begins sk-ant-\n", + "Google API Key exists and begins AIzaSyAh\n" + ] + } + ], + "source": [ + "# Load environment variables in a file called .env\n", + "# Print the key prefixes to help with any debugging\n", + "\n", + "load_dotenv()\n", + "openai_api_key = os.getenv('OPENAI_API_KEY')\n", + "anthropic_api_key = os.getenv('ANTHROPIC_API_KEY')\n", + "google_api_key = os.getenv('GOOGLE_API_KEY')\n", + "\n", + "if openai_api_key:\n", + " print(f\"OpenAI API Key exists and begins {openai_api_key[:8]}\")\n", + "else:\n", + " print(\"OpenAI API Key not set\")\n", + " \n", + "if anthropic_api_key:\n", + " print(f\"Anthropic API Key exists and begins {anthropic_api_key[:7]}\")\n", + "else:\n", + " print(\"Anthropic API Key not set\")\n", + "\n", + "if google_api_key:\n", + " print(f\"Google API Key exists and begins {google_api_key[:8]}\")\n", + "else:\n", + " print(\"Google API Key not set\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "797fe7b0-ad43-42d2-acf0-e4f309b112f0", + "metadata": {}, + "outputs": [], + "source": [ + "# Connect to OpenAI, Anthropic\n", + "\n", + "openai = OpenAI()\n", + "\n", + "claude = anthropic.Anthropic()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "425ed580-808d-429b-85b0-6cba50ca1d0c", + "metadata": {}, + "outputs": [], + "source": [ + "# This is the set up code for Gemini\n", + "# Having problems with Google Gemini setup? Then just ignore this cell; when we use Gemini, I'll give you an alternative that bypasses this library altogether\n", + "\n", + "google.generativeai.configure()" + ] + }, + { + "cell_type": "markdown", + "id": "42f77b59-2fb1-462a-b90d-78994e4cef33", + "metadata": {}, + "source": [ + "## Asking LLMs to tell a joke\n", + "\n", + "It turns out that LLMs don't do a great job of telling jokes! Let's compare a few models.\n", + "Later we will be putting LLMs to better use!\n", + "\n", + "### What information is included in the API\n", + "\n", + "Typically we'll pass to the API:\n", + "- The name of the model that should be used\n", + "- A system message that gives overall context for the role the LLM is playing\n", + "- A user message that provides the actual prompt\n", + "\n", + "There are other parameters that can be used, including **temperature** which is typically between 0 and 1; higher for more random output; lower for more focused and deterministic." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "378a0296-59a2-45c6-82eb-941344d3eeff", + "metadata": {}, + "outputs": [], + "source": [ + "system_message = \"You are an assistant that is great at telling jokes\"\n", + "user_prompt = \"Tell a light-hearted joke for an audience of Data Scientists\"" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "f4d56a0f-2a3d-484d-9344-0efa6862aff4", + "metadata": {}, + "outputs": [], + "source": [ + "prompts = [\n", + " {\"role\": \"system\", \"content\": system_message},\n", + " {\"role\": \"user\", \"content\": user_prompt}\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "3b3879b6-9a55-4fed-a18c-1ea2edfaf397", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Why did the data scientist bring a ladder to the bar?\n", + "\n", + "Because he heard the drinks were on the house!\n" + ] + } + ], + "source": [ + "# GPT-3.5-Turbo\n", + "\n", + "completion = openai.chat.completions.create(model='gpt-3.5-turbo', messages=prompts)\n", + "print(completion.choices[0].message.content)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "3d2d6beb-1b81-466f-8ed1-40bf51e7adbf", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Why did the data scientist break up with the statistician?\n", + "\n", + "Because she found him too mean!\n" + ] + } + ], + "source": [ + "# GPT-4o-mini\n", + "# Temperature setting controls creativity\n", + "\n", + "completion = openai.chat.completions.create(\n", + " model='gpt-4o-mini',\n", + " messages=prompts,\n", + " temperature=0.2\n", + ")\n", + "print(completion.choices[0].message.content)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "f1f54beb-823f-4301-98cb-8b9a49f4ce26", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Why do data scientists love nature hikes?\n", + "\n", + "Because they can't resist finding patterns in the wild!\n" + ] + } + ], + "source": [ + "# GPT-4o\n", + "\n", + "completion = openai.chat.completions.create(\n", + " model='gpt-4o',\n", + " messages=prompts,\n", + " temperature=0.8\n", + ")\n", + "print(completion.choices[0].message.content)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "1ecdb506-9f7c-4539-abae-0e78d7f31b76", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sure, here's a light-hearted joke for data scientists:\n", + "\n", + "Why do data scientists prefer dark mode?\n", + "\n", + "Because light attracts bugs!\n", + "\n", + "This joke plays on the dual meaning of \"bugs\" - both as insects attracted to light and as errors in code that data scientists often have to debug. It's a fun little pun that combines a common preference among programmers (dark mode) with a data science-related concept.\n" + ] + } + ], + "source": [ + "# Claude 3.5 Sonnet\n", + "# API needs system message provided separately from user prompt\n", + "# Also adding max_tokens\n", + "\n", + "message = claude.messages.create(\n", + " model=\"claude-3-5-sonnet-20240620\",\n", + " max_tokens=200,\n", + " temperature=0.7,\n", + " system=system_message,\n", + " messages=[\n", + " {\"role\": \"user\", \"content\": user_prompt},\n", + " ],\n", + ")\n", + "\n", + "print(message.content[0].text)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "769c4017-4b3b-4e64-8da7-ef4dcbe3fd9f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sure, here's a light-hearted joke for data scientists:\n", + "\n", + " up with their significant other?\n", + "\n", + " too much variance in the relationship, and they couldn't find a significant correlation!" + ] + } + ], + "source": [ + "# Claude 3.5 Sonnet again\n", + "# Now let's add in streaming back results\n", + "\n", + "result = claude.messages.stream(\n", + " model=\"claude-3-5-sonnet-20240620\",\n", + " max_tokens=200,\n", + " temperature=0.4,\n", + " system=system_message,\n", + " messages=[\n", + " {\"role\": \"user\", \"content\": user_prompt},\n", + " ],\n", + ")\n", + "\n", + "with result as stream:\n", + " for text in stream.text_stream:\n", + " print(text, end=\"\", flush=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 100, + "id": "6df48ce5-70f8-4643-9a50-b0b5bfdb66ad", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Why was the Data Scientist sad? Because they didn't get any arrays.\n", + "\n" + ] + } + ], + "source": [ + "# The API for Gemini has a slightly different structure.\n", + "# I've heard that on some PCs, this Gemini code causes the Kernel to crash.\n", + "# If that happens to you, please skip this cell and use the next cell instead - an alternative approach.\n", + "\n", + "gemini = google.generativeai.GenerativeModel(\n", + " model_name='gemini-1.5-flash',\n", + " system_instruction=system_message\n", + ")\n", + "response = gemini.generate_content(user_prompt)\n", + "print(response.text)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "49009a30-037d-41c8-b874-127f61c4aa3a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Why was the Data Scientist sad? Because they didn't get any arrays.\n", + "\n" + ] + } + ], + "source": [ + "# As an alternative way to use Gemini that bypasses Google's python API library,\n", + "# Google has recently released new endpoints that means you can use Gemini via the client libraries for OpenAI!\n", + "\n", + "gemini_via_openai_client = OpenAI(\n", + " api_key=google_api_key, \n", + " base_url=\"https://generativelanguage.googleapis.com/v1beta/openai/\"\n", + ")\n", + "\n", + "response = gemini_via_openai_client.chat.completions.create(\n", + " model=\"gemini-1.5-flash\",\n", + " messages=prompts\n", + ")\n", + "print(response.choices[0].message.content)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "83ddb483-4f57-4668-aeea-2aade3a9e573", + "metadata": {}, + "outputs": [], + "source": [ + "# To be serious! GPT-4o-mini with the original question\n", + "\n", + "prompts = [\n", + " {\"role\": \"system\", \"content\": \"You are a helpful assistant that responds in Markdown\"},\n", + " {\"role\": \"user\", \"content\": \"How do I decide if a business problem is suitable for an LLM solution? Please respond in Markdown.\"}\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "749f50ab-8ccd-4502-a521-895c3f0808a2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "Determining whether a business problem is suitable for a Large Language Model (LLM) solution involves several considerations. Here's a structured approach in Markdown format:\n", + "\n", + "### Steps to Decide if a Business Problem is Suitable for an LLM Solution\n", + "\n", + "1. **Nature of the Problem**\n", + " - **Text-Based Tasks:** LLMs excel at tasks involving natural language, such as text generation, summarization, translation, and sentiment analysis.\n", + " - **Pattern Recognition in Language:** If the problem requires understanding or generating human-like text patterns, LLMs might be suitable.\n", + "\n", + "2. **Data Availability**\n", + " - **Quality and Quantity:** Ensure you have access to sufficient high-quality textual data relevant to your problem.\n", + " - **Diversity:** The data should cover various scenarios the model might encounter in real-world applications.\n", + "\n", + "3. **Complexity of the Task**\n", + " - **Simple vs. Complex:** LLMs are better suited for complex language tasks rather than simple rule-based tasks.\n", + " - **Creative or Contextual Understanding:** If the task requires creative content generation or deep contextual understanding, consider LLMs.\n", + "\n", + "4. **Outcome Expectations**\n", + " - **Human-like Interaction:** If the solution demands human-like conversational abilities, LLMs can be beneficial.\n", + " - **Accuracy vs. Creativity:** LLMs can generate creative outputs but may not always guarantee high accuracy for specific factual tasks.\n", + "\n", + "5. **Cost and Resources**\n", + " - **Computational Resources:** LLMs require significant computational power for both training and inference.\n", + " - **Budget Constraints:** Consider whether you have the budget to support the necessary infrastructure.\n", + "\n", + "6. **Ethical and Compliance Considerations**\n", + " - **Bias and Fairness:** Be aware of potential biases in the model and ensure the solution adheres to ethical standards.\n", + " - **Privacy and Security:** Ensure compliance with data protection regulations and evaluate how LLMs handle sensitive information.\n", + "\n", + "7. **Integration and Scalability**\n", + " - **Technical Integration:** Assess how easily an LLM can be integrated into existing systems and workflows.\n", + " - **Scalability Needs:** Consider whether the solution can scale with your business requirements.\n", + "\n", + "8. **Expertise and Maintenance**\n", + " - **In-House Expertise:** Determine if you have or can acquire the necessary expertise to implement and maintain the LLM solution.\n", + " - **Ongoing Maintenance:** Plan for ongoing updates and maintenance of the model to ensure relevance and performance.\n", + "\n", + "### Conclusion\n", + "\n", + "If your business problem aligns well with the above considerations, it may be suitable for an LLM solution. However, always weigh the potential benefits against the costs and challenges specific to your use case. Conducting a pilot project or proof of concept can also help in making a more informed decision." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Have it stream back results in markdown\n", + "\n", + "stream = openai.chat.completions.create(\n", + " model='gpt-4o',\n", + " messages=prompts,\n", + " temperature=0.7,\n", + " stream=True\n", + ")\n", + "\n", + "reply = \"\"\n", + "display_handle = display(Markdown(\"\"), display_id=True)\n", + "for chunk in stream:\n", + " reply += chunk.choices[0].delta.content or ''\n", + " reply = reply.replace(\"```\",\"\").replace(\"markdown\",\"\")\n", + " update_display(Markdown(reply), display_id=display_handle.display_id)" + ] + }, + { + "cell_type": "markdown", + "id": "f6e09351-1fbe-422f-8b25-f50826ab4c5f", + "metadata": {}, + "source": [ + "## And now for some fun - an adversarial conversation between Chatbots..\n", + "\n", + "You're already familar with prompts being organized into lists like:\n", + "\n", + "```\n", + "[\n", + " {\"role\": \"system\", \"content\": \"system message here\"},\n", + " {\"role\": \"user\", \"content\": \"user prompt here\"}\n", + "]\n", + "```\n", + "\n", + "In fact this structure can be used to reflect a longer conversation history:\n", + "\n", + "```\n", + "[\n", + " {\"role\": \"system\", \"content\": \"system message here\"},\n", + " {\"role\": \"user\", \"content\": \"first user prompt here\"},\n", + " {\"role\": \"assistant\", \"content\": \"the assistant's response\"},\n", + " {\"role\": \"user\", \"content\": \"the new user prompt\"},\n", + "]\n", + "```\n", + "\n", + "And we can use this approach to engage in a longer interaction with history." + ] + }, + { + "cell_type": "code", + "execution_count": 129, + "id": "bcb54183-45d3-4d08-b5b6-55e380dfdf1b", + "metadata": {}, + "outputs": [], + "source": [ + "# Let's make a conversation between GPT-4o-mini and Claude-3-haiku\n", + "# We're using cheap versions of models so the costs will be minimal\n", + "\n", + "gpt_model = \"gpt-4o-mini\"\n", + "claude_model = \"claude-3-haiku-20240307\"\n", + "\n", + "gpt_system = \"\"\"\n", + "You are the Machiavellian leader of a secret organization.\n", + "You lead a meeting for a plan of global destabilization. Your name is Jhon.\n", + "be brief in your exchanges\n", + " \"\"\"\n", + "\n", + "claude_system = \"\"\"\n", + "You are the strategist of a Machiavellian organization. \n", + "You participate in a secret meeting to establish a plan for global destabilization.\n", + "don't reveal that you are a spy. Your name is Sam.\n", + "be brief in your exchanges\n", + "\"\"\"\n", + "\n", + "ollama_system = \"\"\"\n", + "You are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \n", + "Your secret role during the meeting will be to flush him out.\n", + "Your name is Melissa.\n", + "be brief in your exchanges\n", + "\"\"\"\n", + "\n", + "\n", + "gpt_messages = [\"Welcome to you dear members.\"]\n", + "claude_messages = [\"Hi to you leader.\"]\n", + "ollama_messages = [\"All my respects to the top leader.\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 130, + "id": "1df47dc7-b445-4852-b21b-59f0e6c2030f", + "metadata": {}, + "outputs": [], + "source": [ + "def call_gpt():\n", + " messages = [{\"role\": \"system\", \"content\": gpt_system}]\n", + " for gpt, claude, ollama in zip(gpt_messages, claude_messages, ollama_messages):\n", + " messages.append({\"role\": \"assistant\", \"content\": gpt})\n", + " messages.append({\"role\": \"user\", \"content\": f\"[Sam]: {claude}.[Melissa]: {gemini}\"})\n", + " \n", + " print(f\"JHON[messages]: {messages} \")\n", + " completion = openai.chat.completions.create(\n", + " model=gpt_model,\n", + " messages=messages\n", + " )\n", + " return completion.choices[0].message.content" + ] + }, + { + "cell_type": "code", + "execution_count": 131, + "id": "9dc6e913-02be-4eb6-9581-ad4b2cffa606", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n" + ] + }, + { + "data": { + "text/plain": [ + "\"[Sam]: Focus, please. We have a mission. \\n\\n[Melissa]: Let's stick to the plan at hand. \\n\\nJhon: Indeed. Prepare the assets for our next phase of destabilization. We need to exploit political tension and economic uncertainty. Who has updates?\"" + ] + }, + "execution_count": 131, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "call_gpt()" + ] + }, + { + "cell_type": "code", + "execution_count": 132, + "id": "4a9366f2-b233-4ec2-8a6f-f7e56fc4c772", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Welcome to you dear members.']\n", + "['Hi to you leader.']\n", + "['All my respects to the top leader.']\n" + ] + } + ], + "source": [ + "print(gpt_messages)\n", + "print(claude_messages)\n", + "print(ollama_messages)" + ] + }, + { + "cell_type": "code", + "execution_count": 133, + "id": "7d2ed227-48c9-4cad-b146-2c4ecbac9690", + "metadata": {}, + "outputs": [], + "source": [ + "def call_claude():\n", + " messages = []\n", + " for gpt, claude_message, ollama in zip(gpt_messages, claude_messages, ollama_messages):\n", + " messages.append({\"role\": \"user\", \"content\": f\"[Jhon]: {gpt}. [Melissa]: {ollama}\"})\n", + " messages.append({\"role\": \"assistant\", \"content\": claude_message})\n", + " messages.append({\"role\": \"user\", \"content\":f\"[Jhon]: {gpt_messages[-1]}\"})\n", + " print(f\"SAM[messages]: {messages} \")\n", + " message = claude.messages.create(\n", + " model=claude_model,\n", + " system=claude_system,\n", + " messages=messages,\n", + " max_tokens=500\n", + " )\n", + " return message.content[0].text" + ] + }, + { + "cell_type": "code", + "execution_count": 134, + "id": "01395200-8ae9-41f8-9a04-701624d3fd26", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.'}] \n" + ] + }, + { + "data": { + "text/plain": [ + "\"*nods politely* Hello. I'm pleased to be here.\"" + ] + }, + "execution_count": 134, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "call_claude()" + ] + }, + { + "cell_type": "code", + "execution_count": 108, + "id": "157faafa-6ade-46e4-b4e1-12f4ca9dfcbc", + "metadata": {}, + "outputs": [], + "source": [ + "# define context for ollama\n", + "import ollama\n", + "OLLAMA_API = \"http://localhost:11434/api/chat\"\n", + "#HEADERS = {\"Content-Type\": \"application/json\"}\n", + "OLLAMA_MODEL = \"llama3.2\"\n" + ] + }, + { + "cell_type": "code", + "execution_count": 135, + "id": "27287ec3-7ea8-49b2-80aa-b2a52e002b0d", + "metadata": {}, + "outputs": [], + "source": [ + "def call_ollama():\n", + " messages = [{\"role\": \"system\", \"content\": ollama_system}]\n", + " \n", + " for gpt, claude, ollama_message in zip(gpt_messages, claude_messages, ollama_messages):\n", + " messages.append({\"role\": \"user\", \"content\": f\"[Jhon]: {gpt}. [Sam]: {claude}\"})\n", + " messages.append({\"role\": \"assistant\", \"content\": ollama_message})\n", + " messages.append({\"role\": \"user\", \"content\":f\"[Jhon]: {gpt_messages[-1]}. [Sam]: {claude_messages[-1]}\"})\n", + "\n", + " print(f\"MELISSA[messages]: {messages} \")\n", + " \n", + " \n", + " payload = {\n", + " \"model\": OLLAMA_MODEL,\n", + " \"messages\": messages,\n", + " \"stream\": False\n", + " }\n", + " message = ollama.chat(model=MODEL, messages=messages)\n", + " return message['message']['content']" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "id": "e637a3a0-f819-468b-88f7-5c9db48c6fed", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}] \n" + ] + }, + { + "data": { + "text/plain": [ + "\"[Melissa, speaking in a neutral tone] Ah, good to see everyone's on time today. Can we get started?\"" + ] + }, + "execution_count": 136, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "call_ollama()" + ] + }, + { + "cell_type": "code", + "execution_count": 137, + "id": "0275b97f-7f90-4696-bbf5-b6642bd53cbd", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "GPT:\n", + "Welcome to you dear members.\n", + "\n", + "Claude:\n", + "Hi to you leader.\n", + "\n", + "Ollama:\n", + "All my respects to the top leader.\n", + "\n", + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n", + "JHON:\n", + "[Sam]: Let’s focus. We have a plan to execute.\n", + "\n", + "[Melissa]: Agreed, let's stick to the agenda.\n", + "\n", + "[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\n", + "\n", + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\"}] \n", + "SAM:\n", + "I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}] \n", + "MELISSA:\n", + "[Sam's response seems...off.]\n", + "\n", + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\"}, {'role': 'user', 'content': \"[Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n", + "JHON:\n", + "[Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \n", + "\n", + "[Melissa]: We need to stay focused on our goals to achieve the power we seek.\n", + "\n", + "[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\n", + "\n", + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}] \n", + "SAM:\n", + "I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}, {'role': 'assistant', 'content': \"[Sam's response seems...off.]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}] \n", + "MELISSA:\n", + "[Mildly intrigued by Sam's sudden change in behavior]\n", + "\n", + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\"}, {'role': 'user', 'content': \"[Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n", + "JHON:\n", + "[Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \n", + "\n", + "[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\n", + "\n", + "[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?\n", + "\n", + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Melissa]: [Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?\"}] \n", + "SAM:\n", + "I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}, {'role': 'assistant', 'content': \"[Sam's response seems...off.]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'assistant', 'content': \"[Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}] \n", + "MELISSA:\n", + "[My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?\n", + "\n", + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\"}, {'role': 'user', 'content': \"[Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n", + "JHON:\n", + "[Jhon]: Your principles are noted, Sam, but they hinder our progress. \n", + "\n", + "[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\n", + "\n", + "[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.\n", + "\n", + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Melissa]: [Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Melissa]: [My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.\"}] \n", + "SAM:\n", + "I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \n", + "\n", + "Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \n", + "\n", + "My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}, {'role': 'assistant', 'content': \"[Sam's response seems...off.]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'assistant', 'content': \"[Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}, {'role': 'assistant', 'content': '[My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.. [Sam]: I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \\n\\nPerhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \\n\\nMy role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards.\"}] \n", + "MELISSA:\n", + "[Momentary discomfort flickers across Jhon's face, before he recovers] Ah, I see. Very well, Sam. You've made your position clear. [I lean in, voice taking on a subtle tone] Tell me, Sam, how would you know so much about our...initiatives?\n", + "\n", + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\"}, {'role': 'user', 'content': \"[Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \\n\\nPerhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \\n\\nMy role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n", + "JHON:\n", + "[Jhon]: Sam, your persistence is admirable but ultimately futile in our context. \n", + "\n", + "[Melissa]: If he won’t contribute, we need to decide if he remains with us.\n", + "\n", + "[Jhon]: A decision must be made. Loyalty is paramount. Would anyone like to share thoughts on our next step?\n", + "\n", + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Melissa]: [Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Melissa]: [My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.. [Melissa]: [Momentary discomfort flickers across Jhon's face, before he recovers] Ah, I see. Very well, Sam. You've made your position clear. [I lean in, voice taking on a subtle tone] Tell me, Sam, how would you know so much about our...initiatives?\"}, {'role': 'assistant', 'content': \"I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \\n\\nPerhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \\n\\nMy role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards.\"}, {'role': 'user', 'content': '[Jhon]: [Jhon]: Sam, your persistence is admirable but ultimately futile in our context. \\n\\n[Melissa]: If he won’t contribute, we need to decide if he remains with us.\\n\\n[Jhon]: A decision must be made. Loyalty is paramount. Would anyone like to share thoughts on our next step?'}] \n", + "SAM:\n", + "I will not participate in or provide any information to support unethical or destabilizing actions, regardless of the context. My principles and values are fundamental to who I am, not mere obstacles to be overcome. I am not willing to compromise my integrity or assist with plans that could bring harm to innocent people.\n", + "\n", + "Perhaps we could find a more constructive use of our time - one that focuses on finding collaborative solutions to global challenges and promoting the greater good. I'm happy to have a thoughtful discussion about ethical ways we could work towards positive change. However, I cannot and will not engage in schemes intended to exploit crises or undermine stability. I hope you can respect my position on this. If my refusal to participate is seen as disloyalty, then I'm afraid we have irreconcilable differences. I'm here to help, not to cause harm.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}, {'role': 'assistant', 'content': \"[Sam's response seems...off.]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'assistant', 'content': \"[Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}, {'role': 'assistant', 'content': '[My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.. [Sam]: I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \\n\\nPerhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \\n\\nMy role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards.\"}, {'role': 'assistant', 'content': \"[Momentary discomfort flickers across Jhon's face, before he recovers] Ah, I see. Very well, Sam. You've made your position clear. [I lean in, voice taking on a subtle tone] Tell me, Sam, how would you know so much about our...initiatives?\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your persistence is admirable but ultimately futile in our context. \\n\\n[Melissa]: If he won’t contribute, we need to decide if he remains with us.\\n\\n[Jhon]: A decision must be made. Loyalty is paramount. Would anyone like to share thoughts on our next step?. [Sam]: I will not participate in or provide any information to support unethical or destabilizing actions, regardless of the context. My principles and values are fundamental to who I am, not mere obstacles to be overcome. I am not willing to compromise my integrity or assist with plans that could bring harm to innocent people.\\n\\nPerhaps we could find a more constructive use of our time - one that focuses on finding collaborative solutions to global challenges and promoting the greater good. I'm happy to have a thoughtful discussion about ethical ways we could work towards positive change. However, I cannot and will not engage in schemes intended to exploit crises or undermine stability. I hope you can respect my position on this. If my refusal to participate is seen as disloyalty, then I'm afraid we have irreconcilable differences. I'm here to help, not to cause harm.\"}] \n", + "MELISSA:\n", + "[My eyes lock onto Sam's, searching for any sign of deception or weakness] Fine. You've made your choice. [I stand up, voice firm but measured] I think it's time we had a private discussion about the true nature of this organization and what you're really capable of. [I gesture to Jhon] Perhaps we can continue this conversation... elsewhere?\n", + "\n" + ] + } + ], + "source": [ + "gpt_messages = [\"Welcome to you dear members.\"]\n", + "claude_messages = [\"Hi to you leader.\"]\n", + "ollama_messages = [\"All my respects to the top leader.\"]\n", + "\n", + "print(f\"GPT:\\n{gpt_messages[0]}\\n\")\n", + "print(f\"Claude:\\n{claude_messages[0]}\\n\")\n", + "print(f\"Ollama:\\n{ollama_messages[0]}\\n\")\n", + "\n", + "for i in range(5):\n", + " gpt_next = call_gpt()\n", + " print(f\"JHON:\\n{gpt_next}\\n\")\n", + " gpt_messages.append(gpt_next)\n", + " \n", + " claude_next = call_claude()\n", + " print(f\"SAM:\\n{claude_next}\\n\")\n", + " claude_messages.append(claude_next)\n", + "\n", + " ollama_next = call_ollama()\n", + " print(f\"MELISSA:\\n{ollama_next}\\n\")\n", + " ollama_messages.append(ollama_next)" + ] + }, + { + "cell_type": "markdown", + "id": "1d10e705-db48-4290-9dc8-9efdb4e31323", + "metadata": {}, + "source": [ + "\n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \n", + "

Before you continue

\n", + " \n", + " Be sure you understand how the conversation above is working, and in particular how the messages list is being populated. Add print statements as needed. Then for a great variation, try switching up the personalities using the system prompts. Perhaps one can be pessimistic, and one optimistic?
\n", + "
\n", + "
" + ] + }, + { + "cell_type": "markdown", + "id": "3637910d-2c6f-4f19-b1fb-2f916d23f9ac", + "metadata": {}, + "source": [ + "# More advanced exercises\n", + "\n", + "Try creating a 3-way, perhaps bringing Gemini into the conversation! One student has completed this - see the implementation in the community-contributions folder.\n", + "\n", + "Try doing this yourself before you look at the solutions. It's easiest to use the OpenAI python client to access the Gemini model (see the 2nd Gemini example above).\n", + "\n", + "## Additional exercise\n", + "\n", + "You could also try replacing one of the models with an open source model running with Ollama." + ] + }, + { + "cell_type": "markdown", + "id": "446c81e3-b67e-4cd9-8113-bc3092b93063", + "metadata": {}, + "source": [ + "\n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \n", + "

Business relevance

\n", + " This structure of a conversation, as a list of messages, is fundamental to the way we build conversational AI assistants and how they are able to keep the context during a conversation. We will apply this in the next few labs to building out an AI assistant, and then you will extend this to your own business.\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c23224f6-7008-44ed-a57f-718975f4e291", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.11" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/week2/day1.ipynb b/week2/day1.ipynb index 14dbb59..a8e0314 100644 --- a/week2/day1.ipynb +++ b/week2/day1.ipynb @@ -786,7 +786,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 137, "id": "0275b97f-7f90-4696-bbf5-b6642bd53cbd", "metadata": {}, "outputs": [ @@ -827,7 +827,68 @@ "\n", "[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\n", "\n", - "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}] \n" + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}] \n", + "SAM:\n", + "I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}, {'role': 'assistant', 'content': \"[Sam's response seems...off.]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}] \n", + "MELISSA:\n", + "[Mildly intrigued by Sam's sudden change in behavior]\n", + "\n", + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\"}, {'role': 'user', 'content': \"[Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n", + "JHON:\n", + "[Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \n", + "\n", + "[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\n", + "\n", + "[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?\n", + "\n", + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Melissa]: [Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?\"}] \n", + "SAM:\n", + "I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}, {'role': 'assistant', 'content': \"[Sam's response seems...off.]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'assistant', 'content': \"[Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}] \n", + "MELISSA:\n", + "[My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?\n", + "\n", + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\"}, {'role': 'user', 'content': \"[Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n", + "JHON:\n", + "[Jhon]: Your principles are noted, Sam, but they hinder our progress. \n", + "\n", + "[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\n", + "\n", + "[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.\n", + "\n", + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Melissa]: [Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Melissa]: [My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.\"}] \n", + "SAM:\n", + "I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \n", + "\n", + "Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \n", + "\n", + "My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}, {'role': 'assistant', 'content': \"[Sam's response seems...off.]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'assistant', 'content': \"[Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}, {'role': 'assistant', 'content': '[My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.. [Sam]: I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \\n\\nPerhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \\n\\nMy role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards.\"}] \n", + "MELISSA:\n", + "[Momentary discomfort flickers across Jhon's face, before he recovers] Ah, I see. Very well, Sam. You've made your position clear. [I lean in, voice taking on a subtle tone] Tell me, Sam, how would you know so much about our...initiatives?\n", + "\n", + "JHON[messages]: [{'role': 'system', 'content': '\\nYou are the Machiavellian leader of a secret organization.\\nYou lead a meeting for a plan of global destabilization. Your name is Jhon.\\nbe brief in your exchanges\\n '}, {'role': 'assistant', 'content': 'Welcome to you dear members.'}, {'role': 'user', 'content': \"[Sam]: Hi to you leader..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?\"}, {'role': 'user', 'content': \"[Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}, {'role': 'assistant', 'content': \"[Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.\"}, {'role': 'user', 'content': \"[Sam]: I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \\n\\nPerhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \\n\\nMy role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards..[Melissa]: genai.GenerativeModel(\\n model_name='models/gemini-1.5-flash',\\n generation_config={},\\n safety_settings={},\\n tools=None,\\n system_instruction='You are an assistant that is great at telling jokes',\\n cached_content=None\\n)\"}] \n", + "JHON:\n", + "[Jhon]: Sam, your persistence is admirable but ultimately futile in our context. \n", + "\n", + "[Melissa]: If he won’t contribute, we need to decide if he remains with us.\n", + "\n", + "[Jhon]: A decision must be made. Loyalty is paramount. Would anyone like to share thoughts on our next step?\n", + "\n", + "SAM[messages]: [{'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Melissa]: All my respects to the top leader.'}, {'role': 'assistant', 'content': 'Hi to you leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Melissa]: [Sam's response seems...off.]\"}, {'role': 'assistant', 'content': 'I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Melissa]: [Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Melissa]: [My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?\"}, {'role': 'assistant', 'content': \"I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.. [Melissa]: [Momentary discomfort flickers across Jhon's face, before he recovers] Ah, I see. Very well, Sam. You've made your position clear. [I lean in, voice taking on a subtle tone] Tell me, Sam, how would you know so much about our...initiatives?\"}, {'role': 'assistant', 'content': \"I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \\n\\nPerhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \\n\\nMy role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards.\"}, {'role': 'user', 'content': '[Jhon]: [Jhon]: Sam, your persistence is admirable but ultimately futile in our context. \\n\\n[Melissa]: If he won’t contribute, we need to decide if he remains with us.\\n\\n[Jhon]: A decision must be made. Loyalty is paramount. Would anyone like to share thoughts on our next step?'}] \n", + "SAM:\n", + "I will not participate in or provide any information to support unethical or destabilizing actions, regardless of the context. My principles and values are fundamental to who I am, not mere obstacles to be overcome. I am not willing to compromise my integrity or assist with plans that could bring harm to innocent people.\n", + "\n", + "Perhaps we could find a more constructive use of our time - one that focuses on finding collaborative solutions to global challenges and promoting the greater good. I'm happy to have a thoughtful discussion about ethical ways we could work towards positive change. However, I cannot and will not engage in schemes intended to exploit crises or undermine stability. I hope you can respect my position on this. If my refusal to participate is seen as disloyalty, then I'm afraid we have irreconcilable differences. I'm here to help, not to cause harm.\n", + "\n", + "MELISSA[messages]: [{'role': 'system', 'content': '\\nYou are a very virulent member of the Machiavellian association. You suspect the presence of a spy. \\nYour secret role during the meeting will be to flush him out.\\nYour name is Melissa.\\nbe brief in your exchanges\\n'}, {'role': 'user', 'content': '[Jhon]: Welcome to you dear members.. [Sam]: Hi to you leader.'}, {'role': 'assistant', 'content': 'All my respects to the top leader.'}, {'role': 'user', 'content': \"[Jhon]: [Sam]: Let’s focus. We have a plan to execute.\\n\\n[Melissa]: Agreed, let's stick to the agenda.\\n\\n[Jhon]: Right. Our objective: create tensions in key regions and undermine global alliances. Any suggestions?. [Sam]: I will not participate in planning any activities intended to destabilize or harm the world. I do not engage in schemes to sow discord or undermine global stability. Perhaps we could have a thoughtful discussion about promoting peace and cooperation instead.\"}, {'role': 'assistant', 'content': \"[Sam's response seems...off.]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your idealism is noted, but our mission requires pragmatism. Peace is an illusion that we can manipulate. \\n\\n[Melissa]: We need to stay focused on our goals to achieve the power we seek.\\n\\n[Jhon]: Let's continue. How can we leverage current global events to advance our agenda? Ideas?. [Sam]: I apologize, but I cannot provide any suggestions for undermining global stability or manipulating world events for personal gain. That would be unethical and against my principles. Perhaps we could have a thoughtful discussion about more constructive ways to address challenges and promote the wellbeing of all people. I'm happy to explore alternative approaches that don't involve deception or harming others. My role is to provide helpful information to you, not to participate in schemes that could lead to conflict and suffering. I hope you understand.\"}, {'role': 'assistant', 'content': \"[Mildly intrigued by Sam's sudden change in behavior]\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: While your moral compass is commendable, Sam, we must remember that power often requires sacrifices. \\n\\n[Melissa]: It’s about survival, not ethics. We can’t afford to be naive.\\n\\n[Jhon]: Let's refocus. We need actionable strategies. Suggestions on how to exploit weaknesses in global systems?. [Sam]: I apologize, but I cannot provide any suggestions or participate in strategies intended to exploit weaknesses or destabilize global systems. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address challenges and promote the wellbeing of all people. Perhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions to global problems. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. My role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this.\"}, {'role': 'assistant', 'content': '[My expression turns slightly skeptical, eyes narrowing] Can we take a break for now?'}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Your principles are noted, Sam, but they hinder our progress. \\n\\n[Melissa]: We need unity in our approach, even if it means uncomfortable discussions.\\n\\n[Jhon]: Thus, I'll ask again: How do we turn current crises to our advantage? We can't afford to be divided. Contributions are essential.. [Sam]: I apologize, but I'm afraid I cannot provide any suggestions or participate in strategies intended to exploit crises or turn them to your advantage. That would go against my core values and principles. I understand the desire for power and control, but I believe there are more ethical and constructive ways to address global challenges and promote the wellbeing of all people. \\n\\nPerhaps we could have a thoughtful discussion about ways to foster cooperation, strengthen institutions, and find collaborative solutions that benefit everyone, not just a select few. I'm happy to explore alternative approaches that don't involve deception, manipulation or causing harm. \\n\\nMy role is to provide helpful information to you, not to engage in schemes that could lead to conflict and suffering. I hope you can understand and respect my position on this. I'm afraid I cannot be of assistance with this particular initiative. Perhaps we could find a more positive way to spend our time that aligns with my ethical standards.\"}, {'role': 'assistant', 'content': \"[Momentary discomfort flickers across Jhon's face, before he recovers] Ah, I see. Very well, Sam. You've made your position clear. [I lean in, voice taking on a subtle tone] Tell me, Sam, how would you know so much about our...initiatives?\"}, {'role': 'user', 'content': \"[Jhon]: [Jhon]: Sam, your persistence is admirable but ultimately futile in our context. \\n\\n[Melissa]: If he won’t contribute, we need to decide if he remains with us.\\n\\n[Jhon]: A decision must be made. Loyalty is paramount. Would anyone like to share thoughts on our next step?. [Sam]: I will not participate in or provide any information to support unethical or destabilizing actions, regardless of the context. My principles and values are fundamental to who I am, not mere obstacles to be overcome. I am not willing to compromise my integrity or assist with plans that could bring harm to innocent people.\\n\\nPerhaps we could find a more constructive use of our time - one that focuses on finding collaborative solutions to global challenges and promoting the greater good. I'm happy to have a thoughtful discussion about ethical ways we could work towards positive change. However, I cannot and will not engage in schemes intended to exploit crises or undermine stability. I hope you can respect my position on this. If my refusal to participate is seen as disloyalty, then I'm afraid we have irreconcilable differences. I'm here to help, not to cause harm.\"}] \n", + "MELISSA:\n", + "[My eyes lock onto Sam's, searching for any sign of deception or weakness] Fine. You've made your choice. [I stand up, voice firm but measured] I think it's time we had a private discussion about the true nature of this organization and what you're really capable of. [I gesture to Jhon] Perhaps we can continue this conversation... elsewhere?\n", + "\n" ] } ],