Comments (1)
π€
Hello @thatmarcboi! I'm Dosu, a friendly bot designed to assist you with your queries, bugs, and more while we wait for a human maintainer to join us. I'm here to help make your experience with our repository as smooth as possible. Looking forward to assisting you!
Based on the information I found, the current version of the gpt4-pdf-chatbot-langchain codebase does not support text streaming functionality similar to chat.openai.com. The code handles HTTP POST requests and responds with a single response for each request. It does not maintain a persistent connection for streaming responses. You can refer to the relevant code in the pages/api/chat.ts file.
However, there is a similar solved issue in the repository, Unable to stream response, where the user was directed to a fork of the project by groovybits, which still has the streaming functionality. You might find this fork useful.
Additionally, the gpt4-pdf-chatbot-langchain project includes a library that can be used to implement text streaming functionality. The library is "@microsoft/fetch-event-source". This library is a polyfill for the EventSource API (also known as Server-Sent Events), which can be used to stream text data from a server to a client. You can refer to the package.json file for more details.
Here is a basic example of how you might use it:
import { FetchEventSource } from '@microsoft/fetch-event-source';
const eventSource = new FetchEventSource('https://example.com/stream');
eventSource.onmessage = (event) => {
console.log(event.data);
};
eventSource.onerror = (error) => {
console.error('An error occurred:', error);
};
In this example, 'https://example.com/stream' would be the URL of your server-side endpoint that sends the text stream. The onmessage
event handler is called whenever a new piece of data is received from the stream, and the onerror
event handler is called if an error occurs.
I hope this information is helpful. If you have any other questions or need further clarification, feel free to ask.
Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a π if this is helpful and π if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from gpt4-pdf-chatbot-langchain.
Related Issues (20)
- HTML HOT 4
- Error while ingesting documents -- Cannot find package '@pinecone-database/pinecone' HOT 3
- Does the new GPTs release from openAI remove the need for this kind of work? HOT 3
- Is there a javascript version of this repo? HOT 3
- how do i ssl? HOT 3
- Conversion of code into Python HOT 2
- PineconeError: Error, message length too large: found 5453452 bytes, the limit is: 4194304 bytes HOT 6
- source output HOT 1
- How to include more than 4 results from Pinecone? HOT 3
- How to change the BaseUrl if I use a proxy HOT 1
- Can ChatGPT 3.5 be supportedοΌ HOT 6
- Does this project accepts image read from PDF? HOT 5
- Enhancement - ability to use a graph database such as neo4j instead of vector database HOT 1
- enhancement - integrate with llamaindex HOT 3
- Explain data ingestion code. HOT 4
- s HOT 1
- "TypeError: Cannot read properties of undefined (reading 'text')" HOT 1
- error TypeError: ids is not iterable HOT 1
- Add support for Pinecone Serverless HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpt4-pdf-chatbot-langchain.