feat: add conversation streaming #8
Open
+467
−377
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
This pull request includes significant changes to the
dataset/indexInTypesense.ts
,src/components
, andsrc/lib/actions.ts
files to streamline the data collection, conversation handling, and form submission processes. The most important changes include the consolidation of collection creation, the introduction of streaming client handling, and updates to theForm
component.Key Changes:
Data Collection and Indexing:
conversation_store
collection within thecreateDataCollection
function, removing the redundantcreateConversationHistoryCollection
function. [1] [2]typesense
package version inpackage.json
to^2.1.0-2
.Conversation Handling:
EmptyChat
andForm
components, improving the handling of conversation streams and error management. [1] [2] [3] [4]Form Component:
onRequest
prop from theForm
component and integrated the conversation handling logic directly within the component, simplifying the form submission process.Context and State Management:
ConversationContext
fromConversationContext.tsx
to allow its use in other components, ensuring consistent state management across the application.Utility Functions:
hitsToSources
function inactions.ts
to handle optional hits and return a promise, enhancing the flexibility and reliability of source extraction.PR Checklist