New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prague

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prague - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

8

dist/rules/LUIS.d.ts

@@ -10,3 +10,3 @@ import { Observable } from 'rxjs';

entity: string;
type: "accountName";
type: string;
startIndex: number;

@@ -18,5 +18,5 @@ endIndex: number;

query: string;
topScoringIntent: LuisIntent;
intents: LuisIntent[];
entities: LuisEntity[];
topScoringIntent?: LuisIntent;
intents?: LuisIntent[];
entities?: LuisEntity[];
}

@@ -23,0 +23,0 @@ export interface LuisRule<S extends ITextInput> {

@@ -84,3 +84,5 @@ "use strict";

};
this.url = "https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/" + id + "?subscription-key=" + key + "&q=";
this.url =
id === 'id' && key === 'key' ? 'testData' :
"https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/" + id + "?subscription-key=" + key + "&q=";
}

@@ -93,5 +95,7 @@ LUIS.prototype.call = function (utterance) {

? rxjs_1.Observable.of(response).do(function (_) { return console.log("from cache!!"); })
: rxjs_1.Observable.ajax.get(_this.url + utterance)
.do(function (ajaxResponse) { return console.log("LUIS response!", ajaxResponse); })
.map(function (ajaxResponse) { return ajaxResponse.response; })
: (_this.url === 'testData'
? rxjs_1.Observable.of(_this.testData[utterance])
: rxjs_1.Observable.ajax.get(_this.url + utterance)
.do(function (ajaxResponse) { return console.log("LUIS response!", ajaxResponse); })
.map(function (ajaxResponse) { return ajaxResponse.response; }))
.do(function (luisResponse) { return _this.cache[utterance] = luisResponse; }); });

@@ -98,0 +102,0 @@ };

{
"name": "prague",
"version": "0.3.3",
"version": "0.3.4",
"description": "experimental Rx-based bot technology",

@@ -5,0 +5,0 @@ "main": "dist/prague.js",

@@ -14,3 +14,3 @@ import { Observable } from 'rxjs';

entity: string;
type: "accountName";
type: string;
startIndex: number;

@@ -23,5 +23,5 @@ endIndex: number;

query: string;
topScoringIntent: LuisIntent;
intents: LuisIntent[];
entities: LuisEntity[];
topScoringIntent?: LuisIntent;
intents?: LuisIntent[];
entities?: LuisEntity[];
}

@@ -38,2 +38,6 @@

interface TestData {
[utterance: string]: LuisResponse;
}
export class LUIS<S extends ITextInput> {

@@ -44,6 +48,8 @@ private cache: LuisCache = {};

constructor(id: string, key: string, private scoreThreshold = 0.5) {
this.url = `https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/${id}?subscription-key=${key}&q=`;
this.url =
id === 'id' && key === 'key' ? 'testData' :
`https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/${id}?subscription-key=${key}&q=`;
}
private testData = {
private testData: TestData = {
"Wagon Wheel": {

@@ -129,5 +135,8 @@ query: "Wagon Wheel",

? Observable.of(response).do(_ => console.log("from cache!!"))
: Observable.ajax.get(this.url + utterance)
.do(ajaxResponse => console.log("LUIS response!", ajaxResponse))
.map(ajaxResponse => ajaxResponse.response as LuisResponse)
: (this.url === 'testData'
? Observable.of(this.testData[utterance])
: Observable.ajax.get(this.url + utterance)
.do(ajaxResponse => console.log("LUIS response!", ajaxResponse))
.map(ajaxResponse => ajaxResponse.response as LuisResponse)
)
.do(luisResponse => this.cache[utterance] = luisResponse)

@@ -134,0 +143,0 @@ )

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc