Skip to content

Commit

Permalink
fix(openAi): GPT4o-mini is missing from OpenAI model list
Browse files Browse the repository at this point in the history
When deserializing existing OpenAiClientSharedState new model IDs from enum are not added.

Closes #214
  • Loading branch information
Blarc committed Jul 31, 2024
1 parent 33f9ebc commit f99f369
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed

- GPT4o-mini is missing from OpenAI model list.

## [2.1.0] - 2024-07-19

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.github.blarc.ai.commits.intellij.plugin.settings.clients.openAi

import com.github.blarc.ai.commits.intellij.plugin.settings.clients.LLMClientSharedState
import com.intellij.openapi.components.*
import com.intellij.util.xmlb.XmlSerializerUtil
import com.intellij.util.xmlb.annotations.XCollection
import dev.langchain4j.model.openai.OpenAiChatModelName

Expand All @@ -27,6 +26,8 @@ class OpenAiClientSharedState : PersistentStateComponent<OpenAiClientSharedState
override fun getState(): OpenAiClientSharedState = this

override fun loadState(state: OpenAiClientSharedState) {
XmlSerializerUtil.copyBean(state, this)
// Add all model IDs from enum in case they are not stored in xml
modelIds += state.modelIds
hosts += state.hosts
}
}

0 comments on commit f99f369

Please sign in to comment.