✨ feat(adaptor): refactor response handlers to return usage first and improve error handling

This commit is contained in:
CaIon committed 2025-07-12 21:12:46 +08:00
1 parent 9881bfc3c9
commit 5bf5d3d16a
5 files changed
+28 -28

No files matched your search

+1 -1
View File
@@ -96,7 +96,7 @@ func ollamaEmbeddingHandler(c *gin.Context, info *relaycommon.RelayInfo, resp *h
return nil, types.NewError(err, types.ErrorCodeBadResponseBody)
}
if ollamaEmbeddingResponse.Error != "" {
return nil, types.NewError(err, types.ErrorCodeBadResponseBody)
return nil, types.NewError(fmt.Errorf("ollama error: %s", ollamaEmbeddingResponse.Error), types.ErrorCodeBadResponseBody)
}
flattenedEmbeddings := flattenEmbeddings(ollamaEmbeddingResponse.Embedding)
data := make([]dto.OpenAIEmbeddingResponseItem, 0, 1)