mirror of
https://github.com/symfony/ai-ollama-platform.git
synced 2026-03-23 23:22:07 +01:00
[Platform] Throw InvalidArgumentException when ModelClient receives a string payload
This commit is contained in:
committed by
Oskar Stark
parent
f6c952af20
commit
062e5061e6
@@ -65,6 +65,10 @@ final class OllamaClient implements ModelClientInterface
|
||||
*/
|
||||
private function doCompletionRequest(array|string $payload, array $options = []): RawHttpResult
|
||||
{
|
||||
if (\is_string($payload)) {
|
||||
throw new InvalidArgumentException(\sprintf('Payload must be an array, but a string was given to "%s".', self::class));
|
||||
}
|
||||
|
||||
// Revert Ollama's default streaming behavior
|
||||
$options['stream'] ??= false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user