Skip to content

[PORT] Support accessing global memories in injecting LG templates as Expressions #1353

@tomlm

Description

@tomlm

Port this change from botbuilder-dotnet/master branch:
microsoft/botbuilder-dotnet#4452

Issue reported by @chrimc62 that the injected LG function don't have access to global state (DSM state).

This PR enable injected LG template functions to access global memories.

Suppose we have a template, with a global variable {user: {name: "user1", date: "2001-01-01"}, }

> !# @strict = false
> !# @namespace = Adaptive
> !# @Exports = UserDataConcat

#UserDataConcat()
- ${user.name} : ${user.date}

The result of evaluating the expression Expression.parse("Adaptive.UserDataConcat()") is user1 : 2001-01-01

Changed projects

  • Microsoft.Bot.Builder.LanguageGeneration
  • Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests
  • Microsoft.Bot.Builder.LanguageGeneration.Tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions