This commit is contained in:
@@ -13,6 +13,21 @@ class FakeProvider implements ProviderInterface
|
||||
{
|
||||
public function sendMessage(string $systemPrompt, string $userContent, int $maxTokens): array
|
||||
{
|
||||
if (str_contains($systemPrompt, 'Placeholder-Namen')) {
|
||||
$input = json_decode($userContent, true);
|
||||
$classifications = array_map(static fn(array $candidate): array => [
|
||||
'id' => $candidate['id'],
|
||||
'blockIds' => $candidate['blockIds'] ?? [$candidate['id']],
|
||||
'name' => $candidate['suggestedName'] ?? 'Feld',
|
||||
'type' => $candidate['type'] ?? 'text',
|
||||
'confidence' => $candidate['confidence'] ?? 'low',
|
||||
], $input['candidates'] ?? []);
|
||||
return [
|
||||
'content' => json_encode(['classifications' => $classifications]),
|
||||
'inputTokens' => 42, 'outputTokens' => 17,
|
||||
'cacheCreationInputTokens' => 0, 'cacheReadInputTokens' => 0,
|
||||
];
|
||||
}
|
||||
return [
|
||||
'content' => json_encode([
|
||||
'lessons' => [
|
||||
|
||||
Reference in New Issue
Block a user