cherry-studio/packages/shared/anthropic
Phantom 058a2c763b
fix: restore API version control with trailing # delimiter (addresses #11750) (#11773)
* feat(utils): add isWithTrailingSharp URL helper function

Add new utility function to check if URLs end with trailing '#' character
Includes comprehensive test cases covering various URL patterns and edge cases

* fix(api): check whether to auto append api version or not when formatting api host

- extract api version to variable in GeminiAPIClient for consistency
- simplify getBaseURL in OpenAIBaseClient by removing formatApiHost
- modify provider api host formatting to respect trailing #
- add tests for url parsing with trailing # characters

* fix: update provider config tests for new isWithTrailingSharp function

- Add isWithTrailingSharp to vi.mock in providerConfig tests
- Update test expectations to match new formatApiHost calling behavior
- All tests now pass with the new trailing # delimiter functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(anthropic): prevent duplicate api version in base url

The Anthropic SDK automatically appends /v1 to endpoints, so we need to avoid duplication by removing the version from baseURL and explicitly setting the path in listModels

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-10 13:42:15 +08:00
..
index.ts fix: restore API version control with trailing # delimiter (addresses #11750) (#11773) 2025-12-10 13:42:15 +08:00