Skip to content

Commit

Permalink
minor fixes and add resolution setting for handling multimodal
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Joseph Petro committed Oct 12, 2024
1 parent 22e7d62 commit 271d230
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion smart-chat-model/adapters/_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class SmartChatModelApiAdapter extends SmartChatModelAdapter {
* Get the default model configuration.
* @returns {Object} The default model configuration.
*/
get default_model_config() { return this.models.find(m => m.model_key === this.model_key); }
get default_model_config() { return this.models.find(m => m.key === this.model_key); }

/**
* Get the models.
Expand Down
11 changes: 11 additions & 0 deletions smart-chat-model/adapters/openai.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ export class SmartChatModelOpenaiAdapter extends SmartChatModelApiAdapter {
const models = await this.get_models();
return models.length > 0;
}
get settings_config() {
return {
"[CHAT_PLATFORM].high_image_resolution": {
name: 'High Resolution Images',
type: "toggle",
description: "Enable high resolution images for the chat model (this will increase costs).",
default: false,
conditional: (_this) => _this.adapter?.model_config?.multimodal,
},
};
}
}
// Manual model context for now since OpenAI doesn't provide this info in the API response
// may require updating when new models are released
Expand Down
2 changes: 1 addition & 1 deletion smart-fs/adapters/node_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class NodeFsSmartFsAdapter {
path: folder ? folder + '/' + item.name : item.name,
};
if(this.smart_fs.is_excluded(file.path)) return acc;
if(item.isFile()){
if(item.isFile() && !item.isDirectory()){ // isFile() alone was returning true for directories containing "." in name
if(opts.type === 'folder') return acc;
file.type = 'file';
// set to getter that calls statSync and formats the result
Expand Down

0 comments on commit 271d230

Please sign in to comment.