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

Add ModelRef.APIVersionID()#63643

Merged
chrsmith merged 1 commit into
mainfrom
chrsmith/add-apiversionid-method
Jul 4, 2024
Merged

Add ModelRef.APIVersionID()#63643
chrsmith merged 1 commit into
mainfrom
chrsmith/add-apiversionid-method

Conversation

@chrsmith

@chrsmith chrsmith commented Jul 4, 2024

Copy link
Copy Markdown
Contributor

The ModelRef encodes three pieces of information to represent the unique identity of the model. So far, we've only needed to pull out the ProviderID and ModelID. But now that I'm working on reading this data for the completion APIs, it's time to add the APIVersionID function too.

Note that these functions should really return an (string, error) since it's possible the ModelRef they are operating on is invalid. But as-is things will explode loudly enough it won't be too difficult to detect, and leaving the function return type as string makes it much easier to use.

I also added a comment about something I'll address when I get to adding support for fetching new models dynamically from Cody Gateway. Right now there is a validation check that probably should exist but doesn't, and we cannot add it just yet.

Test plan

Added unit tests.

Changelog

NA

@chrsmith chrsmith requested a review from emidoots July 4, 2024 19:19
@cla-bot cla-bot Bot added the cla-signed label Jul 4, 2024
@chrsmith chrsmith merged commit 3e1c8fc into main Jul 4, 2024
@chrsmith chrsmith deleted the chrsmith/add-apiversionid-method branch July 4, 2024 20:13
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