Skip to content

Commit

Permalink
#823 - Copilot setting
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Jun 27, 2024
1 parent 38d48b9 commit bd1fc32
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2034,6 +2034,11 @@
"info",
"verbose"
]
},
"frontMatter.copilot.family": {
"type": "string",
"default": "gpt-3.5-turbo",
"markdownDescription": "%setting.frontMatter.copilot.family.markdownDescription%"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,6 @@
"setting.frontMatter.taxonomy.contentTypes.items.properties.isSubContent.description": "Specify if the content type is sub content.",

"setting.frontMatter.git.disableOnBranches.markdownDescription": "Specify the branches on which you want to disable the Git actions. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.disableonbranches) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.disableonbranches%22%5D)",
"setting.frontMatter.git.requiresCommitMessage.markdownDescription": "Specify if you want to require a commit message when publishing your changes for a specified branch. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.requirescommitmessage) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.requirescommitmessage%22%5D)"
"setting.frontMatter.git.requiresCommitMessage.markdownDescription": "Specify if you want to require a commit message when publishing your changes for a specified branch. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.requirescommitmessage) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.requirescommitmessage%22%5D)",
"setting.frontMatter.copilot.family.markdownDescription": "Specify the LLM family of the Copilot you want to use. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.copilot.family) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.copilot.family%22%5D)"
}
2 changes: 2 additions & 0 deletions src/constants/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export const SETTING_SNIPPETS_WRAPPER = 'snippets.wrapper.enabled';

export const SETTING_WEBSITE_URL = 'website.host';

export const SETTING_COPILOT_FAMILY = 'copilot.family';

export const SETTING_LOGGING = 'logging';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/localization/localization.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,7 @@ export enum LocalizationKey {
*/
helpersQuestionsContentTitleAiInputQuickPickAiSeparator = 'helpers.questions.contentTitle.aiInput.quickPick.ai.separator',
/**
* GitHub Copilot generated title
* GitHub Copilot suggestions
*/
helpersQuestionsContentTitleAiInputQuickPickCopilotSeparator = 'helpers.questions.contentTitle.aiInput.quickPick.copilot.separator',
/**
Expand Down
10 changes: 7 additions & 3 deletions src/services/Copilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {
version as VscodeVersion
} from 'vscode';
import { Logger, Settings, TaxonomyHelper } from '../helpers';
import { SETTING_SEO_DESCRIPTION_LENGTH, SETTING_SEO_TITLE_LENGTH } from '../constants';
import {
SETTING_COPILOT_FAMILY,
SETTING_SEO_DESCRIPTION_LENGTH,
SETTING_SEO_TITLE_LENGTH
} from '../constants';
import { TagType } from '../panelWebView/TagType';
import { TaxonomyType } from '../models';

Expand Down Expand Up @@ -198,8 +202,8 @@ export class Copilot {
*/
private static async getModel() {
const [model] = await lm.selectChatModels({
vendor: 'copilot'
// family: 'gpt-4'
vendor: 'copilot',
family: Settings.get<string>(SETTING_COPILOT_FAMILY) || 'gpt-3.5-turbo'
});

return model;
Expand Down

0 comments on commit bd1fc32

Please sign in to comment.