File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
application/core/ollama/src/commonMain/kotlin/io/writeopia/persistence Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ interface OllamaDao {
77
88 suspend fun getConfiguration (id : String = "disconnected_user"): OllamaConfig ?
99
10- suspend fun saveConfiguration (ollamaConfig : OllamaConfig )
10+ suspend fun saveConfiguration (id : String , ollamaConfig : OllamaConfig )
1111
1212 fun listenForConfiguration (id : String = "disconnected_user"): StateFlow <OllamaConfig ?>
1313
Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ class OllamaSqlDao(private val ollamaQueries: OllamaEntityQueries?) : OllamaDao
1111
1212 override suspend fun getConfiguration (id : String ): OllamaConfig ? =
1313 ollamaQueries?.query(id)?.executeAsOneOrNull()?.let { entity ->
14- OllamaConfig (url = entity.url ? : " " , selectedModel = entity.selected_model ? : " " )
14+ OllamaConfig (url = entity.url, selectedModel = entity.selected_model ? : " " )
1515 }
1616
17- override suspend fun saveConfiguration (ollamaConfig : OllamaConfig ) {
17+ override suspend fun saveConfiguration (id : String , ollamaConfig : OllamaConfig ) {
1818 ollamaQueries?.insert(
19- id = " disconnected_user " ,
19+ id = id ,
2020 url = ollamaConfig.url,
2121 selected_model = ollamaConfig.selectedModel
2222 )
@@ -28,7 +28,7 @@ class OllamaSqlDao(private val ollamaQueries: OllamaEntityQueries?) : OllamaDao
2828 ) {
2929 val config = getConfiguration(id) ? : OllamaConfig ()
3030
31- saveConfiguration(ollamaConfigFn(config))
31+ saveConfiguration(id, ollamaConfigFn(config))
3232 }
3333
3434 override fun listenForConfiguration (id : String ): StateFlow <OllamaConfig ?> {
You can’t perform that action at this time.
0 commit comments