switch to claude-sonnet-4-6#1
Open
DanRoscigno wants to merge 1 commit into
Open
Conversation
Signed-off-by: DanRoscigno <dan@roscigno.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR switches the markdown translation backend from Google Gemini to Anthropic Claude (model set to claude-sonnet-4-6), updating the SDK integration, CLI/API key wiring, and documentation accordingly.
Changes:
- Replace
@google/generative-aiusage with@anthropic-ai/sdkand add a sharedcallModel()wrapper for Anthropic Messages API calls. - Update the AST translation pipeline to build separate
{ system, user }prompts and parse Anthropic response payloads. - Update CLI/README/package metadata to reference Anthropic/Claude and
ANTHROPIC_API_KEY.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/translator.js | Swaps Gemini client/model setup for Anthropic client and adds callModel() + Anthropic metadata extraction. |
| src/translator_ast_mvp.js | Updates prompt construction and request/repair flow to use callModel() and Anthropic response parsing. |
| bin/cli.js | Switches env var/help text/error hints from Gemini to Anthropic. |
| README.md | Updates user-facing docs from Gemini to Claude/Anthropic (including ANTHROPIC_API_KEY). |
| package.json | Replaces Gemini dependency/keywords with Anthropic equivalents. |
| package-lock.json | Removes Gemini SDK and adds Anthropic SDK + transitive deps. |
Comments suppressed due to low confidence (1)
src/translator_ast_mvp.js:563
- Same issue as the initial request:
repairResponse.content[0].textassumes a single text block. If the repair response contains multiple blocks, only the first is used and JSON parsing may fail. Extract/concatenate all text blocks fromrepairResponse.contentbefore parsing.
const repairResponse = await this.callModel(repairUser, repairSystem);
const repairMetadata = this.extractChunkMetadata(repairResponse);
const repairText = repairResponse.content[0].text;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+541
to
545
| const { system, user } = this.createAstTranslationPrompt(items, targetLanguage, sourceLanguage); | ||
| const response = await this.callModel(user, system); | ||
| const metadata = this.extractChunkMetadata(response); | ||
| const text = response.content[0].text; | ||
|
|
| "@google/generative-ai": "^0.24.1", | ||
| "@playcanvas/eslint-config": "2.1.0", | ||
| "@anthropic-ai/sdk": "^0.95.2", | ||
| "@playcanvas/eslint-config": "2.1.0", |
| The translator now uses the AST pipeline by default. | ||
|
|
||
| When `--trace` is enabled, the tool logs one JSON trace record per ID and includes the full `sourceText` and `translatedText` values. The only masking applied is replacing any accidental `GEMINI_API_KEY` occurrences with `***`. | ||
| When `--trace` is enabled, the tool logs one JSON trace record per ID and includes the full `sourceText` and `translatedText` values. The only masking applied is replacing any accidental `ANTHROPIC_API_KEY` occurrences with `***`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.