Code Monkey home page Code Monkey logo

inworld-nodejs-sdk's People

Contributors

dependabot[bot] avatar disfractal avatar inworld-gh-svc-account avatar tshashkova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inworld-nodejs-sdk's Issues

Error: 14 UNAVAILABLE: No connection established

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: {} }
}```

How to enable emoji responses

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 🙏

Failed to connect: 14 UNAVAILABLE: No connection established

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);
}

session expired or invalid error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.