Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

config(cody): Various fixes and updating the naming rules for ModelConfig resource IDs#63436

Merged
chrsmith merged 5 commits into
mainfrom
chrsmith/modelconfig-v1.1
Jun 24, 2024
Merged

config(cody): Various fixes and updating the naming rules for ModelConfig resource IDs#63436
chrsmith merged 5 commits into
mainfrom
chrsmith/modelconfig-v1.1

Conversation

@chrsmith

Copy link
Copy Markdown
Contributor

The internal/modelconfig package provides the schema by which Sourcegraph instances will keep track of LLM providers, models, and various configuration settings. The cmd/cody-gateway-config tool writes a JSON file contains the model configuration data for Cody Gateway.

This PR fixes an assortment if problems with these components.

d8963da - Due to a logic error, we were saving the model ID of "unknown" into models.json. We now put the actual ModelID from the ModelRef.

d9baa65 - Updates the model information that gets rendered, so that it matches what is hard-coded into the sourcegraph/cody repo. (We were missing any reference to the newly added Google Gemini models.)

c28780c - Relaxes the resource ID regular expression so that it is now legal to add periods. So "gemini-1.5-latest" is now considered a valid ModelID.

... however, the validation checks were incorrectly passing because there was a bug in the regular expression. And after writing some unit tests for the validateModelRef function, I found several other problems with that regular expression 😅 . But we should be much closer to things working as intended now.

Test plan

Added tests

@chrsmith chrsmith requested review from a team, abeatrix and emidoots June 24, 2024 02:03
@cla-bot cla-bot Bot added the cla-signed label Jun 24, 2024

@emidoots emidoots left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@chrsmith chrsmith merged commit 09aefd5 into main Jun 24, 2024
@chrsmith chrsmith deleted the chrsmith/modelconfig-v1.1 branch June 24, 2024 17:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants