PHP code example of obrainwave / ai-semantic-engine-phpsdk
1. Go to this page and download the library: Download obrainwave/ai-semantic-engine-phpsdk library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
obrainwave / ai-semantic-engine-phpsdk example snippets
iSemanticEngine\Client;
$client = new Client('https://ai.quizcore.org', 'YOUR_API_KEY');
// 1. Embed Text
$embeddings = $client->embed("Hello world");
// 2. Compute Similarity
$score = $client->similarity("Apple", "Orange");
// 3. Store Knowledge
$client->store("Machine learning is fascinating.", ["topic" => "AI"]);
// 4. Search Knowledge
$results = $client->search("Tell me about AI", 3);
print_r($results);