Implemented feedback, removing explict defaults as this comes from package.json

This commit is contained in:
Dave Hogan 2024-09-22 17:32:33 +01:00
parent f2d741d01f
commit 2661f5e8e1
2 changed files with 3 additions and 4 deletions

View file

@ -7,7 +7,7 @@ export type ApiConfig = {
anthropic: {
apikey: string,
model: string,
maxTokens: number
maxTokens: string
},
openai: {
apikey: string
@ -62,12 +62,11 @@ type SendLLMMessageFnTypeExternal = (params: {
// Claude
const sendClaudeMsg: SendLLMMessageFnTypeInternal = ({ messages, onText, onFinalMessage, apiConfig }) => {
const anthropic = new Anthropic({ apiKey: apiConfig.anthropic.apikey, dangerouslyAllowBrowser: true }); // defaults to process.env["ANTHROPIC_API_KEY"]
const stream = anthropic.messages.stream({
model: apiConfig.anthropic.model,
max_tokens: apiConfig.anthropic.maxTokens,
max_tokens: parseInt(apiConfig.anthropic.maxTokens),
messages: messages,
});

View file

@ -16,7 +16,7 @@ const getApiConfig = () => {
anthropic: {
apikey: vscode.workspace.getConfiguration('void').get('anthropicApiKey') ?? '',
model: vscode.workspace.getConfiguration('void').get('anthropicModel') ?? '',
maxTokens: vscode.workspace.getConfiguration('void').get('anthropicMaxToken') ?? 1024,
maxTokens: vscode.workspace.getConfiguration('void').get('anthropicMaxToken') ?? '',
},
openai: { apikey: vscode.workspace.getConfiguration('void').get('openAIApiKey') ?? '' },
greptile: {