Dust Community Icon

Seeking Resources for JS Client and SDK Documentation for Dust Assistant

·
·

👋 Hello, I'm trying to build a simple JS client to interact with an existing Dust assistant. I was looking at the SDK https://github.com/dust-tt/dust/tree/main/sdks/js I looked at the labs, but I haven't found any practical example here. Is there any resource available in that area ? Also, some documentation about the SDK would be amazing 😄 Thanks

  • Avatar of Remi
    Remi
    ·
    ·

    Thanks Benoit Molenda for the question ! I am curious, what are you looking into building? 👀 The documentation is coming. We decided to have an early release for the community. 🎁 I think Sébastien Flory will be able to help if you have a concrete question in mind. Otherwise, if I remember correctly, the code for the Chrome extension is public. Would a pointer help?

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    Hello Benoit Molenda ! We are definitely lacking some doc regarding the dust js client.. we will be working on it asap.

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    If you are using a workspace api key, it's relatively straightforward.

    const client = new DustAPI(
    {url: 'https://dust.tt', nodeEnv: 'production'},
    {apiKey: 'your-workspace-api-key', workspaceId: 'your-workspace-id'}, console);

  • Avatar of Benoit Molenda
    Benoit Molenda
    ·
    ·

    I try to POC a simple UI to allow clients to call assistants from within our Admin Space 😉

  • Avatar of Benoit Molenda
    Benoit Molenda
    ·
    ·

    I'll look at the Chrome extension code, thanks

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    (i notice that i need to clean up that nodeEnv to make it optional)

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    lmk if I can help you debug some code

  • Avatar of Benoit Molenda
    Benoit Molenda
    ·
    ·

    The runApp (i'm not sure if that's the function I'm supposed to run) is asking for a lot of params. I've got the workspaceId and the appId (I guess that's the AssistantID). I don't know/see what are

    • appHash

    • appSpaceId

    • config (that should be a DustAppConfigType)

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    are you sure you want to runApp ?

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    runApp is mean to run a specific Dust App. If you want to talk with one of your assistant, you want to create a conversation.

  • Avatar of Clara Claude
    Clara Claude
    ·
    ·

    hey Sébastien Flory! would you eventually have 30 minutes this morning so we can explain what we try to achieve and you can advise what would be the best option? thanks a lot for your help on this!

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    Hello, yes I can do that 🙂

  • Avatar of Clara Claude
    Clara Claude
    ·
    ·

    thanks a lot! what time do you prefer?

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    anytime works for me

  • Avatar of Benoit Molenda
    Benoit Molenda
    ·
    ·

    same

  • Avatar of Clara Claude
    Clara Claude
    ·
    ·

    ok I'll send an invite for now:) thanks a lot!

  • Avatar of Clara Claude
    Clara Claude
    ·
    ·

    we are already all in the call so feel free to join whenever you want Sébastien Flory 🙂

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    finding a room and coming

  • Avatar of Benoit Molenda
    Benoit Molenda
    ·
    ·

    Hello Sébastien Flory We have our prototype working 😄 🥳 However, I notice that I never give to the system the ID of the assistant, only the workspace ID. But If I understand well, many assistant are contained in a given workspace. I have this in my code base:

    const DUST_AGENT = { // AgentType
        sId: "dust",
        name: "Dust",
        description: "An assistant with context on your company data.",
    }

    That I don't fully understand. I'm using it this way:

            const r = await api.createConversation({
                title: null,
                visibility: "unlisted",
                message: {
                  content: question,
                  mentions: [
                    {
                        configurationId: DUST_AGENT.sId,
                    },
                  ],
                  context: CONVERSATION_CONTEXT,
                },
            })
  • Avatar of Benoit Molenda
    Benoit Molenda
    ·
    ·

    My guess is : It's or the DUST_AGEN.sID or something in the context that point at the assistant, right ?

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    The assistant is defined by the mentions array (btw you can ask the same question to many assistants at the same time).

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    The context is about metadata of your user / conversation (location, time etc..)

  • Avatar of Benoit Molenda
    Benoit Molenda
    ·
    ·

    Hello Sébastien Flory, we did our presentation today. We managed to present something working thanks to your help and the SDK 🙏

  • Avatar of Sébastien Flory
    Sébastien Flory
    ·
    ·

    You're welcome 🙂

  • Avatar of Remi
    Remi
    ·
    ·

    That's awesome ! Don't hesitate to share screenshot / clips in 🔒[private feed], I think it could really help inspire others💡and maybe help you find others working on something similar.