Merge pull request #2817 from sususu98/fix/antigravity-strip-billing-header
fix(antigravity): strip billing header from system instruction before upstream call
This commit is contained in:
@@ -101,6 +101,9 @@ func ConvertClaudeRequestToAntigravity(modelName string, inputRawJSON []byte, _
|
|||||||
systemTypePromptResult := systemPromptResult.Get("type")
|
systemTypePromptResult := systemPromptResult.Get("type")
|
||||||
if systemTypePromptResult.Type == gjson.String && systemTypePromptResult.String() == "text" {
|
if systemTypePromptResult.Type == gjson.String && systemTypePromptResult.String() == "text" {
|
||||||
systemPrompt := systemPromptResult.Get("text").String()
|
systemPrompt := systemPromptResult.Get("text").String()
|
||||||
|
if strings.HasPrefix(systemPrompt, "x-anthropic-billing-header:") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
partJSON := []byte(`{}`)
|
partJSON := []byte(`{}`)
|
||||||
if systemPrompt != "" {
|
if systemPrompt != "" {
|
||||||
partJSON, _ = sjson.SetBytes(partJSON, "text", systemPrompt)
|
partJSON, _ = sjson.SetBytes(partJSON, "text", systemPrompt)
|
||||||
|
|||||||
Reference in New Issue
Block a user