Skip to content

Commit

Permalink
correct spelling of ephemeral
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisB-TL committed Dec 16, 2024
1 parent bff43cb commit a7b32b3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Providers/Anthropic/Enums/AnthropicCacheType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

enum AnthropicCacheType
{
case ethemeral;
case ephemeral;
}
4 changes: 2 additions & 2 deletions tests/Providers/Anthropic/AnthropicTextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@
->using('anthropic', 'claude-3-5-sonnet-20240620')
->withMessages([
(new SystemMessage('Old context'))->withProviderMeta(Provider::Anthropic, ['cacheType' => 'ephemeral']),
(new UserMessage('New context'))->withProviderMeta(Provider::Anthropic, ['cacheType' => 'ephemeral'])
(new UserMessage('New context'))->withProviderMeta(Provider::Anthropic, ['cacheType' => 'ephemeral']),
])
->generate();

expect($response->usage->cacheWriteInputTokens)->toBe(200);
expect($response->usage->cacheReadInputTokens)->ToBe(100);
});
});
12 changes: 6 additions & 6 deletions tests/Providers/Anthropic/MessageMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@
[
'type' => 'text',
'text' => 'Who are you?',
'cache_control' => ['type' => 'ethemeral'],
'cache_control' => ['type' => 'ephemeral'],
],
],
]]);
})->with([
'ethemeral',
AnthropicCacheType::ethemeral,
'ephemeral',
AnthropicCacheType::ephemeral,
]);

it('sets the cache type on an AssistantMessage if cacheType providerMeta is set on message using an enum', function (mixed $cacheType): void {
Expand All @@ -178,13 +178,13 @@
[
'type' => 'text',
'text' => 'Who are you?',
'cache_control' => ['type' => AnthropicCacheType::ethemeral->name],
'cache_control' => ['type' => AnthropicCacheType::ephemeral->name],
],
],
]]);
})->with([
'ethemeral',
AnthropicCacheType::ethemeral,
'ephemeral',
AnthropicCacheType::ephemeral,
]);

it('sets the cache type on a SystemMessage if cacheType providerMeta is set on message using an enum', function (): void {})->todo('This test will need adding when the multiple system prompts PR gets merged.');
6 changes: 3 additions & 3 deletions tests/Providers/Anthropic/ToolMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
],
'required' => ['query'],
],
'cache_control' => ['type' => 'ethemeral'],
'cache_control' => ['type' => 'ephemeral'],
]]);
})->with([
'ethemeral',
AnthropicCacheType::ethemeral,
'ephemeral',
AnthropicCacheType::ephemeral,
]);

0 comments on commit a7b32b3

Please sign in to comment.