|
|
@@ -115,7 +115,7 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
|
|
|
strings.HasPrefix(info.UpstreamModelName, "embedding") ||
|
|
|
strings.HasPrefix(info.UpstreamModelName, "gemini-embedding") {
|
|
|
action := "embedContent"
|
|
|
- if info.IsGeminiBatchEmbdding {
|
|
|
+ if info.IsGeminiBatchEmbedding {
|
|
|
action = "batchEmbedContents"
|
|
|
}
|
|
|
return fmt.Sprintf("%s/%s/models/%s:%s", info.BaseUrl, version, info.UpstreamModelName, action), nil
|
|
|
@@ -199,7 +199,8 @@ func (a *Adaptor) DoRequest(c *gin.Context, info *relaycommon.RelayInfo, request
|
|
|
|
|
|
func (a *Adaptor) DoResponse(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo) (usage any, err *types.NewAPIError) {
|
|
|
if info.RelayMode == constant.RelayModeGemini {
|
|
|
- if strings.Contains(info.RequestURLPath, "embed") {
|
|
|
+ if strings.HasSuffix(info.RequestURLPath, ":embedContent") ||
|
|
|
+ strings.HasSuffix(info.RequestURLPath, ":batchEmbedContents") {
|
|
|
return NativeGeminiEmbeddingHandler(c, resp, info)
|
|
|
}
|
|
|
if info.IsStream {
|