Closed prasant94 closed 8 months ago
auto_learn
is not included on the sdks, it’s marked as for internal use only. As for intent_classification
, it's not listed in our docs. This could potentially be available later on in some future release.
For now if you need to modify them, feel free to use the following custom code:
public final MediaType JSON
= MediaType.get("application/json; charset=utf-8");
OkHttpClient client = new OkHttpClient();
String post(String url, String json, String token) throws IOException {
RequestBody body = RequestBody.create(JSON, json);
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Bearer " + token)
.post(body)
.build();
try (Response response = client.newCall(request).execute()) {
return response.body().string();
}
}
...
Assistant service = new Assistant(version);
String workspaceId = "xxxxxxx-xxxxx-xxxx-xxxx-xxxxxxx";
String bearerToken = ((IamAuthenticator)service.getAuthenticator()).getToken();
String jsonBody = "{\"system_settings\": {" +
" \"auto_learn\": {" +
" \"apply\": true" +
" }," +
" \"intent_classification\": {" +
" \"training_backend_version\": \"v2\"" +
" }," +
" \"spelling_auto_correct\": true" +
" }}";
String response = post( service.getServiceUrl() + "/v1/workspaces/" + workspaceId + "?version=2021-06-14", jsonBody, bearerToken);
The main problem is
As of now, if we use the UpdateWorkspace method in the java sdk to update a workspace (with append = false), auto_learn gets disabled and intent_classification goes from Enhanced version to Classic version
I don't want to change those two fields. I only want to be able to update the rest of the Workspace without affecting those two settings. But since I can't include them in the request, they get changed (presumably to their default values)
@prasant94 what did it have for training_backend_version
& auto_learn
before calling the function?
training_backend_version
was v2
and auto_learn
was {"apply": true}
These are the responses I got from calling Get Workspace API with curl:
Before
"system_settings": {
"off_topic": {
"enabled": true
},
"auto_learn": {
"apply": true
},
"disambiguation": {
"prompt": "Did you mean:",
"enabled": false,
"randomize": true,
"max_suggestions": 2,
"suggestion_text_policy": "title",
"none_of_the_above_prompt": "None of the above."
},
"human_agent_assist": {
"prompt": "Did you mean:"
},
"intent_classification": {
"training_backend_version": "v2"
},
"spelling_auto_correct": true
}
After
"system_settings": {
"off_topic": {
"enabled": true
},
"disambiguation": {
"prompt": "Did you mean:",
"enabled": false,
"randomize": true,
"max_suggestions": 2,
"suggestion_text_policy": "title",
"none_of_the_above_prompt": "None of the above."
},
"human_agent_assist": {
"prompt": "Did you mean:"
},
"spelling_auto_correct": true
}
Closing due to age. If this is still a concern using the latest version of the java-sdk please feel free to reopen this issue.
The
Workspace
model in the sdk is missing some fields that we receive if we make a curl request to the Get Workspace API. Specifically, theWorkspaceSystemSettings
field (WorkspaceSystemSettings.java) inWorkspace
is missing the fieldsauto_learn
andintent_classification
fields.Can those be added to the SDK?
As of now, if we use the UpdateWorkspace method in the java sdk to update a workspace (with
append = false
),auto_learn
gets disabled andintent_classification
goes fromEnhanced version
toClassic version
FYI - I checked the go and nodejs sdks and they also seem to be missing these.