Skip to content

Commit 687c657

Browse files
committed
[conversation] Add createCounterExample
1 parent 368a045 commit 687c657

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

conversation/v1.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,4 +923,32 @@ ConversationV1.prototype.getCounterExamples = function(params, callback) {
923923
return requestFactory(parameters, callback);
924924
};
925925

926+
/**
927+
* Method: createCounterExample
928+
*
929+
* Add a new counterexample to a workspace. Counterexamples are examples that have been marked as irrelevant input.
930+
*
931+
* @param {Object} params
932+
* @param {String} params.workspace_id
933+
* @param {String} params.text The text of a user input example.
934+
* @param {Function} [callback]
935+
*
936+
*/
937+
ConversationV1.prototype.createCounterExample = function(params, callback) {
938+
params = params || {};
939+
940+
const parameters = {
941+
options: {
942+
url: '/v1/workspaces/{workspace_id}/counterexamples',
943+
method: 'POST',
944+
json: true,
945+
path: pick(params, ['workspace_id']),
946+
body: pick(params, ['text'])
947+
},
948+
requiredParams: ['workspace_id', 'text'],
949+
defaultOptions: this._options
950+
};
951+
return requestFactory(parameters, callback);
952+
};
953+
926954
module.exports = ConversationV1;

0 commit comments

Comments
 (0)