Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        client = GetComponent <DialogFlowV2Client>();

        audioPlayer = GetComponent <AudioSource>();

        // Adjustes session name if it is blank.
        string sessionName = GetSessionName();

        client.ChatbotResponded  += LogResponseText;
        client.DetectIntentError += LogError;
        client.ReactToContext("DefaultWelcomeIntent-followup",
                              context => Debug.Log("Reacting to welcome followup"));
        client.SessionCleared += sess => Debug.Log("Cleared session " + session);
        client.AddInputContext(new DF2Context("userdata", 1, ("name", "George")), sessionName);

        Dictionary <string, object> parameters = new Dictionary <string, object>()
        {
            { "name", "George" }
        };

        client.DetectIntentFromEvent("test-inputcontexts", parameters, sessionName);

        WaitingPanel.SetActive(false);
        WaitingRecord.SetActive(false);
    }
    // Start is called before the first frame update
    void Start()
    {
        // client = GetComponent<DialogFlowV2Client>();

        // client.ChatbotResponded += LogResponseText;
        // client.DetectIntentError += LogError;
        // client.ReactToContext("DefaultWelcomeIntent-followup",
        //     context => Debug.Log("Reacting to welcome followup"));
        // client.SessionCleared += sess => Debug.Log("Cleared session " + session);
        // client.AddInputContext(new DF2Context("userdata", 1, ("name", "George")), name);



        // Dictionary<string, object> parameters = new Dictionary<string, object>()
        // {
        //     { "name", "George" }
        // };
        // client.DetectIntentFromEvent("test-inputcontexts", parameters, name);


        client = GetComponent <DialogFlowV2Client>();

        client.ChatbotResponded  += LogResponseText;
        client.DetectIntentError += LogError;

        // Send additional parameters to event
        Dictionary <string, object> parameters = new Dictionary <string, object>()
        {
            { "name", "George" }
        };
        // client.DetectIntentFromEvent("event-name", parameters, session.text);
        // client.DetectIntentFromText("fox force four", "one");
        // SendText("fox force four");
    }
Beispiel #3
0
    void Start()
    {
        Client = GetComponent <DialogFlowV2Client>();

        Client.ChatbotResponded  += LogResponseText;
        Client.DetectIntentError += LogError;
        Client.ReactToContext("DefaultWelcomeIntent-followup", context => Debug.Log("Reacting to welcome followup"));
        Client.SessionCleared += sess => Debug.Log("Cleared session [" + SessionName + "]");
        Client.ClearSession(SessionName);
    }
Beispiel #4
0
    // Start is called before the first frame update
    void Start()
    {
        client = GetComponent <DialogFlowV2Client>();

        client.ChatbotResponded  += LogResponseText;
        client.DetectIntentError += LogError;
        client.ReactToContext("DefaultWelcomeIntent-followup",
                              context => Debug.Log("Reacting to welcome followup"));
        client.SessionCleared += sess => Debug.Log("Cleared session " + session);
        client.AddInputContext(new DF2Context("userdata", 1, ("name", "George")), name);



        Dictionary <string, object> parameters = new Dictionary <string, object>()
        {
            { "name", "George" }
        };

        client.DetectIntentFromEvent("test-inputcontexts", parameters, name);
    }