Skip to content

fix: normalize Gemini PDF URL to prevent /v1beta/v1beta duplication#64

Open
newtontech wants to merge 1 commit intomainfrom
fix/issue-34312
Open

fix: normalize Gemini PDF URL to prevent /v1beta/v1beta duplication#64
newtontech wants to merge 1 commit intomainfrom
fix/issue-34312

Conversation

@newtontech
Copy link
Copy Markdown
Owner

Summary

Fixes URL duplication issue where the Gemini PDF endpoint was constructed as /v1beta/v1beta/models/... when the baseUrl already included /v1beta.

Changes

  • Added normalizeGeminiBaseUrl function to ensure /v1beta is present exactly once in the URL
  • Updated generateGeminiInlineDataText to use the new normalization function
  • Added comprehensive tests for URL construction edge cases
  • Prevents URL duplication when custom baseUrl already includes /v1beta

Testing

  • Added unit tests for normalizeGeminiBaseUrl function
  • Added integration tests for video description with various baseUrl formats
  • Verified URL construction produces correct endpoint: /v1beta/models/{model}:generateContent
  • All existing tests pass

Fixes openclaw#34312

…duplication

Fixes openclaw#34312

- Added normalizeGeminiBaseUrl function to ensure /v1beta is present exactly once
- Updated generateGeminiInlineDataText to use the new normalization function
- Added comprehensive tests for URL construction edge cases
- Prevents URL duplication when baseUrl already includes /v1beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gemini native PDF URL duplication (/v1beta/v1beta) in subagent-registry causes 404

1 participant