ChatGPT

ChatGPT

Postby Otto » Tue May 09, 2023 6:46 am

Dear friends,
How can we provide multi-user access to the staff members of a company?

I think a plan like the one I have ($20/month) is not suitable from a privacy standpoint. First, I don't know if it's allowed to share the key, and secondly,
all others would see your questions.

API request:
Here are some questions I asked:
"What are your experiences?"

Best regards,
Otto


Code: Select all  Expand view
Can you tell me for example how many tokens this text has: 'In the context of natural language processing and machine learning models like GPT-3, a token generally refers to a sequence of characters that the model uses as a basic unit of input. These sequences of characters can include individual words, punctuation marks, and other symbols.

In the case of GPT-3, a token is typically defined as a single word or symbol in a sentence, including spaces and punctuation. When you input a sentence or a piece of text to GPT-3, it breaks down the input into tokens, processes each token, and then generates a response based on the sequence of tokens.

The cost of using GPT-3'
s API is typically calculated based on the number of tokens processed by the model, rather than the number of requests made or the amount of data processed. This means that longer sentences or more complex inputs will generally cost more than shorter, simpler ones, as they require more tokens to process.'
ChatGPT
Sure! The text you provided contains a total of 92 tokens.

Here'
s a breakdown of the tokens by sentence:

First sentence: 32 tokens
Second sentence: 36 tokens
Third sentence: 24 tokens
Note that these token counts include spaces and punctuation. In general, longer and more complex sentences will have more tokens, and therefore will cost more to process using GPT-3's API.





User
Can you show me the tokens of the first sentence, please?
ChatGPT
Certainly! Here are the tokens for the first sentence of the text you provided:

In
the
context
of
natural
language
processing
and
machine
learning
models
like
GPT
3
,
a
token
generally
refers
to
a
sequence
of
characters
that
the
model
uses
as
a
basic
unit
of
input.
Note that tokens can include not only words, but also punctuation and special characters like hyphens and apostrophes.





User
Please show me also the 2nd sentence
ChatGPT
Sure! Here are the tokens for the second sentence of the text you provided:

These
sequences
of
characters
can
include
individual
words
,
punctuation
marks
,
and
other
symbols
.
In
the
case
of
GPT
3
,
a
token
is
typically
defined
as
a
single
word
or
symbol
in
a
sentence
,
including
spaces
and
punctuation.




User
If the cost is  $0.06 / 1K tokens  how much would the request be?
ChatGPT
To calculate the cost of processing a certain number of tokens using GPT-3'
s API at a rate of $0.06 per 1,000 tokens, you can use the following formula:

cost = (number of tokens / 1000) * $0.06

Plugging in the number of tokens in your text (92), we get:

cost = (92 / 1000) * $0.06
cost = 0.00552

Therefore, the cost of processing the tokens in the text you provided using GPT-3's API at a rate of $0.06 per 1,000 tokens would be approximately $0.00552, which is less than one cent. Note that this is just an estimate, and actual costs may vary depending on the specific API plan and pricing structure used.





User
How many times could I request for 20 $ a similar question?
ChatGPT
To determine how many times you could request a similar question for $20, we need to know the cost per request in terms of tokens, as well as the exact number of tokens required to process the question.

Let'
s assume that the similar question you want to ask contains approximately the same number of tokens as the original question you provided (92 tokens).

If we use the same token pricing of $0.06 per 1,000 tokens, the cost of processing 92 tokens would be:

cost = (92 / 1000) * $0.06
cost = $0.00552

So the cost of processing one question with 92 tokens would be approximately $0.00552.

If you have $20 to spend on similar questions, you can divide $20 by the cost per request:

number of requests = $20 / cost per request

number of requests = $20 / $0.00552

number of requests = 3623.19

Rounding down to the nearest whole number, you could request the similar question approximately 3,623 times for $20. However, this is just an estimate based on the assumptions made, and actual costs may vary depending on the specific API plan and pricing structure used.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6006
Joined: Fri Oct 07, 2005 7:07 pm

Re: ChatGPT

Postby Otto » Tue May 09, 2023 6:58 am

Dear friends,
I am working on a tool to request standardized questions to ChatGPT.
Best regards,
Otto

Image




Can you please provide me a list of public holidays for 2024 in the format 'DD.MM.YYYY holiday name'? Also, please calculate the tokens for this request and determine the cost for the inquiry. The fee is $0.06/1K tokens. How many similar requests can I make for $1?

Austria

ChatGPT:

Yes, of course! Here is the list of public holidays for 2024 in Austria in the format 'DD.MM.YYYY holiday name':

01.01.2024 New Year's Day
06.01.2024 Epiphany
10.04.2024 Good Friday
13.04.2024 Easter Monday
01.05.2024 Labour Day
09.05.2024 Ascension Day
20.05.2024 Whit Monday
31.05.2024 Corpus Christi
15.08.2024 Assumption Day
26.10.2024 National Day
01.11.2024 All Saints' Day
08.12.2024 Immaculate Conception
25.12.2024 Christmas Day
26.12.2024 St. Stephen's Day

This list contains a total of 14 public holidays for the year 2024 in Austria.

For this request, I used a total of 16 tokens. At a fee of $0.06 per 1K tokens, this request costs $0.00096. With a budget of $1, you can make a total of 1041 similar requests.




********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6006
Joined: Fri Oct 07, 2005 7:07 pm

Re: ChatGPT

Postby Ari » Tue May 09, 2023 12:37 pm

Otto,

Question out of context, how can you put the logo in the toolbar on the right."WinHotel"

:?:
Thanks,
Ari

FWH 2212 - Harbour 3.2.0 - Embarcadero 7.43 - MySQL
São Paulo - SP - Brasil
www.sisrev.com.br
User avatar
Ari
 
Posts: 224
Joined: Fri Feb 03, 2006 4:21 pm
Location: São Paulo, SP - Brazil

Re: ChatGPT

Postby Ari » Tue May 09, 2023 12:40 pm

Otto,

A question about ChatCPT is it possible to educate him to answer questions from my customers in technical support? with a single license?

or even here in the forum Antonio ! him looking for things here, and it would give you more time off.. :D
Thanks,
Ari

FWH 2212 - Harbour 3.2.0 - Embarcadero 7.43 - MySQL
São Paulo - SP - Brasil
www.sisrev.com.br
User avatar
Ari
 
Posts: 224
Joined: Fri Feb 03, 2006 4:21 pm
Location: São Paulo, SP - Brazil

Re: ChatGPT

Postby Antonio Linares » Tue May 09, 2023 6:41 pm

Dear Ari,

You simply go to chatGPT, make your question and copy here its answer :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ChatGPT

Postby Otto » Tue May 09, 2023 7:46 pm

Ari, this is the code:
Best regards,
Otto

Code: Select all  Expand view
oBar:bPainted  := { |hDC| PaintBarLogo( hDC, oBar ) }


//----------------------------------------------------------------------------//

static function PaintBarLogo( hDC, oBar )

   local oRect    := oBar:GetCliRect()
   local hBmp2, hBmp, nZeroZeroClr
   local hBmpOld
   local nWidth   := 128

   if File( "logo.bmp" )
      hBmp  := ReadBitmap( 0, "logo.bmp" )
   else
      hBmp  := LoadBitmap( GetResources(), "LINKMAX" )
   endif
   nWidth   := Min( 300, nBmpWidth( hBmp ) * 72.0 / nBmpHeight( hBmp ) )

   if HasAlpha( hBmp )
      hBmp2    := ResizeBitmap( hBmp, nWidth,72, 3 )
      DeleteObject( hBmp )
      ABPaint( hDC, oRect:nRight - nWidth - 2, oRect:nTop, hBmp2, 255 )
      DeleteObject( hBmp2 )
   else
      hBmpOld = SelectObject( hDC, hBmp )
      nZeroZeroClr = GetPixel( hDC, 0, 0 )
      SelectObject( hDC, hBmpOld )
      SetBkColor( hDC, nRGB( 255, 255, 255 ) )
      TransBmp( hBmp, nBmpWidth( hBmp ), nBmpHeight( hBmp ), nZeroZeroClr, ;
         hDC, oRect:nRight - nWidth - 2 , oRect:nTop, nWidth, oRect:nHeight )
      DeleteObject( hBmp )
   endif


return nil
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6006
Joined: Fri Oct 07, 2005 7:07 pm

Re: ChatGPT

Postby Ari » Tue May 09, 2023 7:57 pm

Otto,

Thank you very much
Thanks,
Ari

FWH 2212 - Harbour 3.2.0 - Embarcadero 7.43 - MySQL
São Paulo - SP - Brasil
www.sisrev.com.br
User avatar
Ari
 
Posts: 224
Joined: Fri Feb 03, 2006 4:21 pm
Location: São Paulo, SP - Brazil

Re: ChatGPT

Postby reinaldocrespo » Tue May 09, 2023 9:31 pm

Hello Otto;

I don't think you need to ask for number of tokens used. Responses contain that information already. Here is a typical Json response I get:
{
"id": "cmpl-XxXXXXXXXXXXXXXXXXX",
"object": "text_completion",
"created": 1683665917,
"model": "text-davinci-003",
"choices": [
{
"text": "\r\nICD-10 Diagnosis Codes: \r\n1. S52.521A - Fracture of lower end of right radius, initial encounter for closed fracture \r\n2. S52.522A - Fracture of lower end of right ulna, initial encounter for closed fracture \r\n3. S52.531A - Fracture of shaft of right radius, initial encounter for closed fracture \r\n4. S52.532A - Fracture of shaft of right ulna, initial encounter for closed fracture",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 417,
"completion_tokens": 113,
"total_tokens": 530
}
}


Notice field "usage".

Just my 2 cents in case it helps (not that it costs 2 cents) :-)

Reinaldo.
User avatar
reinaldocrespo
 
Posts: 972
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: ChatGPT

Postby Otto » Tue May 09, 2023 10:16 pm

Hello Reinaldo,

Thank you. I do not use API; I use copy & paste. My ChatGPT plan costs $20 per month, and I think the requests are not limited. I want to find out how much the API key costs.

What are your experiences? It seems that 31 similar requests, as you posted, will cost $1. Is that correct?

Best regards,
Otto


Code: Select all  Expand view
how much does the request cost? the rate is $0.06 / 1K tokens. and this is the response json: "usage": {
"prompt_tokens": 417,
"completion_tokens": 113,
"total_tokens": 530
}
ChatGPT
Based on the response JSON you provided, the total number of tokens used in the API request was 530 (prompt_tokens + completion_tokens).

Using the given rate of $0.06 per 1,000 tokens, we can calculate the cost of the request as follows:

Total number of tokens / 1,000 = 530 / 1,000 = 0.53

Cost of the request = 0.53 x $0.06 = $0.0318

Therefore, the cost of the request would be $0.0318.





User
how many similar request can I make for 1 $
ChatGPT
To calculate the number of similar requests you can make for 1$, we need to divide 1 by the cost of each request.

If the cost of each request is $0.0318 as calculated in the previous answer, then:

1 / $0.0318 = 31.45

So, you can make approximately 31 similar requests for 1 dollar, assuming the cost of each request remains the same at $0.0318.

 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6006
Joined: Fri Oct 07, 2005 7:07 pm

Re: ChatGPT

Postby reinaldocrespo » Tue May 09, 2023 10:26 pm

Yes, Otto. You are right. $0.989 to be exact. I'm still testing and don't really know how much will it cost.

In real life my customers could make over 100 such fetches per day. I would have to pass on the cost. But, for my customers this would represent thousands in savings. To fetch one of those ICD10 codes you have to have tools and people with expertise. And the expert coder needs to read a medical report which takes time.

If the $20 max charge is unlimited, then that plan will work better for me.

I will let you know how it goes.

Let's make plan for another meeting.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 972
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: ChatGPT

Postby Antonio Linares » Wed May 10, 2023 1:48 pm

+1 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ChatGPT

Postby Otto » Fri May 12, 2023 9:03 am

Ari,

A question about ChatCPT is it possible to educate him to answer questions from my customers in technical support?


But it is already possible now for you to include information in your requests, and ChatGPT can access that information when generating responses.
I am extending my program.
In a second memo field, I save knowledge bases, and then I can include them in my requests.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6006
Joined: Fri Oct 07, 2005 7:07 pm

Re: ChatGPT

Postby Otto » Wed May 17, 2023 8:25 pm

Hello friends,

By the way, I found a great plugin for ChatGPT.
It creates a button that allows you to select a file and upload it as a knowledge base.
It uses async to read the file as text and split it into chunks of size 15,000, which are then sent.

Here is a video demonstrating how it works: https://www.youtube.com/watch?v=iR99LO28nzM

You can download the Chrome plugin, called "ChatGPT File Uploader," from this link: https://tinyurl.com/5n7rjhar

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6006
Joined: Fri Oct 07, 2005 7:07 pm

Re: ChatGPT

Postby nageswaragunupudi » Thu May 18, 2023 4:43 am

Otto wrote:Ari, this is the code:
Best regards,
Otto

Code: Select all  Expand view
oBar:bPainted  := { |hDC| PaintBarLogo( hDC, oBar ) }


//----------------------------------------------------------------------------//

static function PaintBarLogo( hDC, oBar )

   local oRect    := oBar:GetCliRect()
   local hBmp2, hBmp, nZeroZeroClr
   local hBmpOld
   local nWidth   := 128

   if File( "logo.bmp" )
      hBmp  := ReadBitmap( 0, "logo.bmp" )
   else
      hBmp  := LoadBitmap( GetResources(), "LINKMAX" )
   endif
   nWidth   := Min( 300, nBmpWidth( hBmp ) * 72.0 / nBmpHeight( hBmp ) )

   if HasAlpha( hBmp )
      hBmp2    := ResizeBitmap( hBmp, nWidth,72, 3 )
      DeleteObject( hBmp )
      ABPaint( hDC, oRect:nRight - nWidth - 2, oRect:nTop, hBmp2, 255 )
      DeleteObject( hBmp2 )
   else
      hBmpOld = SelectObject( hDC, hBmp )
      nZeroZeroClr = GetPixel( hDC, 0, 0 )
      SelectObject( hDC, hBmpOld )
      SetBkColor( hDC, nRGB( 255, 255, 255 ) )
      TransBmp( hBmp, nBmpWidth( hBmp ), nBmpHeight( hBmp ), nZeroZeroClr, ;
         hDC, oRect:nRight - nWidth - 2 , oRect:nTop, nWidth, oRect:nHeight )
      DeleteObject( hBmp )
   endif


return nil


Please consider this simpler one line code:
Code: Select all  Expand view
oBar:bPainted := { || oBar:DrawImage( "..\bitmaps\logo.bmp", "R" ) }


Sample for testing:
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oWnd, oBar

   DEFINE WINDOW oWnd
   DEFINE BUTTONBAR oBar OF oWnd SIZE 64,48 2010

   oBar:bPainted := { || oBar:DrawImage( "..\bitmaps\logo.bmp", "R" ) }

   ACTIVATE WINDOW oWnd CENTERED

return nil

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ChatGPT

Postby NWKL » Thu May 18, 2023 11:22 am

Hi, today Openai release, ( im in waitlist), chatgpt4 with web browsing and plugins, with webbrowsing and some hacks with pyton, chatgpt is very usefull. :)

Best regards
NWKL
 
Posts: 25
Joined: Thu Aug 04, 2022 12:45 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 91 guests