Enhances plugin architecture and fixes issues #1

Merged
AlexKucera merged 7 commits from coderabbit_fixes into master 2025-09-26 14:21:24 +02:00
2 changed files with 12 additions and 6 deletions
Showing only changes of commit 565cddf86c - Show all commits

No files matched your search

+4 -4
View File
@@ -69,8 +69,8 @@ You MUST use exactly these markers. Do not deviate from this format.`;
const request: AnthropicRequest = { const request: AnthropicRequest = {
model, model,
max_tokens: ANTHROPIC_LIMITS.DEFAULT_MAX_OUTPUT_TOKENS, max_tokens: ANTHROPIC_LIMITS.DEFAULT_MAX_OUTPUT_TOKENS,
messages: [{ role: 'user', content: userMessage }], messages: [{ role: 'user', content: [{ type: 'text', text: userMessage }] }],
system: systemPrompt system: [{ type: 'text', text: systemPrompt }]
}; };
const response = await this.makeRequestWithRetry(request); const response = await this.makeRequestWithRetry(request);
@@ -100,8 +100,8 @@ You MUST use exactly these markers. Do not deviate from this format.`;
const testRequest: AnthropicRequest = { const testRequest: AnthropicRequest = {
model, model,
max_tokens: 50, max_tokens: 50,
messages: [{ role: 'user', content: 'Hello! Please respond with just "Test successful."' }], messages: [{ role: 'user', content: [{ type: 'text', text: 'Hello! Please respond with just "Test successful."' }] }],
system: 'You are a test assistant. Respond only with "Test successful." and nothing else.' system: [{ type: 'text', text: 'You are a test assistant. Respond only with "Test successful." and nothing else.' }]
}; };
try { try {
+8 -2
View File
@@ -12,14 +12,20 @@ export interface FreewritingCleanupSettings {
export interface AnthropicMessage { export interface AnthropicMessage {
role: 'user' | 'assistant' | 'system'; role: 'user' | 'assistant' | 'system';
content: string; content: Array<{
type: string;
text: string;
}>;
} }
export interface AnthropicRequest { export interface AnthropicRequest {
model: string; model: string;
max_tokens: number; max_tokens: number;
messages: AnthropicMessage[]; messages: AnthropicMessage[];
system?: string; system?: Array<{
type: string;
text: string;
}>;
} }
export interface AnthropicResponse { export interface AnthropicResponse {