Minimaxi
Overview¶
Support for Minimaxi's API.
Inference feature compatibility: - Instructor markdown-JSON fallback (supported) - tool calling (not supported) - native JSON object response_format (not supported) - native JSON schema response_format (not supported)
Example¶
<?php
use Cognesy\Messages\Messages;
use Cognesy\Polyglot\Inference\Inference;
use Cognesy\Utils\Str;
require 'examples/boot.php';
$answer = Inference::using('minimaxi')
->with(
messages: Messages::fromString('What is the capital of France'),
options: ['max_tokens' => 256]
)
->get();
echo "USER: What is capital of France\n";
echo "ASSISTANT: $answer\n";
assert(Str::contains($answer, 'Paris'));
?>