mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-28 04:29: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",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@qwen-code/qwen-code",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -16024,7 +16024,7 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@qwen-code/qwen-code",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"dependencies": {
|
||||
"@google/genai": "1.16.0",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
@@ -16139,7 +16139,7 @@
|
||||
},
|
||||
"packages/core": {
|
||||
"name": "@qwen-code/qwen-code-core",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@google/genai": "1.16.0",
|
||||
@@ -16278,7 +16278,7 @@
|
||||
},
|
||||
"packages/test-utils": {
|
||||
"name": "@qwen-code/qwen-code-test-utils",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
@@ -16290,7 +16290,7 @@
|
||||
},
|
||||
"packages/vscode-ide-companion": {
|
||||
"name": "qwen-code-vscode-ide-companion",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"license": "LICENSE",
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.15.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@qwen-code/qwen-code",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
@@ -13,7 +13,7 @@
|
||||
"url": "git+https://github.com/QwenLM/qwen-code.git"
|
||||
},
|
||||
"config": {
|
||||
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.0"
|
||||
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "cross-env node scripts/start.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@qwen-code/qwen-code",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Qwen Code",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -25,7 +25,7 @@
|
||||
"dist"
|
||||
],
|
||||
"config": {
|
||||
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.0"
|
||||
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@google/genai": "1.16.0",
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import type {
|
||||
ContentGeneratorConfig,
|
||||
FileFilteringOptions,
|
||||
MCPServerConfig,
|
||||
OutputFormat,
|
||||
@@ -123,6 +124,24 @@ export interface CliArgs {
|
||||
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> {
|
||||
const rawArgv = hideBin(process.argv);
|
||||
const yargsInstance = yargs(rawArgv)
|
||||
@@ -685,6 +704,7 @@ export async function loadCliConfig(
|
||||
|
||||
const vlmSwitchMode =
|
||||
argv.vlmSwitchMode || settings.experimental?.vlmSwitchMode;
|
||||
const legacySamplingParams = getLegacySamplingParams(settings);
|
||||
return new Config({
|
||||
sessionId,
|
||||
embeddingModel: DEFAULT_QWEN_EMBEDDING_MODEL,
|
||||
@@ -745,6 +765,8 @@ export async function loadCliConfig(
|
||||
(typeof argv.openaiLogging === 'undefined'
|
||||
? settings.model?.enableOpenAILogging
|
||||
: argv.openaiLogging) ?? false,
|
||||
// Include sampling_params from root level settings
|
||||
...(legacySamplingParams ? { samplingParams: legacySamplingParams } : {}),
|
||||
},
|
||||
cliVersion: await getCliVersion(),
|
||||
tavilyApiKey:
|
||||
|
||||
@@ -139,8 +139,8 @@ describe('chatCommand', () => {
|
||||
.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);
|
||||
const formattedDate = isoDate ? `${isoDate[1]} ${isoDate[2]}` : '';
|
||||
expect(content).toContain(formattedDate);
|
||||
const index1 = content.indexOf('- \u001b[36mtest1\u001b[0m');
|
||||
const index2 = content.indexOf('- \u001b[36mtest2\u001b[0m');
|
||||
const index1 = content.indexOf('- test1');
|
||||
const index2 = content.indexOf('- test2');
|
||||
expect(index1).toBeGreaterThanOrEqual(0);
|
||||
expect(index2).toBeGreaterThan(index1);
|
||||
});
|
||||
|
||||
@@ -89,9 +89,9 @@ const listCommand: SlashCommand = {
|
||||
const isoString = chat.mtime.toISOString();
|
||||
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';
|
||||
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 {
|
||||
type: 'message',
|
||||
messageType: 'info',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@qwen-code/qwen-code-core",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Qwen Code Core",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -65,10 +65,7 @@ export interface GenerateJsonOptions {
|
||||
*/
|
||||
export class BaseLlmClient {
|
||||
// Default configuration for utility tasks
|
||||
private readonly defaultUtilityConfig: GenerateContentConfig = {
|
||||
temperature: 0,
|
||||
topP: 1,
|
||||
};
|
||||
private readonly defaultUtilityConfig: GenerateContentConfig = {};
|
||||
|
||||
constructor(
|
||||
private readonly contentGenerator: ContentGenerator,
|
||||
|
||||
@@ -149,10 +149,7 @@ const COMPRESSION_PRESERVE_THRESHOLD = 0.3;
|
||||
|
||||
export class GeminiClient {
|
||||
private chat?: GeminiChat;
|
||||
private readonly generateContentConfig: GenerateContentConfig = {
|
||||
temperature: 0,
|
||||
topP: 1,
|
||||
};
|
||||
private readonly generateContentConfig: GenerateContentConfig;
|
||||
private sessionTurnCount = 0;
|
||||
|
||||
private readonly loopDetector: LoopDetectionService;
|
||||
@@ -169,6 +166,44 @@ export class GeminiClient {
|
||||
constructor(private readonly config: Config) {
|
||||
this.loopDetector = new LoopDetectionService(config);
|
||||
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() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@qwen-code/qwen-code-test-utils",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"private": true,
|
||||
"main": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "qwen-code-vscode-ide-companion",
|
||||
"displayName": "Qwen Code Companion",
|
||||
"description": "Enable Qwen Code with direct access to your VS Code workspace.",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"publisher": "qwenlm",
|
||||
"icon": "assets/icon.png",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user