Question Answering
SkillfulAPI.QuestionAnswering
SkillfulAPI.QuestionAnsweringOverview
Function Example
using SkillfulAI.API;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QuestionAnswering : MonoBehaviour
{
/// <summary>
/// Unity's Start method, called when the script is initialized. Initiates the question answering process.
/// </summary>
private void Start()
{
Question();
}
/// <summary>
/// Initiates question answering based on a specified question and context.
/// </summary>
public void Question()
{
// Context information for answering the question
string context = "The grass is green";
// Question to be answered based on the provided context
string question = "What colour is grass?";
// Perform question answering
SkillfulAPI.QuestionAnswering(question, context, response =>
{
// Log the answer obtained from the API
Debug.Log(response.answer);
});
}
}Detailed Explanation
Usage Example
Conclusion
Last updated