Skip to content

Commit

Permalink
API naming for LG (#1883)
Browse files Browse the repository at this point in the history
* rename lg

* rename templates property to items

* rename

* rename

* Updated Templates to look like a collection

* Fixed unit tests

Co-authored-by: Steven Ickman <stevenic@microsoft.com>
  • Loading branch information
Danieladu and Stevenic authored Mar 10, 2020
1 parent 4d5b305 commit 42e366d
Show file tree
Hide file tree
Showing 35 changed files with 1,586 additions and 1,542 deletions.
618 changes: 618 additions & 0 deletions libraries/botbuilder-core/src/activityFactory.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions libraries/botbuilder-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

export * from 'botframework-schema';
export * from './activityFactory';
export * from './appCredentials';
export * from './activityHandler';
export * from './activityHandlerBase';
Expand Down
8 changes: 4 additions & 4 deletions libraries/botbuilder-lg/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ For NodeJS, add botbuilder-lg
Load the template manager with your .lg file

```typescript
let lgFile = new LGParser.parseFile(filePath, importResolver?, expressionParser?);
let templates = new Templates.parseFile(filePath, importResolver?, expressionParser?);
```
When you need template expansion, call the LGFile and pass in the relevant template name
When you need template expansion, call the templates and pass in the relevant template name
```typescript
await turnContext.sendActivity(lgFile.evaluateTemplate("<TemplateName>", entitiesCollection));
await turnContext.sendActivity(templates.evaluate("<TemplateName>", entitiesCollection));
```
If your template needs specific entity values to be passed for resolution/ expansion, you can pass them in on the call to `evaluateTemplate`
```typescript
await turnContext.sendActivity(lgFile.evaluateTemplate("WordGameReply", { GameName = "MarcoPolo" } ));
await turnContext.sendActivity(templates.evaluate("WordGameReply", { GameName = "MarcoPolo" } ));
```
[1]:https://github.com/Microsoft/BotBuilder/blob/master/specs/botframework-activity/botframework-activity.md
Expand Down
320 changes: 0 additions & 320 deletions libraries/botbuilder-lg/src/activityChecker.ts

This file was deleted.

Loading

0 comments on commit 42e366d

Please sign in to comment.