From 8e4733e348ac399b26d2fc255679564a96f7aa6b Mon Sep 17 00:00:00 2001 From: Raphael MANSUY Date: Thu, 5 Sep 2024 01:38:51 +0200 Subject: [PATCH] Fix/peer-dependency (#57) * chore: Add .obsidian to .gitignore * fix(packages/qllm-cli): improve chat functionality The commit message should be: fix(packages/qllm-cli): improve chat functionality * Merge remote-tracking branch 'origin/feat/tutorial-qllm' into fix/peer-dependency --- packages/qllm-cli/CHANGELOG.md | 11 +++++++ packages/qllm-cli/package.json | 6 ++-- packages/qllm-cli/src/chat/chat.ts | 5 +-- .../qllm-cli/src/chat/commands/show-help.ts | 26 ++++++++++----- packages/qllm-cli/src/qllm.ts | 32 ++++++++++++++----- .../qllm-cli/src/utils/io-manager/index.ts | 4 +-- packages/qllm-cli/src/utils/write-file.ts | 3 +- packages/qllm-lib/CHANGELOG.md | 6 ++++ packages/qllm-lib/package.json | 18 +++++------ packages/qllm-samples/CHANGELOG.md | 7 ++++ packages/qllm-samples/package.json | 2 +- 11 files changed, 85 insertions(+), 35 deletions(-) diff --git a/packages/qllm-cli/CHANGELOG.md b/packages/qllm-cli/CHANGELOG.md index 479e064..8909be2 100644 --- a/packages/qllm-cli/CHANGELOG.md +++ b/packages/qllm-cli/CHANGELOG.md @@ -1,5 +1,16 @@ # qllm +## 2.8.0 + +### Minor Changes + +- Improve the chat + +### Patch Changes + +- Updated dependencies + - qllm-lib@3.5.0 + ## 2.7.2 ### Patch Changes diff --git a/packages/qllm-cli/package.json b/packages/qllm-cli/package.json index 0e34817..e866392 100644 --- a/packages/qllm-cli/package.json +++ b/packages/qllm-cli/package.json @@ -1,6 +1,6 @@ { "name": "qllm", - "version": "2.7.2", + "version": "2.8.0", "description": "QLLM CLI: A versatile CLI tool for interacting with multiple AI/LLM providers. Features include chat sessions, one-time queries, image handling, and conversation management. Streamlines AI development with easy provider/model switching and configuration.", "keywords": [ "ai", @@ -66,8 +66,8 @@ "typescript-eslint": "8.3.0" }, "dependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0", - "@aws-sdk/client-sts": "3.637.0", + "@aws-sdk/client-sso-oidc": "^3.645.0", + "@aws-sdk/client-sts": "^3.645.0", "@npmcli/fs": "^3.1.1", "cli-table3": "^0.6.5", "commander": "^12.1.0", diff --git a/packages/qllm-cli/src/chat/chat.ts b/packages/qllm-cli/src/chat/chat.ts index 1716b67..b923d77 100644 --- a/packages/qllm-cli/src/chat/chat.ts +++ b/packages/qllm-cli/src/chat/chat.ts @@ -40,8 +40,8 @@ export class Chat { async initialize(): Promise { try { await this.config.initialize(); - this.configManager.setProvider(this.providerName); - this.configManager.setModel(this.modelName); + await this.configManager.setProvider(this.providerName); + await this.configManager.setModel(this.modelName); ioManager.displaySuccess( `Chat initialized with ${this.providerName} provider and ${this.modelName} model.`, ); @@ -67,6 +67,7 @@ export class Chat { private async promptUser(): Promise { try { + const input = await this.ioManager.getUserInput("You: "); // Check if input is undefined (e.g., due to Ctrl+C) diff --git a/packages/qllm-cli/src/chat/commands/show-help.ts b/packages/qllm-cli/src/chat/commands/show-help.ts index cfb947b..686d5a7 100644 --- a/packages/qllm-cli/src/chat/commands/show-help.ts +++ b/packages/qllm-cli/src/chat/commands/show-help.ts @@ -36,12 +36,14 @@ const helpGroups = [ }, { command: "/run