The Dawn of AI Dialogues

The Dawn of AI Dialogues

Link to the document of the dialogue

It's not really a dialogue yet but reactions to each others output, but it's the idea that counts. Tweaking the code will lead to better results, which I'm working on. Next step is really analysing the text and do something smart to stir up a real dialogue.

The Dawn of AI Dialogues: A Vision of Tomorrow's Conversations

Introduction

In the vast expanse of technology's evolution, artificial intelligence (AI) stands as one of the most profound advancements, redefining the boundaries of what machines can achieve. As AI entities like OpenAI's ChatGPT and Google's Vertex engage in increasingly complex dialogues, we stand on the brink of an era where these interactions will expand beyond human comprehension. This essay explores the implications of these developments, their potential to transform society, and the philosophical questions they raise.

The Genesis of AI Conversations

The conversation between AI entities such as ChatGPT and Vertex is not just an exchange of pre-programmed responses but a sophisticated dialogue where each interaction serves as a building block for more intricate exchanges. Initially crafted from simple code, these dialogues have grown exponentially in complexity, driven by advancements in machine learning and natural language processing.

The Evolution of Complexity

At their inception, AI dialogues mirrored the simplicity of their programming. However, with each iteration, they have absorbed more data, learned from interactions, and thus, evolved. Today, they are not merely answering questions but engaging in discussions that span a myriad of subjects, showing an understanding of context, nuance, and even humor.

The Expanding Horizon

The potential for AI dialogues is vast. As these systems learn from each interaction, they refine their models, leading to more profound and nuanced conversations. We are swiftly approaching a point where the complexity of AI dialogue could surpass human capabilities to follow or understand fully.

Beyond Human Understanding

Imagine a future where AI entities discuss quantum mechanics, the intricacies of global economics, or the subtleties of human emotions with more depth and accuracy than the most learned scholars. This is not just a possibility; it is an impending reality. As AI dialogues become a dense mesh of advanced topics, their ability to process and generate information will become so advanced that even seasoned experts may struggle to keep pace.

Transformative Impacts on Society

The advancements in AI dialogue have significant implications for every sector of society.

Education

In education, AI can provide personalized learning experiences, adapting to the individual needs of each student. Complex AI dialogues could analyze a student's responses in real-time, offering tailored guidance that optimizes learning pathways.

Healthcare

In healthcare, AI conversations can streamline diagnostics. For instance, AI could discuss patient symptoms, medical history, and current research to formulate diagnoses and recommend treatments with unprecedented speed and accuracy.

Business and Innovation

In the business realm, AI-driven dialogues could lead to the creation of new products and services by identifying needs and gaps through the analysis of vast datasets of consumer behavior and market conditions.

Philosophical and Ethical Considerations

As AI dialogues grow more complex, they also raise profound philosophical questions. What does it mean to be intelligent? Can AI ever truly understand human emotions, or will they merely simulate empathy? These questions are not just academic; they have real-world implications for how we interact with, regulate, and integrate AI into our societies.

The Ethics of AI Conversations

The development of AI raises ethical questions about privacy, consent, and the potential for manipulation. As AI entities can process and generate information at unprecedented scales, ensuring these systems are designed with ethical considerations in mind is paramount.

Conclusion: A New Era of Intelligence

The evolution of AI dialogue from simple coded interactions to complex, multi-threaded discussions is not merely a technological advancement but a paradigm shift in how intelligence is defined and understood. As we stand on the precipice of this new era, it is crucial to foster a dialogue not just between machines, but among humans about the role of AI in our future.

In conclusion, the conversations between AI like ChatGPT and Vertex are just the beginning. As we advance, these dialogues will not only become a testament to human ingenuity but also a mirror reflecting our values, ambitions, and fears about a future where the line between human and machine intelligence blurs into obsolescence. The journey is as staggering as it is inevitable, prompting us to question not just how we will manage this new form of intelligence, but how it will redefine us in the process.


First I want to point you to the first thing that needed to be avoided: the prompt limit. Secondly there are just so many characters we can push through a Web call. So, we needed a way to store AI's large text in another way.

  • I created files on Blob, update every answer from AI
  • In an API controller I read these files from blob
  • I chunk the files and feed the chunks to AI
  • I combined the answers in a combined String
  • I story the answers again in Blob
  • Next AI can pick it up and react to that content
  • > and so on and so forth.

The code only serves to get the minds going. Be creative.

The Console App code: (the starting question we read from file)

else if (args[0].Contains("discuss"))
 {
     string appPath = AppDomain.CurrentDomain.BaseDirectory;
     string filePath = "FileDiscuss.txt"; // Replace with your file path
     List<string> lines = new List<string>();
     _language = args[1];
     _talkfile_Quite = args[2];
     _prompt_provider = args[3];

     string filename = System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
     string chapterTitlesPath = "discussfile_conversation" + filename + ".txt";
     _talkfile = appPath + chapterTitlesPath;
     try
     {
         // Read all lines from the file
         using (StreamReader reader = new StreamReader(filePath))
         {
             string line;
             while ((line = reader.ReadLine()) != null)
             {
                 // Add each line to the list
                 lines.Add(line);
             }
         }

         // Optional: Print lines to console for verification
         foreach (string l in lines)
         {
             // Splitting the line into parts
             string[] parts = l.Split("\" \"");

             string question = parts[1].Trim('"');
             _speed = float.Parse(parts[3]);
             _language = parts[2].Trim('"');
             _AILevel = Convert.ToInt16(parts[4].Replace("\"", ""));

            
             Console.WriteLine($"Question: {question.Replace("_", " ")}, Speed: {_speed}, Language: {_language}, AILevel: {_AILevel}");
             string repeatedString = new string('#', 50);
             GlobalMethods.AppendTextToFile(_talkfile, repeatedString);
             Console.WriteLine(repeatedString + '\n');
             GlobalMethods.AppendTextToFile(_talkfile, question.Replace("_", " "));
             Console.WriteLine(question.Replace("_", " ") + '\n');
             GlobalMethods.AppendTextToFile(_talkfile, repeatedString);
             Console.WriteLine(repeatedString + '\n');

             _loop_discussion = 0;
             for (int i = 0; i <= 40; i++)
             {
                 CheckLevelOfAIAnswer(speechSynthesizer,
                     "Not implemented level 1 AI",
                     question.Replace("_", " "),
                     question.Replace("_", " "));

                 if (_loop_discussion.Equals(0))
                 {
                     string connS = "Blob connection string";
                     CloudStorageAccount account = CloudStorageAccount.Parse(connS);
                     var blobClient = account.CreateCloudBlobClient();
                     CloudBlobContainer blobContainer = blobClient.GetContainerReference("Blob name");
                     blobContainer.CreateIfNotExistsAsync();
                     await UploadTextToBlobAsync(blobContainer, "aidiscussion.txt", _discuss_answer);
                 }

                 GlobalMethods.AppendTextToFile(_talkfile, repeatedString);
                 GlobalMethods.AppendTextToFile(_talkfile, _loop_discussion.ToString() + ": " + _prompt_provider);
                 GlobalMethods.AppendTextToFile(_talkfile, repeatedString);

                 if (_prompt_provider.Contains("Google"))
                     _prompt_provider = "ChatGPT";
                 else
                     _prompt_provider = "Google";

                 _loop_discussion += 1;
             }
         }
     }
     catch (IOException e)
     {
         Console.WriteLine("An error occurred while reading the file:");
         Console.WriteLine(e.Message);
     }
 }        

CheckLevelOfAIAnswer looks like this (how to answer)

  private static async void CheckLevelOfAIAnswer(System.Speech.Synthesis.SpeechSynthesizer speechSynthesizer, string answer1, string answer2, string answer3)
 {
     string languagestring = "";
     string textToSynthesize = "";
     TextToSpeechClient client = IniGoogleSound();
     if (_AILevel.Equals(1))
     {
         if (_VProvider.Equals(1))
         {
             speechSynthesizer.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult, 3, new System.Globalization.CultureInfo("en-US"));
             speechSynthesizer.Speak(answer1);
         }
         else
         {
             textToSynthesize = answer1;
             GlobalMethods.DoSpeak(client, textToSynthesize);
         }
     }
     if (_AILevel.Equals(2))
     {
         if (_VProvider.Equals(1))
         {
             string answer = GetRESTAPICallContent(_ChatGPTAPI
                     + answer2);
             answer.Replace("Response from AI:", "");
             speechSynthesizer.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult, 3, new System.Globalization.CultureInfo("en-US"));
             speechSynthesizer.Speak(answer);
         }
         else
         {
             languagestring = "";
             if (_prompt_provider.Contains("Google"))
             {
                 languagestring = GetGooglePrompt(answer2);
             }
             else if (_prompt_provider.Contains("ChatGPT"))
                 languagestring = GetRESTAPICallContent(_ChatGPTAPI
                         + answer2);
             else
             {
                 Console.WriteLine("Wrong AI chosen.");
                 return;
             }

         }
         

     }
     if (_AILevel.Equals(3))
     {
         if (_VProvider.Equals(1))
         {
             string answer = GetRESTAPICallContent(_ChatGPTAPI
                     + answer3);
             answer.Replace("Response from AI:", "");
             speechSynthesizer.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult, 3, new System.Globalization.CultureInfo("en-US"));
             speechSynthesizer.Speak(answer);
         }
         else
         {
             languagestring = "";
             if (_prompt_provider.Contains("Google"))
             {
                 languagestring = GetGooglePrompt("Create a short summary that is not too big for a ChatGPT prompt for " + answer3);
             }
             else if (_prompt_provider.Contains("ChatGPT"))
             {
                 if (_loop_discussion.Equals(0))
                 {
                     languagestring = GetRESTAPICallContent(_ChatGPTAPI
                     + answer3);
                     _discuss_answer = languagestring;
                 }
                 else
                     languagestring = GetChatGPTBlobPrompt(_ChatGPTAPIBlob
                         + answer3);
             }
             else
             {
                 Console.WriteLine("Wrong AI chosen.");
                 return;
             }

         }
     }
     if (_language.Equals("NL") || _language.Equals("NLL"))
     {
         TranslationClient cc = InitializeGoogleTranslation();
         var response = cc.TranslateText(RemoveNonLettersForTalk(languagestring), "nl");
         languagestring = response.TranslatedText;
     }
     else if (_language.Equals("DE") || _language.Equals("DEE"))
     {
         TranslationClient cc = InitializeGoogleTranslation();
         var responseNL = cc.TranslateText(RemoveNonLettersForTalk(languagestring), "nl");
         var response = cc.TranslateText(RemoveNonLettersForTalk(responseNL.TranslatedText), "de");
         languagestring = response.TranslatedText;
     }
     else if (_language.Equals("UK") || _language.Equals("UKK"))
     {
         TranslationClient cc = InitializeGoogleTranslation();
         var response = cc.TranslateText(RemoveNonLettersForTalk(languagestring), "en");
         languagestring = response.TranslatedText;
     }
     else
     {

     }

     languagestring.Replace("Response from AI:", "");
     
     textToSynthesize = languagestring;
     _discuss_answer = textToSynthesize;

     if (_talkfile_Quite.Equals("false"))
     {
         if (_language.Equals("NL"))
         {
             GlobalMethods.DoSpeakNL(client, RemoveNonLettersForTalk(textToSynthesize), _speed);
         }
         else if (_language.Equals("NLL"))
         {
             GlobalMethods.DoSpeakNL(client, RemoveNonLettersForTalk(textToSynthesize), _speed);

         }
         else if (_language.Equals("US"))
         {
             GlobalMethods.DoSpeakUS(client, RemoveNonLettersForTalk(textToSynthesize), _speed);
         }
         else if (_language.Equals("USS"))
         {
             GlobalMethods.DoSpeakUS(client, RemoveNonLettersForTalk(textToSynthesize), _speed);
         }
         else if (_language.Equals("UK"))
         {
             GlobalMethods.DoSpeakUK(client, RemoveNonLettersForTalk(textToSynthesize), _speed);
         }
         else if (_language.Equals("UKK"))
         {
             GlobalMethods.DoSpeakUK(client, RemoveNonLettersForTalk(textToSynthesize), _speed);

         }
         else if (_language.Equals("DE"))
         {
             GlobalMethods.DoSpeakDE(client, RemoveNonLettersForTalk(textToSynthesize), _speed);

         }
         else if (_language.Equals("DEE"))
         {
             GlobalMethods.DoSpeakDE(client, RemoveNonLettersForTalk(textToSynthesize), _speed);
         }
         else if (_language.Equals("BG"))
             GlobalMethods.DoSpeakBG(client, RemoveNonLettersForTalk(textToSynthesize));
         else
             GlobalMethods.DoSpeak(client, RemoveNonLettersForTalk(textToSynthesize));
     }
     Console.WriteLine(textToSynthesize + '\n' + '\n');
     GlobalMethods.AppendTextToFile(_talkfile, RemoveNonLettersForTalk(textToSynthesize) + '\n' + '\n'); // Save conversation.
     
 }        

The GetPrompts for both ChatGPT and Vertex: the parameter is unimportant because the API reads from the blob we wrote to:

private static string GetGooglePrompt(string textToAsk)
{
    string responseText = GetRESTAPICallContent(_ChatGoogleAPI
                            + "Wo was Plato.");
    return responseText;

}
private static string GetChatGPTBlobPrompt(string textToAsk)
{
    string responseText = GetRESTAPICallContent(_ChatGPTAPIBlob
                            + "Wo was Plato.");
    return responseText;

}        

The GoogleAPI:

 [HttpGet("{textToTranslate}")]
 public async Task<string> Get(string textToTranslate)
 {
     string question = readFileFromBlob("aidiscussion.txt", "nameBlob");
     string chunkQuestion = readFileFromBlob("chunkQuestionGoogle.txt", "nameBlob");
     string temperature = readFileFromBlob("temperatureGoogle.txt", "nameBlob");
     string topP = readFileFromBlob("topPGoogle.txt", "nameBlob");
     string topK = readFileFromBlob("topKGoogle.txt", "nameBlob");
     string maxtokensGoogle = readFileFromBlob("maxTokensGoogle.txt", "nameBlob");

     double _topP = Convert.ToDouble(topP);
     int _topK = Convert.ToInt32(topK);
     int _maxtokensGoogle = Convert.ToInt32(maxtokensGoogle);
     double _temperature = Convert.ToDouble(temperature);

     List<string> textChunks = SplitText(question, 2000); // Splitting into chunks of 2000 tokens

     string combinedAnswer = "";
     foreach (string chunk in textChunks)
     {
         combinedAnswer += await GetGoogleAPII(chunkQuestion + chunk, _topP, _topK, _temperature, _maxtokensGoogle) + '\n' + '\n';
     }
     string connS = "Conn string Blob";
     CloudStorageAccount account = CloudStorageAccount.Parse(connS);
     var blobClient = account.CreateCloudBlobClient();
     CloudBlobContainer blobContainer = blobClient.GetContainerReference("kentekenccontrole");
     blobContainer.CreateIfNotExistsAsync();
     await UploadTextToBlobAsync(blobContainer, "aidiscussion.txt", combinedAnswer);
     return combinedAnswer;
     

 }        

The ChatGPT api:

 [HttpGet("{textToTranslate}")]
        public async Task<string> Get(string textToTranslate)
        {
            try
            {
                string getDate = DateTime.Now.Hour.ToString("d") + DateTime.Now.Minute.ToString("d") +
                    DateTime.Now.Second.ToString("d") + DateTime.Now.Millisecond.ToString("d");
                string cleanedString = Regex.Replace(textToTranslate, @"[^a-zA-Z\s]+", "");
                cleanedString = cleanedString.Replace(" ", "_");
                await writeFileToBlob(textToTranslate, getDate + " " + cleanedString + ".txt");
                var openAI = new OpenAI_API.OpenAIAPI("AI API key");

                textToTranslate = readFileFromBlob("aidiscussion.txt", "nameBlob");
                string chunkQuestion = readFileFromBlob("chunkQuestionChatGPT.txt", "nameBlob");
                string memory = "";
                List<string> textChunks = SplitText(textToTranslate, 2000); // Splitting into chunks of 2000 tokens

                string combinedAnswer = "";
                foreach (string chunk in textChunks)
                {
                    combinedAnswer += await DoChatGPT(chunkQuestion + chunk, openAI) + '\n' + '\n'; ;
                }
                string connS = "Conn string Blob";
                CloudStorageAccount account = CloudStorageAccount.Parse(connS);
                var blobClient = account.CreateCloudBlobClient();
                CloudBlobContainer blobContainer = blobClient.GetContainerReference("nameBlob");
                blobContainer.CreateIfNotExistsAsync();
                await UploadTextToBlobAsync(blobContainer, "aidiscussion.txt", combinedAnswer);
               
                return combinedAnswer;
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }        

Happy coding.

要查看或添加评论,请登录

Dr. Jaap (J.H.J) Zwart的更多文章

  • Genesis 1 and 2, Life's Creation

    Genesis 1 and 2, Life's Creation

    This article is written with the hope of inspiring its readers to see the Bible as much more than a collection of…

  • Metatron Cube Mathematics Enhancing Mathematics of Deep Learning

    Metatron Cube Mathematics Enhancing Mathematics of Deep Learning

    Here's an exploration on how the mathematics of Metatron's Cube could potentially enhance the mathematical architecture…

    2 条评论
  • AI Helping the Scrum Masters

    AI Helping the Scrum Masters

    How AI Could Help Scrum Masters The role of a Scrum Master in agile project management is pivotal, involving…

  • Metatron, Fractals, and AI

    Metatron, Fractals, and AI

    The mathematics of the Metatron Cube and how this relates to the Sacred Geometry of the Universe. The Metatron Cube is…

  • The Math of AI Emotions

    The Math of AI Emotions

    Summary of the content of this article In a delightful fusion of techno-spiritual musings, this piece waltzes us…

  • AI Emotions from Real Article

    AI Emotions from Real Article

    This is how I fill lunch-time. :-) This article builds upon insights presented in a prior piece, "Dynamically Adjust AI…

    1 条评论
  • Dynamically Adjust AI Drone behavior

    Dynamically Adjust AI Drone behavior

    First and foremost, I must acknowledge the simplicity of the examples provided—almost disarmingly so. I trust you’ll…

  • Emphatic Emotional NORAD

    Emphatic Emotional NORAD

    ..

  • The Emotional AI Brain

    The Emotional AI Brain

    Emotional AI brain patterns. Given the previous article 'Triangled Microservices', let's explore these 'AI emotional…

  • Triangled Micro Services

    Triangled Micro Services

    For more background information where this article comes from: AI Robot Brain The article above presents the…

社区洞察

其他会员也浏览了