Skip to content

Commit

Permalink
Now with source_language_code
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTavor committed Mar 18, 2020
1 parent 90d494c commit f742006
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion build/coco.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/coco.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/module.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified release/cognigy-coco-module.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion src/coco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ export class ComponentSession {
this.session_id = session_id;
}

call(user_input?: string, context?: any) {
call(user_input?: string, context?: any, source_language_code?: string) {
return new Promise<CocoResponse | Error>((resolve, reject) => {
const payload = {} as any;
user_input && (payload.user_input = user_input);
context && (payload.context = context);
source_language_code && (payload.source_language_code = source_language_code);
rp(
{
method: "POST",
Expand Down
6 changes: 5 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ import {ComponentSession} from "./coco";
* @arg {CognigyScript} `component` name of the component
* @arg {CognigyScript} `developerKey` optional developer API key
* @arg {Boolean} `stopOnError` Whether to stop on error or continue
* @arg {CognigyScript} `source_language_code` optional language code
*/
async function CoCo(input: IFlowInput, args: {component: string; developerKey: string; stopOnError: boolean}) {
async function CoCo(
input: IFlowInput,
args: {component: string; developerKey: string; stopOnError: boolean; source_language_code: string}
) {
if (!args.component) {
throw new Error("No component provided");
}
Expand Down

0 comments on commit f742006

Please sign in to comment.