Update Claude 3.5 Sonnet model version to 20241022

- Update Claude 3.5 Sonnet model version from 20240620 to 20241022 across:
  - AnthropicApi model definitions
  - Integration tests
  - Sample events JSON
  - Documentation pages
- Upgrade Ollama container to 0.3.14 in tests
- Add llama3.2:1b model to Ollama tests
- Convert Ollama functionCallTest to parameterized test
This commit is contained in:
Christian Tzolov
2024-10-22 22:17:01 +02:00
parent 7b06fcf98b
commit a1980ec4dd
7 changed files with 13 additions and 11 deletions

View File

@@ -150,7 +150,7 @@ public class AnthropicApi {
public enum ChatModel implements ChatModelDescription {
// @formatter:off
CLAUDE_3_5_SONNET("claude-3-5-sonnet-20240620"),
CLAUDE_3_5_SONNET("claude-3-5-sonnet-20241022"),
CLAUDE_3_OPUS("claude-3-opus-20240229"),
CLAUDE_3_SONNET("claude-3-sonnet-20240229"),

View File

@@ -78,7 +78,7 @@ class AnthropicChatModelIT {
@ParameterizedTest(name = "{0} : {displayName} ")
@ValueSource(strings = { "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307",
"claude-3-5-sonnet-20240620" })
"claude-3-5-sonnet-20241022" })
void roleTest(String modelName) {
UserMessage userMessage = new UserMessage(
"Tell me about 3 famous pirates from the Golden Age of Piracy and why they did.");

View File

@@ -260,7 +260,7 @@ class AnthropicChatClientIT {
@ParameterizedTest(name = "{0} : {displayName} ")
@ValueSource(strings = { "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307",
"claude-3-5-sonnet-20240620" })
"claude-3-5-sonnet-20241022" })
void multiModalityEmbeddedImage(String modelName) throws IOException {
// @formatter:off
@@ -280,7 +280,7 @@ class AnthropicChatClientIT {
@Disabled("Currently Anthropic API does not support external image URLs")
@ParameterizedTest(name = "{0} : {displayName} ")
@ValueSource(strings = { "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307",
"claude-3-5-sonnet-20240620" })
"claude-3-5-sonnet-20241022" })
void multiModalityImageUrl(String modelName) throws IOException {
// TODO: add url method that wrapps the checked exception.

View File

@@ -6,7 +6,7 @@
"type": "message",
"role": "assistant",
"content": [],
"model": "claude-3-5-sonnet-20240620",
"model": "claude-3-5-sonnet-20241022",
"stop_reason": null,
"stop_sequence": null,
"usage": {

View File

@@ -77,7 +77,7 @@ class OllamaWithOpenAiChatModelIT {
private static final String DEFAULT_OLLAMA_MODEL = "mistral";
@Container
static OllamaContainer ollamaContainer = new OllamaContainer("ollama/ollama:0.3.9");
static OllamaContainer ollamaContainer = new OllamaContainer("ollama/ollama:0.3.14");
static String baseUrl = "http://localhost:11434";
@@ -86,6 +86,7 @@ class OllamaWithOpenAiChatModelIT {
logger.info("Start pulling the '" + DEFAULT_OLLAMA_MODEL + " ' generative ... would take several minutes ...");
ollamaContainer.execInContainer("ollama", "pull", DEFAULT_OLLAMA_MODEL);
ollamaContainer.execInContainer("ollama", "pull", "llava");
ollamaContainer.execInContainer("ollama", "pull", "llama3.2:1b");
logger.info(DEFAULT_OLLAMA_MODEL + " pulling competed!");
baseUrl = "http://" + ollamaContainer.getHost() + ":" + ollamaContainer.getMappedPort(11434);
@@ -260,8 +261,9 @@ class OllamaWithOpenAiChatModelIT {
assertThat(actorsFilms.movies()).hasSize(5);
}
@Test
void functionCallTest() {
@ParameterizedTest(name = "{0} : {displayName} ")
@ValueSource(strings = { "llama3.2:1b" })
void functionCallTest(String modelName) {
UserMessage userMessage = new UserMessage(
"What's the weather like in San Francisco, Tokyo, and Paris? Return the temperature in Celsius.");