-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev ai #264
base: dev
Are you sure you want to change the base?
Conversation
… `TextDeepSeekModel`
Reviewer's Guide by SourceryThis pull request introduces the ability to configure the AI text model used by the application. It also adds support for the DeepSeek model. Class diagram for AI text service changesclassDiagram
class IAITextService {
<<interface>>
+init(IAITextModelOpts)
}
class MainAITextService {
-_modelType: TextModelType
+init(IAITextModelOpts)
-createModel()
}
class TextModelType {
<<enumeration>>
GPT
DeepSeek
}
MainAITextService ..|> IAITextService
note for MainAITextService "Added DeepSeek model support"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Bistard - I've reviewed your changes - here's some feedback:
Overall Comments:
- The MainAITextService returns GPTModel for both TextModelType.GPT and TextModelType.DeepSeek. If DeepSeek should have different behavior, it needs its own model implementation.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -53,6 +50,9 @@ export class MainAITextService extends Disposable implements IAITextService { | |||
switch (this._modelType) { | |||
case TextModelType.GPT: | |||
return new GPTModel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): DeepSeek model type falls back to GPTModel without warning
This could cause unexpected behavior as users expecting DeepSeek will silently get GPT instead. Consider implementing DeepSeek model or throwing an error if not yet supported.
@@ -145,7 +145,7 @@ interface IJsonSchemaForString extends IJsonSchemaBase<'string'> { | |||
/** The maximum length of the string. */ | |||
maxLength?: number; | |||
|
|||
/** The predefined format of the string. Example: 'email', 'phone number', 'post address' etc. */ | |||
/** The predefined format of the string (written Regular Expression). Example: 'email', 'phone number', 'post address' etc. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (typo): Incorrect documentation for JSON Schema format field
The format field in JSON Schema is for predefined format identifiers (like 'date-time', 'email', 'uri'), not for regular expressions. The pattern field is used for regex patterns.
/** The predefined format of the string (written Regular Expression). Example: 'email', 'phone number', 'post address' etc. */ | |
/** The predefined format identifier as defined by JSON Schema. Example: 'date-time', 'email', 'uri', 'hostname' etc. */ |
@@ -1,4 +1,5 @@ | |||
import { CollapseState } from "src/base/browser/basic/dom"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider simplifying the configuration registration by creating a helper function to reduce boilerplate and improve maintainability.
The configuration registration can be simplified by introducing a helper function while maintaining separation of concerns. For example:
// Helper function
function registerConfigSection<T extends string>(
sectionName: string,
properties: Record<string, {
type: string,
default: T,
enum?: T[]
}>
) {
return createRegister(
RegistrantType.Configuration,
sectionName,
(registrant) => {
registrant.registerConfigurations({
id: sectionName,
properties: {
[sectionName]: {
type: 'object',
properties
}
}
});
}
);
}
// Usage for AI config
export const sharedApplicationConfigurationRegister = registerConfigSection(
'ai',
{
textModel: {
type: 'string',
default: TextModelType.DeepSeek,
enum: [TextModelType.DeepSeek, TextModelType.GPT]
}
}
);
This approach:
- Reduces boilerplate while keeping configurations separate
- Makes adding new configuration sections more concise
- Maintains type safety
- Preserves the existing functionality
Summary by Sourcery
Add support for configurable AI text models.
New Features:
Tests: