1. Go to this page and download the library: Download lotse/steg-bundle 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/ */
use Steg\Client\InferenceClientInterface;
use Steg\Model\ChatMessage;
final class MyService
{
public function __construct(
private readonly InferenceClientInterface $steg,
) {}
public function translate(string $text): string
{
$response = $this->steg->complete([
ChatMessage::system('You are a translation assistant.'),
ChatMessage::user($text),
]);
return $response->content;
}
}
use Steg\Client\InferenceClientInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
final class MyService
{
public function __construct(
#[Autowire(service: 'steg.client.vllm_local')]
private readonly InferenceClientInterface $vllm,
#[Autowire(service: 'steg.client.ollama_dev')]
private readonly InferenceClientInterface $ollama,
) {}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.