Skip to content

Commit

Permalink
Update to character count monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
TfTHacker committed Mar 30, 2024
1 parent 1ec9406 commit 9ebefe4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
26 changes: 13 additions & 13 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"id": "ai-templater",
"name": "AI for Templater",
"version": "1.0.0",
"minAppVersion": "1.5.11",
"description": "AI Extension for the Templater plugin with the OpenAI Client Library.",
"author": "TfTHacker",
"authorUrl": "https://github.com/TfTHacker/obsidian-ai-templater",
"helpUrl": "https://tfthacker.com/AIT",
"isDesktopOnly": false,
"fundingUrl": {
"Sponsor my work": "https://tfthacker.com/sponsor"
}
}
"id": "ai-templater",
"name": "AI for Templater",
"version": "1.0.1",
"minAppVersion": "1.5.11",
"description": "AI Extension for the Templater plugin with the OpenAI Client Library.",
"author": "TfTHacker",
"authorUrl": "https://github.com/TfTHacker/obsidian-ai-templater",
"helpUrl": "https://tfthacker.com/AIT",
"isDesktopOnly": false,
"fundingUrl": {
"Sponsor my work": "https://tfthacker.com/sponsor"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "openaisdk",
"version": "1.0.0",
"version": "1.0.1",
"description": "OpenAI SDK plugin for Obsidian.",
"main": "main.js",
"scripts": {
"dev": "node esbuild.config.mjs",
"build": "node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json",
"version": "node version-bump.mjs",
"lint:check": "eslint --ext .ts,.tsx .",
"lint:fix": "eslint --fix --ext .ts,.tsx .",
"format:check": "prettier --check .",
Expand Down
5 changes: 2 additions & 3 deletions src/open_ai/OpenAiClientLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ export default class OpenAiApi {
const maxCharacters = maxOutgoingCharacters ? maxOutgoingCharacters : this.plugin.settings.defaultMaxOutgoingCharacters;
if (characterCount > maxCharacters) {
new Notice(
`${this.plugin.APP_ABBREVIARTION}: Character count exceeds the limit of ${maxCharacters.toString()} for outgoing AI requests.
This setting can be changed in Settings or as part of the command.`,
10000
`${this.plugin.APP_ABBREVIARTION}: Character count exceeds the limit of ${maxCharacters.toString()} for outgoing AI requests and the current character count is ${characterCount.toString()}. This setting can be changed in Settings or as part of the command.`,
15000
);
this.plugin.log(
`chat', 'Character count exceeds limt. Defined limit is ${maxCharacters.toString()} and the current character count is ${characterCount.toString()}.`
Expand Down
10 changes: 5 additions & 5 deletions version-bump.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { readFileSync, writeFileSync } from "fs";
import { readFileSync, writeFileSync } from 'fs';

const targetVersion = process.env.npm_package_version;

// read minAppVersion from manifest.json and bump version to target version
let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
let manifest = JSON.parse(readFileSync('manifest.json', 'utf8'));
const { minAppVersion } = manifest;
manifest.version = targetVersion;
writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t'));

// update versions.json with target version and minAppVersion from manifest.json
let versions = JSON.parse(readFileSync("versions.json", "utf8"));
let versions = JSON.parse(readFileSync('versions.json', 'utf8'));
versions[targetVersion] = minAppVersion;
writeFileSync("versions.json", JSON.stringify(versions, null, "\t"));
writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"1.0.0": "1.5.11"
"1.0.0": "1.5.11",
"1.0.1": "1.5.11"
}

0 comments on commit 9ebefe4

Please sign in to comment.