Applying ChatGPT to anything in Kinetic?

With ChatGPT all over the news, I’m curious if anyone has had success applying it to anything in Kinetic. Would love to hear some examples!

I’ve looked up some errors…And I’ve also asked it to make a humorous version. Try looking up " Failed to EnlistTransaction"

@Mark_Wonsil ChatGPT has a whole heap of Dad Jokes…I asked it to make a 10 minute standup routine of Dad Jokes… Sadly after about 10 it threw a network error :slight_smile:

1 Like

Not directly within Kinetic, yet, but I have found it extremely useful for creating custom batch and regex scripts for development and system maintenance tasks. A lot of the neat Kinetic stuff I’ve wanted to use it for would require it having some contextual data.

1 Like

Tinkering

I like it even more in Service-Now HelpDesk Software

3 Likes

Not related to Kinetic, but in my free time I work with a game design engine called Godot. It has its own language called GDScript. I was trying to figure out why my LERP function wasn’t working, so I copied it into chatGPT and asked what this line of code does. It quickly spit out a one-page response describing the intricacies of linear interpolation and map functions. I then asked it to rewrite the linear interpolate function to logarithmically interpolate. To which it spit out useable code I could copy and paste. I was shocked that it not only recognized GDScript, but was able to write its own code!

Back when coPilot was released, I signed up for it. I don’t use git hub enough, so I never actually played around with it. This was so quick and easy to sign up for and use. Having this kind of prompt-based input is incredible! I hope they keep this tool open and free for everyone!

1 Like

Is it better than Roblox? :slight_smile:

1 Like

Haha!!! No experience there, but I can confidently say, yes. Godot is better.

1 Like

From what my other development resource at the end of the our house says that there is no official ChatGPT API yet but…(I promply fell asleep and will have to revist)…

Asking ChatGPT revealed:

Summary

Is there an API for chatgpt?

ChatGPT is a variant of the GPT (Generative Pre-trained Transformer) language model that was specifically designed for chatbot-like conversational AI applications. It is not an API per se, but rather a pre-trained machine learning model that you can use to generate text based on a given prompt.

To use ChatGPT, you will need to have access to a machine learning framework or library that provides support for loading and running pre-trained models. Some popular options include TensorFlow, PyTorch, and Hugging Face’s Transformers library.

Once you have a machine learning framework set up, you can use it to load the ChatGPT model and generate text by providing it with a prompt and running the model. The generated text will depend on the content of the prompt and the training data that the model was trained on.

Here is an example of how you might use ChatGPT in Python using the Transformers library:

Copy code

from transformers import AutoModelWithLMHead, AutoTokenizer

model = AutoModelWithLMHead.from_pretrained("microsoft/chatbot-gpt")
tokenizer = AutoTokenizer.from_pretrained("microsoft/chatbot-gpt")

def generate_response(prompt):
    input_ids = tokenizer.encode(prompt, return_tensors="pt")
    response = model.generate(input_ids, max_length=1024, top_k=50, top_p=0.9, temperature=0.5)
    return tokenizer.decode(response[0], skip_special_tokens=True)

print(generate_response("Hello, how are you today?"))

This code will load the ChatGPT model and tokenizer, and define a function that takes a prompt as input and generates a response using the model. You can then use this function to generate responses to any prompt that you like.

![](data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%2730%27%20height=%2730%27/%3e)Simon Hall

could you show that in c#

Sure, here is an example of how you might use ChatGPT in C# using the .NET version of the Hugging Face Transformers library:

Copy code

using System;
using System.Linq;
using System.Threading.Tasks;
using HuggingFace.Transformers;
using HuggingFace.Transformers.Models;
using HuggingFace.Transformers.Tokenization;

namespace ChatbotExample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            // Load the ChatGPT model and tokenizer
            var model = await GPT2Model.FromPretrainedAsync("microsoft/chatbot-gpt");
            var tokenizer = await GPT2Tokenizer.FromPretrainedAsync("microsoft/chatbot-gpt");

            // Define a function that generates a response based on a given prompt
            async Task<string> GenerateResponse(string prompt)
            {
                // Encode the prompt as input IDs
                var inputIds = (await tokenizer.EncodeAsync(prompt)).ToList();

                // Generate a response
                var response = await model.GenerateTextAsync(inputIds, maxLength: 1024, doSample: true, topP: 0.9, topK: 50, temperature: 0.5);

                // Decode the response and skip special tokens
                return (await tokenizer.DecodeAsync(response.ToList(), skipSpecialTokens: true)).Trim();
            }

            // Test the function with a prompt
            Console.WriteLine(await GenerateResponse("Hello, how are you today?"));
        }
    }
}

This code will load the ChatGPT model and tokenizer, and define a function that takes a prompt as input and generates a response using the model. You can then use this function to generate responses to any prompt that you like.

Note that this code requires the .NET version of the Hugging Face Transformers library to be installed in your project. You can install it using the following command:

Copy code

dotnet add package HuggingFace.Transformers

I hope this helps! Let me know if you have any questions.

2 Likes

ChatGPT has a lot of information on Epicor. I am able to use it to help write BAQ difficult expressions. Sometimes it gets it wrong, but I keep pressing and it finally gets it right sometimes.

Things I think it’s quite good from a dev perspective:

  • Writing coding documentation (then things that people never read aka 5hrs debugging > 5 mins reading documentation).

  • performing quick code review for sanity to whittle out any blindly obvious.

  • converting SQL to LINQ

But if you are new to world of coding coding etc etc then you are not really learning huge amounts if just copy and pasting……

There again, it does walk through the code it writes an explaination of what it’s written, which is a useful learning tool, if the person ever bothers to read it.

1 Like