aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

Amazon Lex 2 #7662

Closed wcomicho closed 2 years ago

wcomicho commented 3 years ago

Does Amplify support Amazon Lex version 2?

Was able to use version 1 of Amazon Lex using AWS Amplify React using Interactions library but not able to do so with the same setup for Amazon Lex version 2.

Sharing some code below that is working on version 1 but not in version 2:

Amplify.configure({ Auth: { identityPoolId: 'us-east-1:mypoolidhere', region: 'us-east-1' }, Interactions: { bots: { "Test": { "name": "Test", "alias": "Test", "region": "us-east-1", }, } } });

<AmplifyChatbot

botName="Test"
botTitle="Test"
welcomeMessage="Hello, how can I help you?"

/>

Appreciate your help on this.

Thanks

wcomicho commented 3 years ago

Hi,

Usually, how fast to these feature requests get implemented? Do you accept volunteers as testers?

Thanks Wil

gino8080 commented 3 years ago

please we need LEX2 compability

howdyhyber commented 3 years ago

Hello, is this already available?

thefat32 commented 3 years ago

Deleted - Amplify added official support for Lex2

thefat32 commented 3 years ago

Deleted - Amplify added official support for Lex2

jeroenmeulendijks commented 3 years ago

Although its nice that a third-party has invested his/her time in supporting V2. It would be better if this is supported by default from AWS. What will be the timeline on supporting Lex V2 ??

thefat32 commented 3 years ago

I totally agree with @jeroenmeulendijks

sammartinez commented 3 years ago

Hey folks, I wanted to provide an update here. We are looking to add this support of Lex 2. However, at this time, it's looking to be early next year, 2022, that this will be worked on. We will provide more details in the coming weeks around this. Thanks for using Amplify !!

ramit21 commented 2 years ago

Any update on this please?

MattJColes commented 2 years ago

Would be keen for official LEX v2 support also

wcheek commented 2 years ago

Still not implemented? Seems a long time coming..

abdallahshaban557 commented 2 years ago

@MattJColes and @wcheek - would love to understand a bit more what your use cases are, and why you would need support for Amazon Lex v2.

wcheek commented 2 years ago

@abdallahshaban557 Lex v2 is promoted as the newest version of the Lex service - why would I use v1 instead? V2 has been available for over a year. I spent a lot of time developing a chatbot using the v2 framework. It's unreasonable to ask me now to 'downgrade' just because Amplify doesn't support the newest version of an AWS service.

abdallahshaban557 commented 2 years ago

@wcheek - totally get that. We wanted to see if there are pieces of functionality that you are looking for that we do not have APIs exposed for other than upgrading to Lex V2.

larsrnielsenus commented 2 years ago

@abdallahshaban557 - this will probably come off in a wrong way but wasn't meant to: should there be an API functionality needed before you support the next version of already supported AWS services? More than a year of lead time seems slow.

shridhar-tl commented 2 years ago

Any updates on this? I have already built a bot using Lex v2. But now not able to find any option to integrate it with application. I was looking for some similar component to integrate rather than deploying a cloudformation template and spinup loads of resources like S3 bucket, Lambda, Cloud Front, Code build, etc, etc.

I am referring to the outcome of running cloudformation template from following article: https://aws.amazon.com/blogs/machine-learning/deploy-a-web-ui-for-your-chatbot/. This appears to be too much for what is expected.

ashwinkumar6 commented 2 years ago

Hey folks, We're working on adding API support for Lex V2.

The usage will be as follows

import { Amplify, Interactions } from 'aws-amplify';
import { AWSLexV2Provider } from '@aws-amplify/interactions';

Interactions.addPluggable(new AWSLexV2Provider());

const interactionsConfig = {
    Auth: {
        identityPoolId: "<identityPoolId>",
        region: "<region>"
    },
    Interactions: {
        bots: {
            my_v1_bot: { // default provider "AWSLexProvider"
                name: "my_v1_bot",
                alias: "$LATEST",
                region: "<region>",
            },
            my_v2_bot: {
                name: "my_v2_bot",
                aliasId: "<aliasId>",
                botId: "<botId>",
                localeId: "<localeId>",
                region: "<region>",
                providerName: "AWSLexV2Provider",
            },
        }
    }
}

Amplify.configure(interactionsConfig);
elorzafe commented 2 years ago

@wcomicho @gino8080 @howdyhyber @thefat32 @MattJColes @jeroenmeulendijks @shridhar-tl @larsrnielsenus @ramit21 Amplify JS now supports Lex V2 (aws-amplify@4.3.34), as @ashwinkumar6 mentioned you can use Lex V2 on JS library like this.

import { Amplify, Interactions } from ‘aws-amplify’;
import { AWSLexV2Provider } from ‘@aws-amplify/interactions’;
Interactions.addPluggable(new AWSLexV2Provider());
const interactionsConfig = {
    Auth: {
        identityPoolId: “<identityPoolId>“,
        region: “<region>”
    },
    Interactions: {
        bots: {
            my_v1_bot: { // default provider “AWSLexProvider”
                name: “my_v1_bot”,
                alias: “$LATEST”,
                region: “<region>“,
            },
            my_v2_bot: {
                name: “my_v2_bot”,
                aliasId: “<aliasId>“,
                botId: “<botId>“,
                localeId: “<localeId>“,
                region: “<region>“,
                providerName: “AWSLexV2Provider”,
            },
        }
    }
}
Amplify.configure(interactionsConfig);

Big Kudos to @thefat32 and @ashwinkumar6 for their contribution! 🎉 🎖️

xvimnt commented 2 years ago

@wcomicho @gino8080 @howdyhyber @thefat32 @MattJColes @jeroenmeulendijks @shridhar-tl @larsrnielsenus @ramit21 Amplify JS now supports Lex V2 (aws-amplify@4.3.34), as @ashwinkumar6 mentioned you can use Lex V2 on JS library like this.

import { Amplify, Interactions } from ‘aws-amplify’;
import { AWSLexV2Provider } from ‘@aws-amplify/interactions’;
Interactions.addPluggable(new AWSLexV2Provider());
const interactionsConfig = {
    Auth: {
        identityPoolId: “<identityPoolId>“,
        region: “<region>”
    },
    Interactions: {
        bots: {
            my_v1_bot: { // default provider “AWSLexProvider”
                name: “my_v1_bot”,
                alias: “$LATEST”,
                region: “<region>“,
            },
            my_v2_bot: {
                name: “my_v2_bot”,
                aliasId: “<aliasId>“,
                botId: “<botId>“,
                localeId: “<localeId>“,
                region: “<region>“,
                providerName: “AWSLexV2Provider”,
            },
        }
    }
}
Amplify.configure(interactionsConfig);

Big Kudos to @thefat32 and @ashwinkumar6 for their contribution! 🎉 🎖️

Somebody knows how can I use this inside a react component?

tannerabread commented 2 years ago

@xvimnt What is the reason for trying to configure Amplify inside of a react component? It is recommended you add the Amplify configuration step to your app's root entry point (App.js)