fix: anthropic messages validation, stream mapping, client error parsing, and add Cloudflare Workers deployment workflow
- Fix type mappings in OpenAIRequest and BackendConfig to handle structured message parts (cache-control). - Stop adaptRequest crashing when message contents are objects or arrays. - Forward stream, top_k, and stop_sequences to adaptRequest. - Forward anthropic-version header to backend endpoints during adaptation. - Parse structured JSON error payloads from upstream before returning generic "Upstream rejected request" error. - Create .github/workflows/cloudflare.yml to auto-deploy on master branch pushes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
e58a3ddaf8
commit
2171a01974
@@ -0,0 +1,32 @@
|
||||
name: Deploy to Cloudflare Workers
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to Cloudflare Workers
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install Dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Run Tests
|
||||
run: bun test
|
||||
|
||||
- name: Deploy Worker
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
command: deploy
|
||||
Reference in New Issue
Block a user