inworld-ai / inworld-nodejs-sdk Goto Github PK
View Code? Open in Web Editor NEWNode.js SDK for Inworld.ai. Integrate AI characters into your Node.js environment.
License: Other
Node.js SDK for Inworld.ai. Integrate AI characters into your Node.js environment.
License: Other
Suddenly started getting this error
Error: 14 UNAVAILABLE: No connection established
at callErrorFromStatus (/home/lucky/discord/sugarbelle/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
at Object.onReceiveStatus (/home/lucky/discord/sugarbelle/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
at Object.onReceiveStatus (/home/lucky/discord/sugarbelle/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
at Object.onReceiveStatus (/home/lucky/discord/sugarbelle/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
at /home/lucky/discord/sugarbelle/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
for call at
at ServiceClientImpl.makeUnaryRequest (/home/lucky/discord/sugarbelle/node_modules/@grpc/grpc-js/build/src/client.js:160:34)
at ServiceClientImpl.generateSessionToken (/home/lucky/discord/sugarbelle/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
at node:internal/util:362:7
at new Promise (<anonymous>)
at bound (node:internal/util:348:12)
at TokenClientGrpcService.<anonymous> (/home/lucky/discord/sugarbelle/node_modules/@inworld/nodejs-sdk/build/src/services/gprc/token_client_grpc.service.js:36:93)
at Generator.next (<anonymous>)
at /home/lucky/discord/sugarbelle/node_modules/@inworld/nodejs-sdk/build/src/services/gprc/token_client_grpc.service.js:8:71
at new Promise (<anonymous>)
at __awaiter (/home/lucky/discord/sugarbelle/node_modules/@inworld/nodejs-sdk/build/src/services/gprc/token_client_grpc.service.js:4:12) {
code: 14,
details: 'No connection established',
metadata: Metadata { internalRepr: Map(0) {}, options: {} }
}```
This
Discord bot example doesnt seem to have a memory. and for some reason seems to generate a new session token with every interaction
Hi devs, I am currently working on the discord bot typescript project example from this url:
https://github.com/inworld-ai/inworld-nodejs-sdk/tree/main/examples/ts/discord_bot
I am encountering a problem that I am unable to replicate, which is that the chatbot was able to include emoji responses as part of its generated response, but am no longer doing so.
I tried adding the emotion true
flag as shown below, but I do not observe any difference in the generated output.
https://docs.inworld.ai/docs/tutorial-integrations/node/api
I will greatly appreciate any help 🙏
I’m trying to integrate Inworld AI with my chat app, It works perfectly in development environment
However, after deploying to Vercel’s Serverless function, it randomly throws an error
14 UNAVAILABLE: No connection established
It seems caused by gRPC, failed to connect or send the message to Inworld (Can’t be found on the Interactions tab)
async function onReceiveMessage(message: Message) {
const { group_id, content, user_name } = message;
const lines: string[] = [];
const connection = new InworldClient()
.setGenerateSessionToken(generateSessionToken(group_id))
.setConfiguration({
capabilities: {
audio: false,
emotions: false,
interruptions: false,
},
})
.setScene(process.env.INWORLD_SCENE!)
.setUser({ fullName: user_name })
.setOnError(handleError(message))
.setOnMessage((packet) => {
if (packet.isInteractionEnd()) {
connection.close();
return sendMessage(group_id, lines.join("\n")).catch((e) =>
sendErrorMessage(group_id, e?.toString())
);
}
if (packet.isText() && packet.text.final) {
lines.push(packet.text.text.trim());
return;
}
})
.build();
await connection.sendText(content);
}
So when is this going to be pushed to npm? I can't install the sdk from github using replit for some reason. Maybe someone knows a fix?
I cannot continue the session from where I left off. There is no problem with the first messages. After a while, when I send a message again, I get a session expired or invalid error.The error message I got is below.
Error: 9 FAILED_PRECONDITION: Session: 'default-d4dtvvgeew7x8bxfecdoqq:d74b1fa3-50cc-4f72-a00f-0a634d61460f' expired or invalid
For some reason my bot no longer has memory. What changed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.