-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(chore): Adding tags and usage for LLM Models #1894
Changes from 1 commit
57bc481
0742e7e
fb59ec8
7264e72
24b7a72
dd26937
0c63ea5
413bf44
dec0c16
ffe710b
986cc76
2a92540
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,18 @@ class LLMState : BaseState() { | |
|
||
@get:OptionTag(tag = "provider", nameAttribute = "") var provider: String? by string() | ||
|
||
@get:OptionTag(tag = "tags", nameAttribute = "") var tags: MutableList<String> by list() | ||
|
||
@get:OptionTag(tag = "usage", nameAttribute = "") var usage: MutableList<String> by list() | ||
|
||
Comment on lines
+16
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know the implications of this. Where is it getting this state from? Is this going to break immediately? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is state saved in a IntelliJ xml settings files. In practice you will most likely have to:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright. I created There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! It looks good to me now, I just added one question about the |
||
companion object { | ||
fun fromChatModel(chatModelProvider: ChatModelsResponse.ChatModelProvider): LLMState { | ||
return LLMState().also { | ||
it.model = chatModelProvider.model | ||
it.title = chatModelProvider.title | ||
it.provider = chatModelProvider.provider | ||
it.tags = chatModelProvider.tags | ||
it.usage = chatModelProvider.usage | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,11 @@ class SettingsMigrationTest : BasePlatformTestCase() { | |
it.defaultLlm = | ||
LLMState.fromChatModel( | ||
ChatModelsResponse.ChatModelProvider( | ||
true, false, "Cyberdyne", "Terminator", "T-800")) | ||
"Cyberdyne", | ||
"Terminator", | ||
"T-800", | ||
mutableListOf("pro"), | ||
mutableListOf("chat", "edit"))) | ||
it.defaultEnhancedContext = | ||
EnhancedContextState().also { | ||
it.isEnabled = true | ||
|
@@ -144,7 +148,11 @@ class SettingsMigrationTest : BasePlatformTestCase() { | |
it.llm = | ||
LLMState.fromChatModel( | ||
ChatModelsResponse.ChatModelProvider( | ||
false, true, "Uni of IL", "HAL", "HAL 9000")) | ||
"Uni of IL", | ||
"HAL", | ||
"HAL 9000", | ||
mutableListOf("pro"), | ||
mutableListOf("chat", "edit"))) | ||
it.messages = | ||
mutableListOf( | ||
MessageState().also { | ||
|
@@ -190,22 +198,20 @@ class SettingsMigrationTest : BasePlatformTestCase() { | |
fun `test DeprecatedChatLlmMigration`() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is incorrect I think. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. I reverted those changes and added a new test for my migration. |
||
fun createLlmModel( | ||
version: String, | ||
isDefault: Boolean, | ||
isDeprecated: Boolean | ||
tags: List<String>, | ||
): ChatModelsResponse.ChatModelProvider { | ||
return ChatModelsResponse.ChatModelProvider( | ||
isDefault, | ||
false, | ||
"Anthropic", | ||
"Claude $version", | ||
"anthropic/claude-$version", | ||
isDeprecated) | ||
tags.toMutableList(), | ||
mutableListOf("chat", "edit")) | ||
} | ||
|
||
val claude20 = createLlmModel("2.0", isDefault = false, isDeprecated = true) | ||
val claude21 = createLlmModel("2.1", isDefault = false, isDeprecated = true) | ||
val claude30 = createLlmModel("3.0", isDefault = true, isDeprecated = false) | ||
val models = listOf(claude20, claude21, claude30) | ||
val claude20 = createLlmModel("2.0", listOf("deprecated")) | ||
val claude21 = createLlmModel("2.1", listOf("deprecated")) | ||
val claude30 = createLlmModel("3.0", listOf()) | ||
val models = listOf(claude30, claude20, claude21) | ||
|
||
val accountData = | ||
mutableListOf( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jamesmcnamara
isVisible = true
always.enterprise
tag present, shouldn't we filter out LLMs displayed for enterprise users based on if that tag is present? Or maybe for an enterprise account we are guaranteed to get a correct list?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed first change to your branch already.
I'm not sure if we need the second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this because we don't want it to be visible for enterprise users that don't have multiple models enabled. However I'm still struggling with the integration tests failing and I'm not sure how to debug them. Do you know any good tricks for figuring out why they keep timing out? I tried opening the IDE to the test file and trying the document code action but it seemed to work fine.
To your second point, I think the current idea is that an enterprise user can use any model that the server provided (but most likely they will all be enterprise models).
Also, unrelated, but do you know how to access the generated kotlin code from the Cody repo? I don't see it referenced anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem with integration tests was that updated recordings were missing (requires run of the
./gradlew :recordingIntegrationTest
). I updated them.Interestingly it seems we were not reporting that fact properly, I will make sure we fixed that.
Right now they are just working as a manual reference, BUT it will change very soon as there is @RXminuS PR in flight which adress that.