Files
muninn/app/Support/AiProviders/AiGenerationResult.php
T
m105andClaude Sonnet 5 0e315ada04 Add AI provider abstraction and asset storage (tasks #33, #34)
AiProviderDriver: one generic interface (generate(prompt, options) ->
AiGenerationResult) rather than per-capability interfaces, since text
(OpenAI chat completions), image (StabilityAI stable-image), and
speech (ElevenLabs TTS) generation all reduce to prompt-in/content-out.
Drivers throw AiGenerationException on failure; AiProviderManager
resolves the right driver from an AiProvider record's `provider`
column and guards on is_active. Real request/response shapes per each
provider's API, verified with Http::fake() — no live API keys
available yet to smoke test against the real services.

AssetStorage: stores generated content under
video-projects/{id}/{type}/v{n}.{ext}, versioned per (project, type[,
step]) slot so retries don't clobber earlier output, plus
contents/url/delete and pruneOldVersions for cleanup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-06 20:47:06 +03:00

17 lines
449 B
PHP

<?php
namespace App\Support\AiProviders;
final class AiGenerationResult
{
/**
* @param string $content Text or raw binary bytes, depending on $contentType.
* @param array<string, mixed> $raw The provider's decoded response, for debugging/metadata.
*/
public function __construct(
public readonly string $content,
public readonly string $contentType,
public readonly array $raw = [],
) {}
}