Openai API (aka ChatGPT)

Hi,

This is my first post here.

Is there any openai library, package, code examples to use openai API with xojo ? Especially tne text applications, Text Generation and Question Answering ?

Thank you

The OpenAi docs give CURL examples which can be followed using regular REST API calls using URLConnection.

The docs for URLConnection is located here: URLConnection — Xojo documentation

Some more information on using URLConnection for REST API calls:
https://documentation.xojo.com/topics/communication/internet/accessing_web_services.html

This is a pretty good video on YouTube by @Paul_Lefebvre

Thank you. This is the solution I chose. I was hoping for something less basic, but it turned out to be just fine.

Cheers

So basically your job is to create 13 in a dozen apps? Now that’s #$@&. I agree.

Anyhow, my question was well-meant. Not meant badly! Long toes don’t help then, of course

1 Like

I find it interesting how many people believe the only way to do well with software is to have something unique and/or be first to market when the reality is that if you have something unique, it won’t be unique for long and if you’re first, you’ll soon be joined by many others.

That being the case, the only logical conclusion is that neither of those are the main driver of success over the medium to long term - it needs to be something(s) else.

3 Likes

You certainly have a point there!
But the fact is that a lot of people are quick to jump on the bandwagon of something that is “hot” at the time. ChatGPT is really a very good example. In less than 1 month more than 100 iOS and Android apps have appeared on the market (and almost none of them free) to get a piece of the pie.

That was my original question too, if Damien is also such a person or someone who wants to use ChatGPT in another playful way. Unfortunately, he had long toes and preferred to insult rather than provide an answer. Actually, that says it all, and we now know the answer. :smile:

@SteveP Yes, I totally agree. On the other hand, if we want to be successful, we have to create added value, and in the case of GPT chat there are indeed immense possibilities to create something new.

As far as I am involved, I am working on something that has very little in common with chat-GPT. I am modestly trying to use the available language models of openai to enrich a knowledge base in the field of human resources.

However, the more I work on the subject, the more I think that we could indeed create a chat-GPT type conversational robot. This would consist in enriching the conversational model with all the knowledge we already have in the knowledge base. It would be a kind of chat-GPT specialized in human resources, specifically in skills profiling. But for the moment I am not there yet! There is some work to do first :slight_smile:

@Damien_Raczy yep well in that case you’d want to look at paying to train the models for this purpose with what you have.

Good concept of course - once the entire generalists are out of the way, specialist trained use cases will be next - such as what you describe.

Steve

@SteveP yes, this can be very costly, especially when repeated testing is done with large volumes of data with high performance models. On the other hand, we can do your trial and error with cheaper models, even if we end up using davinci to generate high quality documents. Especially tuning with Ada and Babage which are 10 or even 40 times cheaper than davinci, validate the hypothesis, and then finalize with davinci.

I have just completed a DLL plugin for windows that gives you two way conversations and temporal coherence with ChatGPT. PM me if you still need it.

@Nicholas_Pearce-Boby , is there a chance that you could share your windows dll with this community ?

Not only that, in Opera, but also buttons to access directly to ChatLGBT…

Do you have a GPT API Key?

Yes I have one.

I just need to make a couple of changes as I fixed my API code when testing.

Ok. Please when you finish testing let me know. Thanks !!!

imb building it into a plugin pack, ive started another thread to see what anyone else would want in it.

ChatGPT, based on OpenAI’s GPT-3.5 language model, offers several advantages:
Source -

  1. Natural language understanding: ChatGPT has been trained on a vast amount of text data, which enables it to understand and generate human-like responses in natural language. It can comprehend and generate text in a conversational manner, making it suitable for chat-based applications.
  2. Versatility: ChatGPT is a flexible language model that can be applied to a wide range of conversational tasks. It can assist with answering questions, providing explanations, offering suggestions, engaging in small talk, and more. Its versatility makes it useful in various chatbot and virtual assistant scenarios.
  3. Contextual understanding: ChatGPT excels at capturing contextual information. It can maintain coherence and understand the context of the conversation, including references to previous messages or information shared earlier. This ability allows for more meaningful and coherent interactions.
  4. Language generation quality: OpenAI’s GPT-3.5 model has demonstrated impressive language generation capabilities. It can produce responses that are coherent, grammatically correct, and often contextually relevant. The model’s ability to generate text that is close to human-like quality contributes to a more engaging and natural conversation.
  5. Integration potential: ChatGPT can be integrated into various applications, platforms, or systems using OpenAI’s API. This allows developers to incorporate the power of ChatGPT into their own products and services, enhancing user experiences and enabling conversational interactions.
  6. Continual improvement: OpenAI regularly updates and refines their models based on ongoing research and user feedback. This iterative process leads to model enhancements and improvements over time, ensuring that ChatGPT continues to evolve and deliver better performance.

It’s important to note that these advantages are based on the capabilities and characteristics of ChatGPT as of my knowledge cutoff in September 2021. OpenAI may have introduced newer versions or models with additional features and advancements since then.

I have a ChatGPT plugin now in my plugin pack for Xojo, with support for temporal coherence (this is the part that keeps the context of the conversation you are having, not just a call to the ChatGPT api) . PM me if you are looking for one.

2 Likes

Awesome!
I made something similar.
But I included the Whisper model as well. So, it can transcribe audio in multiple languages.

It can use the ChatGPT models to find sentences that don’t make sense. It often happens that a transcription generates errors. A language model can easily detect them.

My plugin is not finished yet. But, it kind of works for me now.

2 Likes