#I want to let ChatGPT read the book and ask ChatGPT questions about the book

6 messages · Page 1 of 1 (latest)

gaunt hatch
#

I am trying to get ChatGPT to read longer sentences.

I tried to cut the long sentences into small pieces, throw them to the API in a row and try to keep the session coming back from the API.
But the session was not returned.
$cookies = curl_getinfo($ch, CURLINFO_COOKIELIST); //PHP Code
If the above code would have returned, I would have been happy.

How can I get ChatGPT to read my long text?
https://api.openai.com/v1/files
Can I upload a text file to the above endpoint and have ChatGPT read it?

Thanks for reading.

main temple
#

https://api.openai.com/v1/files Is used just for fine-tuning. What exactly do you mean by session? The model has no memory so all requests from it are disconnected and have no knowledge of each other. It's up to you to handle stringing the chat history together

gaunt hatch
# main temple <https://api.openai.com/v1/files> Is used just for fine-tuning. What exactly do ...

Thanks for the reply.

At first I thought about sending long texts with the API messages.
But the response from the API is

type:invalid_request_error
message:This model's maximum context length is 4097 tokens. However, your messages resulted in 7186 tokens. Please reduce the length of the messages.

Please reduce the length of the messages.

Next, I tried the above and thought, "If the API and the session are maintained, can't the information be stored in the session?" I thought, "If the API and the session are maintained, then we can store the information in the session.
(call the API >>> get the session ID >>>> pass that session ID on the next API call and maybe the API will read the previous information)
I tried calling the API in PHP to pick up the session ID, but nothing was returned.

How can I send a text as long as 50000 tokens or so?
Please tell me how to do this as I don't know how to do it.

main temple
gaunt hatch
# main temple One way to go about this is to break the text down into chunks and summarize the...

Details will be missing, but is that something that can't be helped with the current API?

https://twitter.com/localghost/status/1628138139620618240?t=WB60Wa281DERpHg3AIcD-A
I wanted to do the same thing as in this video, but maybe I'm going with a summary.

  1. Embed a book into GPT-3 / ChatGPT.
  2. Talk directly to the book to learn.

Learn from a book through conversation, questions, and in the order you want.

Likes

4976

Retweets

743

▶ Play video
main temple
# gaunt hatch Details will be missing, but is that something that can't be helped with the cur...

General summaries are hard but asking questions about the content is far easier.
You'd also want to make use of text embeddings.
You would generate embeddings from your chunks and store those with the text they map back to (either json or a dedicated vector database).
Then when you have a prompt generate a text embedding from it and find the most relevant N(up to you) embeddings and pass their text into the prompt as context.
You can find a basic example of that here: https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb