mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-05 15:20:30 +08:00
feat(go-models): migrate batch 1 model drivers to unified handlers (#17696)
## Summary Relate to #17284 Migrate 10 OpenAI-compatible drivers (`302ai`, `aliyun`, `astraflow`, `avian`, `azure_openai`, `baichuan`, `baidu`, `cometapi`, `deepinfra`, `futurmix`) to use the unified response handlers (`HandleNonStreamingResponse` / `HandleStreamingResponse`), following the same pattern established by `deepseek` in #17634. - Cut ~150 lines per driver (1507 lines removed, 144 added across 10 files). - No functional changes — pure deduplication of HTTP plumbing. - Each driver now routes through `baseModel.doRequest()` and `HandleNonStreamingResponse()`. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -801,7 +801,7 @@ func TestCometAPIEmbedRejectsHTTPError(t *testing.T) {
|
||||
apiKey := "test-key"
|
||||
model := "text-embedding-3-small"
|
||||
_, err := m.Embed(ctx, &model, []string{"a"}, &APIConfig{ApiKey: &apiKey}, nil, nil)
|
||||
if err == nil || !strings.Contains(err.Error(), "CometAPI embeddings API error") {
|
||||
t.Errorf("expected CometAPI embeddings API error, got %v", err)
|
||||
if err == nil || !strings.Contains(err.Error(), "status 401") {
|
||||
t.Errorf("expected embeddings API error for HTTP 401, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user