Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ai-renamer

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-renamer - npm Package Compare versions

Comparing version 1.0.19 to 1.0.20

3

package.json
{
"version": "1.0.19",
"version": "1.0.20",
"license": "GPL-3.0",

@@ -22,3 +22,2 @@ "name": "ai-renamer",

"change-case": "^5.4.4",
"ollama": "^0.5.2",
"pdf-parse": "^1.1.1",

@@ -25,0 +24,0 @@ "yargs": "^17.7.2"

@@ -40,6 +40,6 @@ # ai-renamer

Ollama is the default platform so you don't have to do anything. You can just run `npx ai-renamer /images`. At the first launch it will try to auto-select the Llava model but if it couldn't do that you can specify the model.
Ollama is the default provider so you don't have to do anything. You can just run `npx ai-renamer /images`. At the first launch it will try to auto-select the Llava model but if it couldn't do that you can specify the model.
```bash
npx ai-renamer /path --platform=ollama --model=llava:13b
npx ai-renamer /path --provider=ollama --model=llava:13b
```

@@ -49,6 +49,6 @@

You need to set the platform as `lm-studio` and it will auto-select the loaded model in LM Studio.
You need to set the provider as `lm-studio` and it will auto-select the loaded model in LM Studio.
```bash
npx ai-renamer /path --platform=lm-studio
npx ai-renamer /path --provider=lm-studio
```

@@ -59,4 +59,4 @@

```bash
npx ai-renamer /path --platform=ollama --base-url=http://127.0.0.1:11434
npx ai-renamer /path --platform=lm-studio --base-url=http://127.0.0.1:1234
npx ai-renamer /path --provider=ollama --base-url=http://127.0.0.1:11434
npx ai-renamer /path --provider=lm-studio --base-url=http://127.0.0.1:1234
```

@@ -73,3 +73,3 @@

--version Show version number [boolean]
-p, --platform Set the platform (e.g. ollama, lm-studio)
-p, --provider Set the provider (e.g. ollama, lm-studio)
[string]

@@ -76,0 +76,0 @@ -u, --base-url Set the API base URL (e.g.

@@ -34,10 +34,10 @@ const fs = require('fs')

try {
const { platform } = options
const { provider } = options
if (platform === 'ollama') {
if (provider === 'ollama') {
return ollamaApis(options)
} else if (platform === 'lm-studio') {
} else if (provider === 'lm-studio') {
return lmStudioApis(options)
} else {
throw new Error('🔴 No supported platform found')
throw new Error('🔴 No supported provider found')
}

@@ -44,0 +44,0 @@ } catch (err) {

@@ -31,6 +31,6 @@ const os = require('os')

})
.option('platform', {
.option('provider', {
alias: 'p',
type: 'string',
description: 'Set the platform (e.g. ollama, lm-studio)'
description: 'Set the provider (e.g. ollama, lm-studio)'
})

@@ -73,4 +73,4 @@ .option('base-url', {

if (argv.platform) {
config.defaultPlatform = argv.platform
if (argv.provider) {
config.defaultProvider = argv.provider
await saveConfig({ config })

@@ -77,0 +77,0 @@ }

@@ -73,10 +73,10 @@ const fs = require('fs')

try {
const { platform } = options
const { provider } = options
if (platform === 'ollama') {
if (provider === 'ollama') {
return ollamaApis(options)
} else if (platform === 'lm-studio') {
} else if (provider === 'lm-studio') {
return lmStudioApis(options)
} else {
throw new Error('🔴 No supported platform found')
throw new Error('🔴 No supported provider found')
}

@@ -83,0 +83,0 @@ } catch (err) {

const changeCase = require('./changeCase')
const getModelResponse = require('./getModelResponse')
module.exports = async ({ model, _case, chars, images, content, baseURL, language, platform, relativeFilePath }) => {
module.exports = async ({ model, _case, chars, images, content, baseURL, language, provider, relativeFilePath }) => {
try {

@@ -24,3 +24,3 @@ const promptLines = [

const modelResult = await getModelResponse({ model, prompt, images, baseURL, platform })
const modelResult = await getModelResponse({ model, prompt, images, baseURL, provider })

@@ -27,0 +27,0 @@ const maxChars = chars + 10

@@ -9,3 +9,3 @@ const path = require('path')

module.exports = async ({ model, _case, chars, baseURL, language, platform, filePath, inputPath }) => {
module.exports = async ({ model, _case, chars, baseURL, language, provider, filePath, inputPath }) => {
try {

@@ -43,3 +43,3 @@ const fileName = path.basename(filePath)

language,
platform,
provider,
relativeFilePath

@@ -46,0 +46,0 @@ })

@@ -7,11 +7,11 @@ const fs = require('fs').promises

module.exports = async ({ inputPath, defaultCase, defaultModel, defaultChars, defaultBaseURL, defaultLanguage, defaultPlatform, defaultIncludeSubdirectories }) => {
module.exports = async ({ inputPath, defaultCase, defaultModel, defaultChars, defaultBaseURL, defaultLanguage, defaultProvider, defaultIncludeSubdirectories }) => {
try {
const platform = defaultPlatform || 'ollama'
console.log(`⚪ Platform: ${platform}`)
const provider = defaultProvider || 'ollama'
console.log(`⚪ Provider: ${provider}`)
let baseURL = defaultBaseURL
if (platform === 'ollama' && !baseURL) {
if (provider === 'ollama' && !baseURL) {
baseURL = 'http://127.0.0.1:11434'
} else if (platform === 'lm-studio' && !baseURL) {
} else if (provider === 'lm-studio' && !baseURL) {
baseURL = 'http://127.0.0.1:1234'

@@ -21,3 +21,3 @@ }

const model = defaultModel || await chooseModel({ baseURL, platform })
const model = defaultModel || await chooseModel({ baseURL, provider })
console.log(`⚪ Model: ${model}`)

@@ -46,3 +46,3 @@

language,
platform,
provider,
inputPath,

@@ -49,0 +49,0 @@ includeSubdirectories

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc