66 "reflect"
77 "strings"
88
9- "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datalayer"
10- "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/plugins "
9+ fwkdl "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/framework/interface /datalayer"
10+ fwkplugin "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/framework/interface/plugin "
1111)
1212
1313const modelsAttributeKey = "/v1/models"
@@ -27,7 +27,7 @@ func (m *ModelInfo) String() string {
2727}
2828
2929// Clone returns a full copy of the object
30- func (m ModelInfoCollection ) Clone () datalayer .Cloneable {
30+ func (m ModelInfoCollection ) Clone () fwkdl .Cloneable {
3131 if m == nil {
3232 return nil
3333 }
@@ -60,21 +60,21 @@ var (
6060
6161// ModelExtractor implements the models extraction.
6262type ModelExtractor struct {
63- typedName plugins .TypedName
63+ typedName fwkplugin .TypedName
6464}
6565
6666// NewModelExtractor returns a new model extractor.
6767func NewModelExtractor () (* ModelExtractor , error ) {
6868 return & ModelExtractor {
69- typedName : plugins .TypedName {
69+ typedName : fwkplugin .TypedName {
7070 Type : ModelsExtractorType ,
7171 Name : ModelsExtractorType ,
7272 },
7373 }, nil
7474}
7575
7676// TypedName returns the type and name of the ModelExtractor.
77- func (me * ModelExtractor ) TypedName () plugins .TypedName {
77+ func (me * ModelExtractor ) TypedName () fwkplugin .TypedName {
7878 return me .typedName
7979}
8080
@@ -85,12 +85,12 @@ func (me *ModelExtractor) ExpectedInputType() reflect.Type {
8585
8686// Extract transforms the data source output into a concrete attribute that
8787// is stored on the given endpoint.
88- func (me * ModelExtractor ) Extract (_ context.Context , data any , ep datalayer .Endpoint ) error {
88+ func (me * ModelExtractor ) Extract (_ context.Context , data any , ep fwkdl .Endpoint ) error {
8989 models , ok := data .(* ModelResponse )
9090 if ! ok {
9191 return fmt .Errorf ("unexpected input in Extract: %T" , data )
9292 }
9393
94- ep .Put (modelsAttributeKey , ModelInfoCollection (models .Data ))
94+ ep .GetAttributes (). Put (modelsAttributeKey , ModelInfoCollection (models .Data ))
9595 return nil
9696}
0 commit comments