feat: Add Pixtral and new Llama 3.2 Vision models to MistralAi and Ollama integrations

- Add Pixtral models (PIXTRAL and PIXTRAL_LARGE) to MistralAiApi.ChatModel
- Update MistralAiChatClientIT to use Pixtral model for testing
- Add new Ollama models:
  * QWEN_2_5_7B
  * LLAMA3_2_VISION_11b
  * LLAMA3_2_VISION_90b
This commit is contained in:
Christian Tzolov
2024-11-20 17:59:39 +01:00
parent d759fb294b
commit 5dbfbf98aa
3 changed files with 21 additions and 2 deletions

View File

@@ -270,7 +270,9 @@ public class MistralAiApi {
SMALL("mistral-small-latest"),
@Deprecated(since = "1.0.0-M1", forRemoval = true) // Mistral will be removing this model - see https://docs.mistral.ai/getting-started/models/models_overview/
MEDIUM("mistral-medium-latest"),
LARGE("mistral-large-latest");
LARGE("mistral-large-latest"),
PIXTRAL("pixtral-12b-2409"),
PIXTRAL_LARGE("pixtral-large-latest");
// @formatter:on
private final String value;

View File

@@ -290,7 +290,9 @@ class MistralAiChatClientIT {
@Test
void validateCallResponseMetadata() {
String model = MistralAiApi.ChatModel.OPEN_MISTRAL_7B.getName();
// String model = MistralAiApi.ChatModel.OPEN_MISTRAL_7B.getName();
String model = MistralAiApi.ChatModel.PIXTRAL.getName();
// String model = MistralAiApi.ChatModel.PIXTRAL_LARGE.getName();
// @formatter:off
ChatResponse response = ChatClient.create(this.chatModel).prompt()
.options(MistralAiChatOptions.builder().withModel(model).build())

View File

@@ -27,6 +27,11 @@ import org.springframework.ai.model.ChatModelDescription;
*/
public enum OllamaModel implements ChatModelDescription {
/**
* Qwen 2.5
*/
QWEN_2_5_7B("qwen2.5"),
/**
* Llama 2 is a collection of language models ranging from 7B to 70B parameters.
*/
@@ -47,6 +52,16 @@ public enum OllamaModel implements ChatModelDescription {
*/
LLAMA3_2("llama3.2"),
/**
* The Llama 3.2 Vision 11B language model from Meta.
*/
LLAMA3_2_VISION_11b("llama3.2-vision"),
/**
* The Llama 3.2 Vision 90B language model from Meta.
*/
LLAMA3_2_VISION_90b("llama3.2-vision:90b"),
/**
* The Llama 3.2 1B language model from Meta.
*/