-
Notifications
You must be signed in to change notification settings - Fork 819
Integrates You.com chatbot in web-mode using session cookie. Supports conversation history + "create" chatMode (image generation). #834
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
base: master
Are you sure you want to change the base?
Conversation
Integrates You.com chatbot using session cookie. Supports conversation history + "create" chatMode (image generation).
Integrates You.com chatbot using session cookie. Supports conversation history + "create" chatMode (image generation).
Integrates You.com chatbot using session cookie. Supports conversation history + "create" chatMode (image generation).
…n history + "create" chatMode (image generation). Integrates You.com chatbot using session cookie. Supports conversation history + "create" chatMode (image generation).1
…n history + "create" chatMode (image generation). Integrates You.com chatbot using session cookie. Supports conversation history + "create" chatMode (image generation).
…n history + "create" chatMode (image generation). Integrates You.com chatbot using session cookie. Supports conversation history + "create" chatMode (image generation).
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.
Pull Request Overview
Integrates You.com chatbot in web mode by fetching a session cookie, streaming conversation history via SSE, and supporting “create” mode for image generation.
- Adds
getYouSessionKey
alongside existing session-cookie helpers. - Implements
generateAnswersWithYouWebApi
for streaming chat responses. - Extends config and background logic to include You.com model keys and routing.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/services/wrappers.mjs | Added getYouSessionKey to retrieve You.com session cookie. |
src/services/apis/you-web.mjs | New SSE-based API client for You.com chat and create modes. |
src/config/index.mjs | Registered You.com model keys, groups, and default modes. |
src/background/index.mjs | Routed You.com requests in the main execution flow. |
Comments suppressed due to low confidence (2)
src/services/apis/you-web.mjs:1
- New API wrapper
generateAnswersWithYouWebApi
andgenerateUUID
helper lack associated unit tests. Please add tests to cover streaming logic, error handling, and different chat modes.
// path/to/services/apis/you-web.mjs
src/config/index.mjs:418
- The
activeApiModes
array was completely replaced by You.com keys, removing all existing default modes (e.g., chatgptFree35, bingFree4). Please merge You.com entries into the existing list rather than overwriting it.
'create',
@@ -233,6 +266,33 @@ export const Models = { | |||
|
|||
gptApiInstruct: { value: 'gpt-3.5-turbo-instruct', desc: 'GPT-3.5-turbo Instruct' }, | |||
gptApiDavinci: { value: 'text-davinci-003', desc: 'GPT-3.5' }, | |||
|
|||
create: { value: 'create', desc: 'YouWeb create' }, |
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.
Duplicate create
key in the Models
object (also defined at line 251). Please remove or consolidate one of the definitions to avoid key collisions.
create: { value: 'create', desc: 'YouWeb create' }, | |
// Removed duplicate 'create' key to avoid key collisions |
Copilot uses AI. Check for mistakes.
// Handle start if needed | ||
}, | ||
onEnd() { | ||
finishMessage() |
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.
Calling finishMessage()
here will push the record and post a completed message, but the onEnd
callback also calls finishMessage()
, leading to duplicate pushes and messages. Consider invoking it in only one place.
finishMessage() | |
if (!isFinished) { | |
finishMessage() | |
isFinished = true | |
} |
Copilot uses AI. Check for mistakes.
method: 'GET', | ||
signal: controller.signal, | ||
headers: { | ||
'Content-Type': 'text/event-stream;charset=utf-8', |
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.
[nitpick] For SSE GET requests, it's more appropriate to set an Accept: 'text/event-stream'
header instead of Content-Type
to signal the expected response format.
'Content-Type': 'text/event-stream;charset=utf-8', | |
'Accept': 'text/event-stream', |
Copilot uses AI. Check for mistakes.
/review |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
/improve |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨
|
Integrates You.com chatbot using session cookie. Supports conversation history + "create" chatMode (image generation).