Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix types #100

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/jovo-model-alexa/src/JovoModelAlexa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,10 @@ export class JovoModelAlexa extends JovoModel {
}
}

const alexaLanguageModelIntents = _get(model, 'alexa.interactionModel.languageModel.intents') || [];
// convert alexa specific intents
if (_get(model, 'alexa.interactionModel.languageModel.intents')) {
for (const intent of _get(model, 'alexa.interactionModel.languageModel.intents')) {
if (alexaLanguageModelIntents) {
for (const intent of alexaLanguageModelIntents) {
alexaIntents.push(intent);
}
}
Expand Down
21 changes: 14 additions & 7 deletions packages/jovo-model-dialogflow/src/JovoModelDialogflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,11 @@ export class JovoModelDialogflow extends JovoModel {
});
}
}
// tslint:disable-next-line:no-any
const dialogFlowIntents =_get(model, 'dialogflow.intents') as any;
// dialogflow intents form locale.json
if (_get(model, 'dialogflow.intents')) {
for (const modelDialogflowIntent of _get(model, 'dialogflow.intents')) {
if (dialogFlowIntents) {
for (const modelDialogflowIntent of dialogFlowIntents) {
// user says
if (modelDialogflowIntent.userSays) {
returnFiles.push({
Expand All @@ -496,9 +498,11 @@ export class JovoModelDialogflow extends JovoModel {
}
}

// tslint:disable-next-line:no-any
const dialogFlowEntities = _get(model, 'dialogflow.entities') as any;
// dialogflow entities form locale.json
if (_get(model, 'dialogflow.entities')) {
for (const modelDialogflowEntity of _get(model, 'dialogflow.entities')) {
if (dialogFlowEntities) {
for (const modelDialogflowEntity of dialogFlowEntities) {
// entries
if (modelDialogflowEntity.entries) {
returnFiles.push({
Expand Down Expand Up @@ -606,13 +610,15 @@ export class JovoModelDialogflow extends JovoModel {
);
}

// tslint:disable-next-line:no-any
const dialogFlowIntentResponseMessages = _get(dialogFlowIntent, 'responses[0].messages') as any;
if (
!_isEqual(
_get(dialogFlowIntent, 'responses[0].messages'),
dialogFlowIntentResponseMessages,
_get(DEFAULT_INTENT, 'responses[0].messages'),
)
) {
for (const message of _get(dialogFlowIntent, 'responses[0].messages')) {
for (const message of dialogFlowIntentResponseMessages) {
if (_get(message, 'lang') === locale) {
const jovoIntentDialogflowMessages = _get(
jovoIntent,
Expand All @@ -621,7 +627,8 @@ export class JovoModelDialogflow extends JovoModel {
);

if (_get(message, 'speech', '').length > 0) {
jovoIntentDialogflowMessages.push(message);
// @ts-ignore
jovoIntentDialogflowMessages.push(message);
_set(jovoIntent, 'dialogflow.responses[0].messages', jovoIntentDialogflowMessages);
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/jovo-model-google/src/JovoModelGoogle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ export class JovoModelGoogle extends JovoModel {

jovoModel.entityTypes![modelName] = jovoEntity;
} else {
const props: GoogleActionLanguageModelProperty[] = _get(
// @ts-ignore
const props: GoogleActionLanguageModelProperty[] = _get(
jovoModel,
`googleAssistant.custom.${modelType}`,
{},
Expand Down
Loading