Commit c5dff26d by tbphp

fix: Vertex channel global region format

parent 7c34c010
...@@ -95,14 +95,23 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) { ...@@ -95,14 +95,23 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
} else { } else {
suffix = "generateContent" suffix = "generateContent"
} }
return fmt.Sprintf( if region == "global" {
"https://%s-aiplatform.googleapis.com/v1/projects/%s/locations/%s/publishers/google/models/%s:%s", return fmt.Sprintf(
region, "https://aiplatform.googleapis.com/v1/projects/%s/locations/global/publishers/google/models/%s:%s",
adc.ProjectID, adc.ProjectID,
region, info.UpstreamModelName,
info.UpstreamModelName, suffix,
suffix, ), nil
), nil } else {
return fmt.Sprintf(
"https://%s-aiplatform.googleapis.com/v1/projects/%s/locations/%s/publishers/google/models/%s:%s",
region,
adc.ProjectID,
region,
info.UpstreamModelName,
suffix,
), nil
}
} else if a.RequestMode == RequestModeClaude { } else if a.RequestMode == RequestModeClaude {
if info.IsStream { if info.IsStream {
suffix = "streamRawPredict?alt=sse" suffix = "streamRawPredict?alt=sse"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment