mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-01-06 00:49:15 +00:00
Compare commits
5 Commits
v0.1.0
...
chore/topp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5854ac67c6 | ||
|
|
354c85bcff | ||
|
|
7ccba75621 | ||
|
|
e0e5fa5084 | ||
|
|
65cf80f4ab |
12
package-lock.json
generated
12
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@qwen-code/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@qwen-code/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
@@ -16024,7 +16024,7 @@
|
|||||||
},
|
},
|
||||||
"packages/cli": {
|
"packages/cli": {
|
||||||
"name": "@qwen-code/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "1.16.0",
|
"@google/genai": "1.16.0",
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
@@ -16139,7 +16139,7 @@
|
|||||||
},
|
},
|
||||||
"packages/core": {
|
"packages/core": {
|
||||||
"name": "@qwen-code/qwen-code-core",
|
"name": "@qwen-code/qwen-code-core",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "1.16.0",
|
"@google/genai": "1.16.0",
|
||||||
@@ -16278,7 +16278,7 @@
|
|||||||
},
|
},
|
||||||
"packages/test-utils": {
|
"packages/test-utils": {
|
||||||
"name": "@qwen-code/qwen-code-test-utils",
|
"name": "@qwen-code/qwen-code-test-utils",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -16290,7 +16290,7 @@
|
|||||||
},
|
},
|
||||||
"packages/vscode-ide-companion": {
|
"packages/vscode-ide-companion": {
|
||||||
"name": "qwen-code-vscode-ide-companion",
|
"name": "qwen-code-vscode-ide-companion",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"license": "LICENSE",
|
"license": "LICENSE",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.15.1",
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@qwen-code/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
},
|
},
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"url": "git+https://github.com/QwenLM/qwen-code.git"
|
"url": "git+https://github.com/QwenLM/qwen-code.git"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.0"
|
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cross-env node scripts/start.js",
|
"start": "cross-env node scripts/start.js",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@qwen-code/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Qwen Code",
|
"description": "Qwen Code",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.0"
|
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "1.16.0",
|
"@google/genai": "1.16.0",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
ContentGeneratorConfig,
|
||||||
FileFilteringOptions,
|
FileFilteringOptions,
|
||||||
MCPServerConfig,
|
MCPServerConfig,
|
||||||
OutputFormat,
|
OutputFormat,
|
||||||
@@ -123,6 +124,24 @@ export interface CliArgs {
|
|||||||
outputFormat: string | undefined;
|
outputFormat: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LegacySamplingSettings = {
|
||||||
|
sampling_params?: ContentGeneratorConfig['samplingParams'];
|
||||||
|
};
|
||||||
|
|
||||||
|
function getLegacySamplingParams(
|
||||||
|
settings: Settings,
|
||||||
|
): ContentGeneratorConfig['samplingParams'] | undefined {
|
||||||
|
if (
|
||||||
|
typeof settings !== 'object' ||
|
||||||
|
settings === null ||
|
||||||
|
!('sampling_params' in (settings as Record<string, unknown>))
|
||||||
|
) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (settings as Settings & LegacySamplingSettings).sampling_params;
|
||||||
|
}
|
||||||
|
|
||||||
export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
||||||
const rawArgv = hideBin(process.argv);
|
const rawArgv = hideBin(process.argv);
|
||||||
const yargsInstance = yargs(rawArgv)
|
const yargsInstance = yargs(rawArgv)
|
||||||
@@ -685,6 +704,7 @@ export async function loadCliConfig(
|
|||||||
|
|
||||||
const vlmSwitchMode =
|
const vlmSwitchMode =
|
||||||
argv.vlmSwitchMode || settings.experimental?.vlmSwitchMode;
|
argv.vlmSwitchMode || settings.experimental?.vlmSwitchMode;
|
||||||
|
const legacySamplingParams = getLegacySamplingParams(settings);
|
||||||
return new Config({
|
return new Config({
|
||||||
sessionId,
|
sessionId,
|
||||||
embeddingModel: DEFAULT_QWEN_EMBEDDING_MODEL,
|
embeddingModel: DEFAULT_QWEN_EMBEDDING_MODEL,
|
||||||
@@ -745,6 +765,8 @@ export async function loadCliConfig(
|
|||||||
(typeof argv.openaiLogging === 'undefined'
|
(typeof argv.openaiLogging === 'undefined'
|
||||||
? settings.model?.enableOpenAILogging
|
? settings.model?.enableOpenAILogging
|
||||||
: argv.openaiLogging) ?? false,
|
: argv.openaiLogging) ?? false,
|
||||||
|
// Include sampling_params from root level settings
|
||||||
|
...(legacySamplingParams ? { samplingParams: legacySamplingParams } : {}),
|
||||||
},
|
},
|
||||||
cliVersion: await getCliVersion(),
|
cliVersion: await getCliVersion(),
|
||||||
tavilyApiKey:
|
tavilyApiKey:
|
||||||
|
|||||||
@@ -139,8 +139,8 @@ describe('chatCommand', () => {
|
|||||||
.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);
|
.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);
|
||||||
const formattedDate = isoDate ? `${isoDate[1]} ${isoDate[2]}` : '';
|
const formattedDate = isoDate ? `${isoDate[1]} ${isoDate[2]}` : '';
|
||||||
expect(content).toContain(formattedDate);
|
expect(content).toContain(formattedDate);
|
||||||
const index1 = content.indexOf('- \u001b[36mtest1\u001b[0m');
|
const index1 = content.indexOf('- test1');
|
||||||
const index2 = content.indexOf('- \u001b[36mtest2\u001b[0m');
|
const index2 = content.indexOf('- test2');
|
||||||
expect(index1).toBeGreaterThanOrEqual(0);
|
expect(index1).toBeGreaterThanOrEqual(0);
|
||||||
expect(index2).toBeGreaterThan(index1);
|
expect(index2).toBeGreaterThan(index1);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -89,9 +89,9 @@ const listCommand: SlashCommand = {
|
|||||||
const isoString = chat.mtime.toISOString();
|
const isoString = chat.mtime.toISOString();
|
||||||
const match = isoString.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);
|
const match = isoString.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);
|
||||||
const formattedDate = match ? `${match[1]} ${match[2]}` : 'Invalid Date';
|
const formattedDate = match ? `${match[1]} ${match[2]}` : 'Invalid Date';
|
||||||
message += ` - \u001b[36m${paddedName}\u001b[0m \u001b[90m(saved on ${formattedDate})\u001b[0m\n`;
|
message += ` - ${paddedName} (saved on ${formattedDate})\n`;
|
||||||
}
|
}
|
||||||
message += `\n\u001b[90mNote: Newest last, oldest first\u001b[0m`;
|
message += `\nNote: Newest last, oldest first`;
|
||||||
return {
|
return {
|
||||||
type: 'message',
|
type: 'message',
|
||||||
messageType: 'info',
|
messageType: 'info',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@qwen-code/qwen-code-core",
|
"name": "@qwen-code/qwen-code-core",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Qwen Code Core",
|
"description": "Qwen Code Core",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -65,10 +65,7 @@ export interface GenerateJsonOptions {
|
|||||||
*/
|
*/
|
||||||
export class BaseLlmClient {
|
export class BaseLlmClient {
|
||||||
// Default configuration for utility tasks
|
// Default configuration for utility tasks
|
||||||
private readonly defaultUtilityConfig: GenerateContentConfig = {
|
private readonly defaultUtilityConfig: GenerateContentConfig = {};
|
||||||
temperature: 0,
|
|
||||||
topP: 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly contentGenerator: ContentGenerator,
|
private readonly contentGenerator: ContentGenerator,
|
||||||
|
|||||||
@@ -149,10 +149,7 @@ const COMPRESSION_PRESERVE_THRESHOLD = 0.3;
|
|||||||
|
|
||||||
export class GeminiClient {
|
export class GeminiClient {
|
||||||
private chat?: GeminiChat;
|
private chat?: GeminiChat;
|
||||||
private readonly generateContentConfig: GenerateContentConfig = {
|
private readonly generateContentConfig: GenerateContentConfig;
|
||||||
temperature: 0,
|
|
||||||
topP: 1,
|
|
||||||
};
|
|
||||||
private sessionTurnCount = 0;
|
private sessionTurnCount = 0;
|
||||||
|
|
||||||
private readonly loopDetector: LoopDetectionService;
|
private readonly loopDetector: LoopDetectionService;
|
||||||
@@ -169,6 +166,44 @@ export class GeminiClient {
|
|||||||
constructor(private readonly config: Config) {
|
constructor(private readonly config: Config) {
|
||||||
this.loopDetector = new LoopDetectionService(config);
|
this.loopDetector = new LoopDetectionService(config);
|
||||||
this.lastPromptId = this.config.getSessionId();
|
this.lastPromptId = this.config.getSessionId();
|
||||||
|
this.generateContentConfig = this.buildDefaultGenerateContentConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
private buildDefaultGenerateContentConfig(): GenerateContentConfig {
|
||||||
|
const samplingParams =
|
||||||
|
this.config.getContentGeneratorConfig()?.samplingParams;
|
||||||
|
|
||||||
|
if (!samplingParams) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
const config: GenerateContentConfig = {};
|
||||||
|
|
||||||
|
if (samplingParams.temperature !== undefined) {
|
||||||
|
config.temperature = samplingParams.temperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (samplingParams.top_p !== undefined) {
|
||||||
|
config.topP = samplingParams.top_p;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (samplingParams.top_k !== undefined) {
|
||||||
|
config.topK = samplingParams.top_k;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (samplingParams.max_tokens !== undefined) {
|
||||||
|
config.maxOutputTokens = samplingParams.max_tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (samplingParams.presence_penalty !== undefined) {
|
||||||
|
config.presencePenalty = samplingParams.presence_penalty;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (samplingParams.frequency_penalty !== undefined) {
|
||||||
|
config.frequencyPenalty = samplingParams.frequency_penalty;
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
async initialize() {
|
async initialize() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@qwen-code/qwen-code-test-utils",
|
"name": "@qwen-code/qwen-code-test-utils",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "qwen-code-vscode-ide-companion",
|
"name": "qwen-code-vscode-ide-companion",
|
||||||
"displayName": "Qwen Code Companion",
|
"displayName": "Qwen Code Companion",
|
||||||
"description": "Enable Qwen Code with direct access to your VS Code workspace.",
|
"description": "Enable Qwen Code with direct access to your VS Code workspace.",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"publisher": "qwenlm",
|
"publisher": "qwenlm",
|
||||||
"icon": "assets/icon.png",
|
"icon": "assets/icon.png",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user