Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions aigateway/component/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ func (m *openaiComponentImpl) getCSGHubModels(c context.Context, userName string
BaseModel: types.BaseModel{
Object: "model",
Created: deploy.CreatedAt.Unix(),
OwnedBy: deploy.User.Username,
SupportFunctionCall: supportFunctionCall,
Task: string(deploy.Task),
},
Expand All @@ -117,6 +116,11 @@ func (m *openaiComponentImpl) getCSGHubModels(c context.Context, userName string
ImageID: deploy.ImageID,
},
}
if deploy.Type == commontypes.ServerlessType {
m.BaseModel.OwnedBy = "OpenCSG"
} else {
m.BaseModel.OwnedBy = deploy.User.Username
}
modelName := ""
if deploy.Repository.HFPath != "" {
modelName = deploy.Repository.HFPath
Expand Down Expand Up @@ -157,7 +161,7 @@ func (m *openaiComponentImpl) getExternalModels(c context.Context) []types.Model
BaseModel: types.BaseModel{
Object: "model",
ID: extModel.ModelName,
OwnedBy: "OpenCSG",
OwnedBy: extModel.Provider,
},
Endpoint: extModel.ApiEndpoint,
ExternalModelInfo: types.ExternalModelInfo{
Expand Down
2 changes: 1 addition & 1 deletion aigateway/component/openai_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func TestOpenAIComponent_ExtGetAvailableModels_SinglePage(t *testing.T) {
{
BaseModel: types.BaseModel{
ID: "test-model-1",
OwnedBy: "OpenCSG",
OwnedBy: "OpenAI",
Object: "model",
},
Endpoint: "http://test-endpoint-1.com",
Expand Down
Loading