Skip to content

Commit c87fb06

Browse files
committed
Merge branch 'dev' into pr/cline/2014
2 parents d7e9ead + eedae08 commit c87fb06

File tree

11 files changed

+42
-27
lines changed

11 files changed

+42
-27
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
Update anthropic SDK to the latest version

docs/PRIVACY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
View our provacy policy on our website.
1+
View our Privacy Policy on our website.
22

3-
(Privacy Policy)[https://cline.bot/privacy]
3+
[Privacy Policy](https://cline.bot/privacy)

docs/TERMS_OF_SERVICE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
View our Terms of Service on our website.
22

3-
(Terms of Service)[https://cline.bot/tos]
3+
[Terms of Service](https://cline.bot/tos)

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,10 @@
262262
"typescript": "^5.4.5"
263263
},
264264
"dependencies": {
265-
"@anthropic-ai/vertex-sdk": "^0.6.4",
266265
"@anthropic-ai/bedrock-sdk": "^0.12.4",
267-
"@anthropic-ai/sdk": "^0.36.3",
266+
"@anthropic-ai/sdk": "^0.37.0",
267+
"@anthropic-ai/vertex-sdk": "^0.6.4",
268+
"@google/generative-ai": "^0.18.0",
268269
"@mistralai/mistralai": "^1.5.0",
269270
"@modelcontextprotocol/sdk": "^1.0.1",
270271
"@types/clone-deep": "^4.0.4",

src/api/transform/gemini-format.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,7 @@ import {
1111
TextPart,
1212
} from "@google/generative-ai"
1313

14-
export function convertAnthropicContentToGemini(
15-
content:
16-
| string
17-
| Array<
18-
| Anthropic.Messages.TextBlockParam
19-
| Anthropic.Messages.ImageBlockParam
20-
| Anthropic.Messages.ToolUseBlockParam
21-
| Anthropic.Messages.ToolResultBlockParam
22-
>,
23-
): Part[] {
14+
export function convertAnthropicContentToGemini(content: string | Anthropic.ContentBlockParam[]): Part[] {
2415
if (typeof content === "string") {
2516
return [{ text: content } as TextPart]
2617
}
@@ -133,7 +124,7 @@ export function convertGeminiResponseToAnthropic(response: EnhancedGenerateConte
133124
// Add the main text response
134125
const text = response.text()
135126
if (text) {
136-
content.push({ type: "text", text })
127+
content.push({ type: "text", text, citations: null })
137128
}
138129

139130
// Add function calls as tool_use blocks
@@ -183,6 +174,8 @@ export function convertGeminiResponseToAnthropic(response: EnhancedGenerateConte
183174
usage: {
184175
input_tokens: response.usageMetadata?.promptTokenCount ?? 0,
185176
output_tokens: response.usageMetadata?.candidatesTokenCount ?? 0,
177+
cache_creation_input_tokens: null,
178+
cache_read_input_tokens: null,
186179
},
187180
}
188181
}

src/api/transform/o1-format.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ export function convertO1ResponseToAnthropicMessage(
376376
{
377377
type: "text",
378378
text: normalText,
379+
citations: null,
379380
},
380381
],
381382
model: completion.model,
@@ -396,6 +397,8 @@ export function convertO1ResponseToAnthropicMessage(
396397
usage: {
397398
input_tokens: completion.usage?.prompt_tokens || 0,
398399
output_tokens: completion.usage?.completion_tokens || 0,
400+
cache_creation_input_tokens: null,
401+
cache_read_input_tokens: null,
399402
},
400403
}
401404

src/api/transform/openai-format.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export function convertToAnthropicMessage(completion: OpenAI.Chat.Completions.Ch
161161
{
162162
type: "text",
163163
text: openAiMessage.content || "",
164+
citations: null,
164165
},
165166
],
166167
model: completion.model,
@@ -181,6 +182,8 @@ export function convertToAnthropicMessage(completion: OpenAI.Chat.Completions.Ch
181182
usage: {
182183
input_tokens: completion.usage?.prompt_tokens || 0,
183184
output_tokens: completion.usage?.completion_tokens || 0,
185+
cache_creation_input_tokens: null,
186+
cache_read_input_tokens: null,
184187
},
185188
}
186189

src/api/transform/vscode-lm-format.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ export async function convertToAnthropicMessage(
175175
return {
176176
type: "text",
177177
text: part.value,
178+
citations: null,
178179
}
179180
}
180181

@@ -195,6 +196,8 @@ export async function convertToAnthropicMessage(
195196
usage: {
196197
input_tokens: 0,
197198
output_tokens: 0,
199+
cache_creation_input_tokens: null,
200+
cache_read_input_tokens: null,
198201
},
199202
}
200203
}

src/core/Cline.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ import { telemetryService } from "../services/telemetry/TelemetryService"
6565
const cwd = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? path.join(os.homedir(), "Desktop") // may or may not exist but fs checking existence would immediately ask for permission which would be bad UX, need to come up with a better solution
6666

6767
type ToolResponse = string | Array<Anthropic.TextBlockParam | Anthropic.ImageBlockParam>
68-
type UserContent = Array<
69-
Anthropic.TextBlockParam | Anthropic.ImageBlockParam | Anthropic.ToolUseBlockParam | Anthropic.ToolResultBlockParam
70-
>
68+
type UserContent = Array<Anthropic.ContentBlockParam>
7169

7270
export class Cline {
7371
readonly taskId: string

0 commit comments

Comments
 (0)