Comments (26)
Please provide an MRE
from bard-ai.
I get an error while trying to build my project. This error doesn't show up in v.1.5.4.
Module not found: Error: Can't resolve 'fs' in '/Users/sujit/Documents/My Projects/chrome-ext-litcode-solver/node_modules/bard-ai'
Please create a new issue. also, this is probably because this project is currently uses the nodejs fs module
from bard-ai.
Closing otherwise. We respond to issues regarding bard-ai
, we are not necessarily responsible for how you use it specifically unless it's a clear issue on our part.
from bard-ai.
It's related to bard-ai when i export chat and then import it it to get responses from bard-ai I get is, means I can't use the ID's of the chat to continue an old chat "Google Bard encountered an error )]}'
39
[["wrb.fr",null,null,null,null,[13]]]
58
[["di",8769],["af.httprm",8768,"6620395296999733811",0]]
25
[["e",4,null,null,134]]
.
at queryBard (file:///home/runner/XaviaBot/node_modules/bard-ai/index.js:88:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)"
from bard-ai.
It works for me?
Ensure you are giving Chat a JSON (not stringified) when importing. It will not work if your input is stringified.
from bard-ai.
It worked before, but does not works after the update last update came.
from bard-ai.
Go ahead and purge cookies, then log in again to your Google account.
Get the new PSID, and it should be all fixed!
from bard-ai.
did but same error brother, can you give me an example again I tried same as shown as on the docs
from bard-ai.
It works? Are you sure you are using __Secure-PSID1?
from bard-ai.
Yes, it works when i create new chat everytime for response, but not works with the chat export and import IDs
from bard-ai.
Can you show me what you are exporting and importing? Make sure its raw JSON and not stringified or changed in any way shape or form.
from bard-ai.
here's my code:const userData = await getUserData(uid);
if (userData) {
const { conversationID, responseID, choiceID, _reqID } = userData;
const userChat = new Bard.Chat({
conversationID: conversationID,
responseID: responseID,
choiceID: choiceID,
_reqID: _reqID,
});
const response = await userChat.ask(prompt, { useJSON: true });
const images = response.images ? response.images.map((image) => image.url) : [];
const contentWithoutImages = response.content?.replace(/\!\[.*?\]\([^)]+\)\n*/g, "") || response.content;
const modifiedResponse = {
content: contentWithoutImages,
...(images.length > 0 && { images }),
};
await updateUserData(uid, {
conversationID: response.ids.conversationID,
responseID: response.ids.responseID,
choiceID: response.ids.choiceID,
_reqID: response.ids._reqID,
});
return modifiedResponse;
} else {
const newChat = new Bard.Chat();
const response = await newChat.ask(prompt, { useJSON: true });
const images = response.images ? response.images.map((image) => image.url) : [];
const contentWithoutImages = response.content?.replace(/\!\[.*?\]\([^)]+\)\n*/g, "") || response.content;
const newUser = {
uid: uid,
conversationID: response.ids.conversationID,
responseID: response.ids.responseID,
choiceID: response.ids.choiceID,
_reqID: response.ids._reqID,
};
await createUserData(newUser);
const modifiedResponse = {
content: contentWithoutImages,
...(images.length > 0 && { images }),
};
return modifiedResponse;
}
from bard-ai.
If you just use the most basic example, does it work?
(Please join Slack, its a lot easier to talk there π)
from bard-ai.
Any updates? Closing otherwise...
from bard-ai.
Closing for now, feel free to reopen if you deem necessary.
from bard-ai.
I'm facing the same issue, can't figure out why.
from bard-ai.
I'm facing the same issue, can't figure out why.
could you show us an MRE of your code?
@EvanZhouDev i suspect itβs an issue with cookies
from bard-ai.
@ThatXliner It seems to work fine when I write an example and run it in the terminal. I'm trying to using this package in a chrome extension which gives this error (It works the first time when result.bardConversationIds
is undefined
).
Bard.init(bardKey)
.then(() => chrome?.storage?.local?.get('bardConversationIds'))
.then((result) => new Bard.Chat(result.bardConversationIds))
.then(async (conversation) => {
const response = await conversation.ask("Hello world");
chrome?.storage?.local?.set({bardConversationIds: conversation.export()});
return response;
})
.then((response) => console.log(response));
- I logged the stored
ids
object and it seems like it's being stored and retrieved correctly.
- I hard-coded the
ids
object in the constructor but it still gave the same error..then((result) => new Bard.Chat({ conversationID: 'c_e29fe6192981cfe1', responseID: 'r_e29fe6192981c15a', choiceID: 'rc_e29fe6192981c8b7', _reqID: 100000 }))
from bard-ai.
Why console.log(response)
giving an object? IIRC it shouldβve been a string unless the json config was set
from bard-ai.
The object is logged when I do console.log(result.bardConversationIds)
. The response string gets logged properly when result.bardConversationIds
is undefined
, in this case it never gets to the response.
from bard-ai.
Could it be browser cookies from bard.google.com interfering with this? I noticed even when I don't specify a bardKey
, it still works since I'm signed in to bard in my browser.
Note: I'm using this package with a chrome extension.
from bard-ai.
the issue hasn't been fixed yet, also now i changed my cookies more than 10 times by logging the Gmail, and then logging in it says my cookie isn't valid.
from bard-ai.
the issue hasn't been fixed yet, also now i changed my cookies more than 10 times by logging the Gmail, and then logging in it says my cookie isn't valid.
On "change cookie," did you copy+paste the new cookie into your code?
from bard-ai.
Also, you need to make sure you clear your cookies, not just logging in and out of Gmail... not sure if that was implied?
from bard-ai.
Have you tried using v2
? It should be better.
Let me know if you have any updates, I will close if not...
from bard-ai.
I get an error while trying to build my project. This error doesn't show up in v.1.5.4.
Module not found: Error: Can't resolve 'fs' in '/Users/sujit/Documents/My Projects/chrome-ext-litcode-solver/node_modules/bard-ai'
from bard-ai.
Related Issues (20)
- Is it possible to use this module with CommonJS & ES5? HOT 3
- [Bug]: cors issue HOT 5
- β¨ [FEATURE]: Ask questions with image input HOT 1
- π [BUG]: Working with Windows, Crashing on Linux HOT 13
- π [BUG]: The API is identified as a robot after some requests HOT 4
- π [BUG]: Error: Could not use your Cookie. Make sure that you copied correctly the Cookie with name __Secure-1PSID exactly. If you are sure your cookie is correct, you may also have reached your rate limit. HOT 18
- π [BUG]: Module not found: Error: Can't resolve 'fs' HOT 11
- Error: TypeError: Cannot read properties of nul l (reading '4') HOT 3
- β¨ [FEATURE]: Proxy and Reverse Proxy HOT 3
- fix-esm issue to use bard-ai. HOT 2
- π [BUG]: TypeError: Cannot read properties of null (reading '4') HOT 4
- π [BUG]: Upon using Bard-ai for a few minutes or so, it will invalidate the cookie or return NULL HOT 7
- ISSUE FROM NODE.JS HOT 3
- π [BUG]: TypeError: Cannot read properties of undefined (reading 'createChat') - [v2.0.3] HOT 8
- π [BUG]: Cannot read properties of null (reading '4') HOT 10
- π [BUG]: context is sometimes reset even the conversation id is the same
- β¨ [FEATURE]: get tts in the result
- β¨ [FEATURE]: Would be cool to have this extension with this model "CodeLlama-34b-Instruct-hf" HOT 1
- β¨ [FEATURE]: Integration With Gemini HOT 4
- π [BUG]: Could not fetch Google Bard. You may be disconnected from internet: TypeError: fetch failed
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 bard-ai.