Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Conversation

@Danieladu
Copy link
Contributor

@Danieladu Danieladu commented Jan 29, 2021

Fixes #5009

Description

Introduce a new built-in function that refers to smart interpolation.

The original requirements are:

  • when user input is a simple variable, like ${name} or ${age}, it should evaluate as a single variable and the return type is the variable type (int\float\string, it could vary)
  • when user input is text + variables, like ${age} is too big, it should evaluate as a string intepolation, and always return a string type

Samples:
stringOrValue('${2+3}') -> 5
stringOrValue('woof is ${3+5}') would produce 'woof is 8'.

Changes

Create a new function that can evaluate the value expression smartly.

@Danieladu Danieladu changed the title Hond/string or value [Expression]Add stringOrValue built-in function Jan 29, 2021
@tomlm tomlm added the draft The issue definition is still being worked on and it is not ready to start development. label Feb 3, 2021
@mrivera-ms mrivera-ms added this to the R12 milestone Feb 4, 2021
@Danieladu Danieladu marked this pull request as ready for review February 4, 2021 07:31
@Danieladu Danieladu requested review from a team as code owners February 4, 2021 07:31
@Danieladu Danieladu requested a review from mrivera-ms February 7, 2021 03:31
@Danieladu Danieladu removed the draft The issue definition is still being worked on and it is not ready to start development. label Feb 7, 2021
@boydc2014 boydc2014 merged commit 84be3eb into main Feb 8, 2021
@boydc2014 boydc2014 deleted the hond/stringOrValue branch February 8, 2021 07:25
peterinnesmsft added a commit that referenced this pull request Feb 8, 2021
* Added GetConversationReference/ContinueConversation actions (#4974)

* - added ContinueConversation action
- Fixed missing registrations for ContinueConversationLater
- cleaned up comments
- added mock StorageQueue
- changed continuation tests to use mock storageQueue

* Add GetConversationReference

* updated comments as per feedback

* Teams: adaptive actions (#4782)

* Rebasing Teams GetParticipant

* remove meeting parameter from TeamsChannelData

* Add inMeeting to TeamsParticipantChannelAccount

* Add Send Task Module Continue and Message adaptive responses

* add some comments

* Add more teams actions

* Fix copy/paste 'url' issue

* Cleanup SendMessagingExtensionActionResponse

* Add CacheInfo base class for InvokeResponses

* Add GetMember and some schema files

* Continue response updates

* Schema updates

* Add actions for TeamsInfo methods

* updaete schema and uischema

* Cleanup teams responses and schema files

* More teams adaptive schema cleanup

* New teams actions and some cleanup

* More Teams adaptive additions and cleanup

* schema updates

* Revert TeamsInfo app credentials breaking change

* Rebasing Teams GetParticipant

* remove meeting parameter from TeamsChannelData

* Add inMeeting to TeamsParticipantChannelAccount

* Add Send Task Module Continue and Message adaptive responses

* add some comments

* Add more teams actions

* Fix copy/paste 'url' issue

* Cleanup SendMessagingExtensionActionResponse

* Add CacheInfo base class for InvokeResponses

* Add GetMember and some schema files

* Continue response updates

* Schema updates

* Add actions for TeamsInfo methods

* updaete schema and uischema

* Cleanup teams responses and schema files

* More teams adaptive schema cleanup

* New teams actions and some cleanup

* More Teams adaptive additions and cleanup

* schema updates

* Revert TeamsInfo app credentials breaking change

* Lowerase teams enums

* schema updates

* Change 'activity' to 'card' where appropriate

* Add Michael Richardsons Teams Actions tests

* Teams ActionTests

* cleanup adaptive teams tests

* sync tests w/ @mdrichardson branch

* fix schema errors

* check for missing Card

* Some cleanup and code consolidation

* Update ExpressionExtensions.cs

* Review feedback

* Fix Teams trigger and action namespaces

* schema updates

Co-authored-by: Michael Richardson <[email protected]>

* Johtaylo/cloudusertokenclient (#5062)

* added UserTokenClient
added ConnectorFactory and fleshed out signinprompt for testing

* call checks on user token client

* added signin prompt: an oauth prompt that works with cloud adapter

* hide cloud oauth prompt from programming model

* update Auth test bot to use CloudAdapter and OAuthPrompt

* add continuation activity overloads

* update webapi and start adding unit tests for continue

* fix breaking oauthprompt test and add continue conversation tests

* add unit tests for oauth prompt running with cloud adapter

* cr feedback

* Update libraries/Microsoft.Bot.Builder.Dialogs/Prompts/CloudOAuthPrompt.cs

Co-authored-by: Carlos Castro <[email protected]>

* Update libraries/Microsoft.Bot.Builder.Dialogs/Prompts/CloudOAuthPrompt.cs

Co-authored-by: Carlos Castro <[email protected]>

* more feedback

* add moq test for oauth prompt signout

Co-authored-by: Carlos Castro <[email protected]>

* Remove stranded CA2208 restore (#5150)

* Orchestrator Recognizer support 32-bit (#5152)

* Orchestrator Recognizer support 32-bit

* Update to netstandard2.1

* Orchestrator Recognizer: Rename misleading parameter names (#5147)

* Rename parameters : snapshotPath to snapshotFile, modelPath to modelFolder

* Fix schema

* Update schema names

* Add test for NumericEvaluator (#5139)

* add test

* Change test name

* remove references to TrustServiceUrl (#5157)

* remove references to TrustServiceUrl

* cr feedback

* obsolete trusted service url

* Use ConcurrentDictionary to store reference to Orchestrator (#5141)

* Pair programmed with Carlos - use ConcurrentDictionary to store references to Orchestrator obj.

* minor typo

* Fix deliveryMode.ExpectReplies for skills. (#5142)

* Fixes deliveryMode.ExpectReplies for skills.

When callling /api/messages the return type is always a InvokeResponse<T> data structure.

When a skill receives an activity with deliveryMode=expectReplies, it the botframeworkAdapter caches responses and returns it as a InvokeReponse<ExpectedReplies> meaning
```
{
   "status": status code
   "body": { // type expectedReplies
      "activities": [... ]
    }
}
```
This is correct behavior.

The bug is that the BotFrameworkHttpClient code is interpreting the body of the response as ExpectedReplies instead of InvokeResponse<ExpectedReplies>

The properties don't align and hence not processed.

The unit tests test both sides independently but with mismatched assumptions, so only when e2e is used it doesn't work. (classic metric vs english measurement situation).

This changes client to do correc thing and aligns unit tests to same assumptions as the bot framework adapter class.

* more accurate

* Small fix for Expression (#5154)

* Revert "Fix deliveryMode.ExpectReplies for skills. (#5142)" (#5162)

This reverts commit 2a503a4.

* Updated DialogManager to return EoC code (as RunAsync does) and updated tests (#5164)

* Add action policies to .schema (#5168)

* Add action policies to .schema

* Update tests.schema

* fix: null audiences/OAuthScopes shouldn't break streaming (#5170)

* add test case for #5110

* use TurnState.Set instead of .Add in Adapter

* fix BFHTTPAdapterBase test, add non-null callerId test

* cleanup unnecessary test usings

* [Expression]Add stringOrValue built-in function (#5138)

* init

* add stringOrValue built-in function

* remove todo tag

* fix comments

Co-authored-by: Tom Laird-McConnell <[email protected]>
Co-authored-by: Eric Dahlvang <[email protected]>
Co-authored-by: Michael Richardson <[email protected]>
Co-authored-by: johnataylor <[email protected]>
Co-authored-by: Carlos Castro <[email protected]>
Co-authored-by: daveta <[email protected]>
Co-authored-by: Hongyang Du (hond) <[email protected]>
Co-authored-by: taicchoumsft <[email protected]>
Co-authored-by: Gabo Gilabert <[email protected]>
Co-authored-by: Steven Gum <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New "SmartIntepolation" expression property

4 participants