Android Question open ai / Chat GPT

FrankDev

Active Member
Licensed User
Longtime User
hi

there is actually the possibility
to include 'Chat GPT' in your own app ?
Is there an interface via json ?

regards Frank
 

epiCode

Active Member
Licensed User
How can I implement this? Is there any implementation guide for this?
  1. ChatGPT is being made available as a research preview so we can learn about its strengths and weaknesses. It is not available in the API.
 
Upvote 0

FrankDev

Active Member
Licensed User
Longtime User
of course there is an api and all functions are also available...

only how .

there are examples for 'phyton' etc.
 
Upvote 0

imbault

Well-Known Member
Licensed User
Longtime User
This github describe the use of there http api
I guess you can mimic those calls in b4a using okhttp
if someone has time to check this and make a very small b4x project it should be great for all, it's Xmas...

Patrick
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Upvote 0

natesobol

Member
Licensed User
Maybe it's something like this, but I'm getting a 401 error. So something's not right. I'm new to using this library.

EDIT: I just found this: https://www.b4x.com/android/forum/threads/gpt-3.145654/

Chat Gpt - B4i:
    Dim j As HttpJob
    j.Initialize("",Me)
    Dim body As String = $"{\"model\":\"text-davinci-003\",\"prompt\":\"What is the capital of France?\",\"temperature\":0.0,\"max_tokens\":150}""$
    Dim url As String = "https://api.openai.com/v1/completions"
   
    j.PostString(url,body)
    j.GetRequest.SetContentType("application/json")
    j.GetRequest.SetHeader("authorization","Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
    j.GetRequest.InitializePost2(url, body.GetBytes("UTF8"))
   
    wait for (j) done (j As HttpJob)
    If j.Success Then
        Dim responseString As String = j.Response.GetString
        Log(responseString)
    End If
 
Last edited:
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
Hi @JackKirk. I have just copied your/Abdull's class - thanks for the clear and comprehensive instructions. But my first two questions got pretty disappointing results - "What is today's date?" and "How old is the king of england?". Just wondered if you were getting usable results.

EDIT : After a few more questions it seems that chatGPT-3 is good on history but pretty ignorant of current affairs.
 
Last edited:
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Hi @JackKirk. I have just copied your/Abdull's class - thanks for the clear and comprehensive instructions. But my first two questions got pretty disappointing results - "What is today's date?" and "How old is the king of england?". Just wondered if you were getting usable results.

EDIT : After a few more questions it seems that chatGPT-3 is good on history but pretty ignorant of current affairs.
Brian,

Firstly as noted in:

https://www.b4x.com/android/forum/threads/gpt-3.145654/#post-923913

Note that GPT-3 with "model": "text-davinci-003" is not exactly ChatGPT, see:

https://dev.to/ben/the-difference-between-chatgpt-and-gpt-3-19dh

Also note from:

https://beta.openai.com/docs/models/gpt-3

(referenced in my class documentation) that the text-davinci-003 model has been trained on data up to June 2021 - 18 months old - so it does not know QE2 has died.

You should also do some googling of the whole technologies limits - it can also assert most authoritatively falsehoods.

I have found true ChatGPT to be excellent for things like jazzing up a marketing blurb but would be very careful about using it for any factual stuff.

I guess you could ask it to give URLs for that sort of thing for some level of reassurance.

My hope is that I can work out how to train ChatGPT (or even text-davinci-003) on live question/answer stuff relative to my major customer facing apps and use it to assist in answering customer queries.

I'm going to wait until the ChatGPT API surfaces to see what that looks like.
 
Last edited:
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
My hope is that I can work out how to train ChatGPT (or even text-davinci-003) on live question/answer stuff relative to my major customer facing apps and use it to assist in answering customer queries.
According to:

https://beta.openai.com/docs/guides/fine-tuning

you can only fine tune the GPT-3 base models (ada, babbage, curie, or davinci) so fine tuning ChatGPT is probably a pipe dream - for now?
 
Upvote 0
Top