-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor to use localized state management for conversation ID #124
base: main
Are you sure you want to change the base?
Refactor to use localized state management for conversation ID #124
Conversation
hey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can You please remove the extra spaces and unwanted changes?
Rest looks Good to me.
new Pieces.ConversationsApi() | ||
.conversationsCreateSpecificConversationRaw({ | ||
transferables: true, | ||
seededConversation, | ||
}) | ||
.then((_c) => { | ||
console.log("Conversation created! : Here is the response:"); | ||
console.log(_c); | ||
|
||
// check and ensure the response back is clean. | ||
if (_c.raw.ok == true && _c.raw.status == 200) { | ||
console.log("CLEAN RESPONSE BACK."); | ||
_c.value().then((_conversation) => { | ||
console.log("Returning new conversation values."); | ||
// console.log('ID | ' + _conversation.id); | ||
// console.log('NAME | ' + _conversation.name); | ||
// console.log('CREATED | ' + _conversation.created.readable); | ||
// console.log('ID: ' + _conversation.); | ||
|
||
// Set the conversation variable here for the local file: | ||
setConversationID(_conversation.id); | ||
}); | ||
} | ||
}); | ||
} catch (error) { | ||
console.error('An error occurred while creating a conversation:', error); | ||
console.error("An error occurred while creating a conversation:", error); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same Here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All done sir
Hey Please review the changes I made based on your request a few hours ago. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good to me!
Description
This PR fixes the usage of a global variable
GlobalConversationID
inCopilot.tsx
. The global variable has been refactored to use localized state management with React'suseState
hook.issue #115
Changes include:
createNewConversation
function to accept a state setter for conversation ID.CopilotChat
component to manage the conversation ID using theuseState
hook.