Esempio n. 1
0
        public void NugetAndRequestVersionsShouldMatch()
        {
            string requestVersion = new ClarifaiHttpClient("").CurrentVersion;

            string    csprojFilePath = "../../../../Clarifai/Clarifai.csproj";
            XDocument x             = XDocument.Load(csprojFilePath);
            string    csprojVersion = x.Root.Element("PropertyGroup").Element("PackageVersion").Value;

            Assert.AreEqual(requestVersion, csprojVersion);
        }
Esempio n. 2
0
        public async Task GenerateToken()
        {
            var response = await ClarifaiHttpClient.GetToken(ClientId, ClientSecret);

            if (response is TokenError)
            {
                TokenError er = (TokenError)response;
                _accessToken = "";
                throw new Exception(er.Status_Msg);
            }
            else
            {
                Token token = (Token)response;
                _accessToken = token.Access_Token;
            }
        }
Esempio n. 3
0
        public async Task <Predict> PredictByFolderPath(string folder_path)
        {
            Predict response = await ClarifaiHttpClient.GetFolderImgsPrediction(AccessToken, folder_path);

            return(response);
        }
Esempio n. 4
0
        public async Task <Predict> PredictByImgURL(List <string> urls)
        {
            Predict response = await ClarifaiHttpClient.GetImgUrlPrediction(AccessToken, urls);

            return(response);
        }
Esempio n. 5
0
        public async Task <object> GetToken()
        {
            var response = await ClarifaiHttpClient.GetToken(ClientId, ClientSecret);

            return(response);
        }