cline-sdk
Version:
Comprehensive SDK for Cline - AI-powered development assistant with database integration, execution modes, and custom functions
59 lines • 1.64 kB
TypeScript
/**
* Anthropic API Client for Cline SDK
* Handles real Claude API calls with tool usage
*/
import { ClineConfig } from "../config/cline-config";
export interface AnthropicMessage {
role: "user" | "assistant";
content: string | Array<{
type: "text" | "image" | "tool_use" | "tool_result";
text?: string;
source?: any;
tool_use_id?: string;
name?: string;
input?: any;
content?: string;
is_error?: boolean;
}>;
}
export interface AnthropicResponse {
content: Array<{
type: "text" | "tool_use";
text?: string;
name?: string;
input?: any;
id?: string;
}>;
usage: {
input_tokens: number;
output_tokens: number;
};
}
export interface ToolDefinition {
name: string;
description: string;
inputSchema: any;
}
export declare class AnthropicClient {
private apiKey;
private model;
private baseUrl;
private config;
constructor(config: ClineConfig);
sendMessage(messages: AnthropicMessage[], tools: ToolDefinition[], systemPrompt?: string): Promise<AnthropicResponse>;
private formatMessages;
private getDefaultSystemPrompt;
static createToolUseContent(toolName: string, input: any, toolUseId: string): {
type: "tool_use";
name: string;
input: any;
id: string;
};
static createToolResultContent(toolUseId: string, result: any, isError?: boolean): {
type: "tool_result";
tool_use_id: string;
content: string;
is_error: boolean;
};
}
//# sourceMappingURL=anthropic-client.d.ts.map