如何修复buildFromSessionId(uuid)中的uuid错误?

时间:2019-08-02 23:12:39

标签: java android diagflow

我正在尝试在Android上运行diagflow。但是我无法克服AIServiceContextBuilder中的buildFromSessionId(java.lang.String)无法应用于(Java.util.UUID)的问题。我做错了什么?我完全错过了一些东西。

import java.util.UUID;
import ai.api.AIServiceContext;
import ai.api.AIServiceContextBuilder;
import ai.api.android.AIConfiguration;
import ai.api.android.AIDataService;
import ai.api.model.AIRequest;

public class MainActivity extends AppCompatActivity{

    UUID uuid;
    AIDataService aiDataService;
    AIServiceContext customAIServiceContext;
    AIRequest aiRequest;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    private void initChatbot(){
        final AIConfiguration config = new AIConfiguration("<Client Access Token>",
                AIConfiguration.SupportedLanguages.English,
                AIConfiguration.RecognitionEngine.System);
        aiDataService = new AIDataService(this, config);
        customAIServiceContext = AIServiceContextBuilder.buildFromSessionId(uuid);
        aiRequest = new AIRequest();
    }
}

0 个答案:

没有答案