2

我正在尝试让 diagflow 在 android 上运行。但是我无法通过 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();
    }
}
4

0 回答 0