Logo
Explore Help
Register Sign In
zlei6/ragflow
1
0
Fork 0
You've already forked ragflow
mirror of https://github.com/infiniflow/ragflow.git synced 2026-07-16 04:37:21 +08:00
Code Issues Packages Projects Releases Wiki Activity
Files
139f4515e8a9e9dcb250df5ea27bd3d23a39e708
ragflow/internal/entity/models/model_test_helpers_test.go

17 lines
337 B
Go
Raw Normal View History

refactor(go-models): add unsupported model driver defaults (#15431) ### What problem does this PR solve? Adds a shared safe default implementation for unsupported Go model-driver capability methods and migrates the confirmed panic-stub providers to use it. The Go `ModelDriver` interface requires providers to implement many capability methods even when the provider does not support them. XunFei had unsupported capability methods implemented as `panic("implement me")`, Mistral still had a panic in `ParseFile`, and HuaweiCloud carried an unreachable `panic("implement me")` after a normal chat return. ### Type of change - [x] Refactoring Co-authored-by: Haruko386 <tryeverypossible@163.com>
2026-06-03 08:16:28 -03:00
package models
import (
"strings"
"testing"
)
func requireNoSuchMethod(t *testing.T, name string, err error) {
t.Helper()
if err == nil {
t.Fatalf("%s: expected no such method error, got nil", name)
}
if !strings.Contains(err.Error(), "no such method") {
t.Fatalf("%s: expected no such method error, got %v", name, err)
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.5 Page: 635ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API