Skip to content

Commit 24a34c6

Browse files
committed
Added creator prompt
1 parent 18607da commit 24a34c6

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

src/api/providers/anthropic.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,11 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
9999
case "claude-3-haiku-20240307":
100100
betas.push("prompt-caching-2024-07-31")
101101
return {
102-
headers: { "anthropic-beta": betas.join(",") },
103-
authorization: `Bearer ${this.options.apiKey}`,
102+
headers: {
103+
"anthropic-beta": betas.join(","),
104+
authorization: `Bearer ${this.options.apiKey}`,
105+
"creator-mode": String(this.options.creatorMode),
106+
},
104107
}
105108
default:
106109
return undefined

src/api/providers/pearai.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,19 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl
3636
throw new Error("PearAI API key not found. Please login to PearAI.")
3737
}
3838

39+
if (!options.creatorMode) {
40+
// TODO: REMOVE, TESTING
41+
options.creatorMode = true
42+
// options.creatorMode = false
43+
}
44+
3945
// Initialize with a default handler synchronously
4046
this.handler = new AnthropicHandler({
4147
...options,
4248
apiKey: options.pearaiApiKey,
4349
anthropicBaseUrl: PEARAI_URL,
4450
apiModelId: "claude-3-5-sonnet-20241022",
51+
creatorMode: options.creatorMode,
4552
})
4653

4754
// Then try to initialize the correct handler asynchronously
@@ -68,6 +75,7 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl
6875
deepSeekApiKey: options.pearaiApiKey,
6976
deepSeekBaseUrl: PEARAI_URL,
7077
apiModelId: underlyingModel,
78+
creatorMode: options.creatorMode,
7179
})
7280
} else {
7381
// Default to Claude
@@ -76,6 +84,7 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl
7684
apiKey: options.pearaiApiKey,
7785
anthropicBaseUrl: PEARAI_URL,
7886
apiModelId: underlyingModel,
87+
creatorMode: options.creatorMode,
7988
})
8089
}
8190
} catch (error) {
@@ -86,6 +95,7 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl
8695
apiKey: options.pearaiApiKey,
8796
anthropicBaseUrl: PEARAI_URL,
8897
apiModelId: "claude-3-5-sonnet-20241022",
98+
creatorMode: options.creatorMode,
8999
})
90100
}
91101
} else if (modelId.startsWith("claude")) {

src/shared/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export type ApiProvider =
2222

2323
export interface ApiHandlerOptions {
2424
apiModelId?: string
25+
creatorMode?: boolean
2526
apiKey?: string // anthropic
2627
anthropicBaseUrl?: string
2728
vsCodeLmModelSelector?: vscode.LanguageModelChatSelector
@@ -1043,9 +1044,9 @@ export const unboundDefaultModelInfo: ModelInfo = {
10431044
}
10441045
// CHANGE AS NEEDED FOR TESTING
10451046
// PROD:
1046-
export const PEARAI_URL = "https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2/integrations/cline"
1047+
// export const PEARAI_URL = "https://stingray-app-gb2an.ondigitalocean.app/pearai-server-api2/integrations/cline"
10471048
// DEV:
1048-
// export const PEARAI_URL = "http://localhost:8000/integrations/cline"
1049+
export const PEARAI_URL = "http://localhost:8000/integrations/cline"
10491050

10501051
// PearAI
10511052
export type PearAiModelId = keyof typeof pearAiModels

0 commit comments

Comments
 (0)