mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-11-12 04:07:25 +00:00
revert(gateway): 还原 discover.go 的空白重排(非本次改动)
我此前对 internal/gateway/ 跑了整目录 gofmt -w,它把 discover.go 里 注释对齐重排了(upstreamModel 的 struct tag 列、copyFields 的行内注释)。 那不是本次任务的改动,且会破坏变异测试 harness 的文本锚点 —— discover_mutate_test.go 按精确文本做变异注入,锚点对不上就直接判定 "这个变异会是 no-op" 并中止整套 harness。 教训:整目录 gofmt 会在你没打算改的文件上产生 diff。先还原。
This commit is contained in:
@ -535,11 +535,11 @@ type modelCaps struct {
|
||||
}
|
||||
|
||||
type upstreamModel struct {
|
||||
ID string `json:"id"`
|
||||
Object string `json:"object"`
|
||||
Kind string `json:"kind"`
|
||||
Type string `json:"type"`
|
||||
Modality string `json:"modality"`
|
||||
ID string `json:"id"`
|
||||
Object string `json:"object"`
|
||||
Kind string `json:"kind"`
|
||||
Type string `json:"type"`
|
||||
Modality string `json:"modality"`
|
||||
Architecture struct {
|
||||
InputModalities []string `json:"input_modalities"`
|
||||
OutputModalities []string `json:"output_modalities"`
|
||||
@ -699,8 +699,8 @@ func modelMeta(m upstreamModel) map[string]interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
copyFields(m.Metadata) // nested first
|
||||
copyFields(mustJSON(m)) // top level wins
|
||||
copyFields(m.Metadata) // nested first
|
||||
copyFields(mustJSON(m)) // top level wins
|
||||
if len(meta) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user