@@ -24,9 +24,11 @@ import (
2424
2525// Model represents a LLM model accessed via a provider.
2626type Model struct {
27+ // id holds the full identifier, including the provider and attributes.
28+ id string
2729 // provider is the client to query the LLM model.
2830 provider provider.Query
29- // modelID holds the identifier for the LLM modelID .
31+ // modelID holds the identifier for the LLM model .
3032 modelID string
3133
3234 // attributes holds query attributes.
@@ -41,6 +43,7 @@ type Model struct {
4143// NewModel returns an LLM model corresponding to the given identifier which is queried via the given provider.
4244func NewModel (provider provider.Query , modelIDWithAttributes string ) (llmModel * Model ) {
4345 llmModel = & Model {
46+ id : modelIDWithAttributes ,
4447 provider : provider ,
4548
4649 queryAttempts : 1 ,
@@ -53,6 +56,7 @@ func NewModel(provider provider.Query, modelIDWithAttributes string) (llmModel *
5356// NewModelWithMetaInformation returns a LLM model with meta information corresponding to the given identifier which is queried via the given provider.
5457func NewModelWithMetaInformation (provider provider.Query , modelIdentifier string , metaInformation * model.MetaInformation ) * Model {
5558 return & Model {
59+ id : modelIdentifier ,
5660 provider : provider ,
5761 modelID : modelIdentifier ,
5862
@@ -62,6 +66,18 @@ func NewModelWithMetaInformation(provider provider.Query, modelIdentifier string
6266 }
6367}
6468
69+ var _ model.Model = (* Model )(nil )
70+
71+ // ID returns full identifier, including the provider and attributes.
72+ func (m * Model ) ID () (id string ) {
73+ return m .id
74+ }
75+
76+ // ModelID returns the unique identifier of this model.
77+ func (m * Model ) ModelID () (modelID string ) {
78+ return m .modelID
79+ }
80+
6581// Attributes returns query attributes.
6682func (m * Model ) Attributes () (attributes map [string ]string ) {
6783 return m .attributes
@@ -241,13 +257,6 @@ func (ctx *llmMigrateSourceFilePromptContext) Format() (message string, err erro
241257 return b .String (), nil
242258}
243259
244- var _ model.Model = (* Model )(nil )
245-
246- // ID returns the unique ID of this model.
247- func (m * Model ) ID () (id string ) {
248- return m .modelID
249- }
250-
251260var _ model.CapabilityWriteTests = (* Model )(nil )
252261
253262// WriteTests generates test files for the given implementation file in a repository.
0 commit comments