Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsidian Smart-connections: configure which parameters to pass to the module #1

Open
bobbruno opened this issue Apr 22, 2024 · 1 comment

Comments

@bobbruno
Copy link

Hi, I'm a user of the Obsidian Smart Connection plugin, and I'm playing with using other models (specifically, models hosted on Databricks). I noticed they mostly work with the API custom configuration, but I had to edit the file below to remove the presence_penalty and frequence_penalty parameters when working with DBRX-instruct - it doesn't recognize these parameters.

Would it be possible to add a configuration for which parameters to send to the model and with which values? Not sure if I should have opened this issue on the Obsidian Smart Connections repo, but I couldn't find the function reference in the source there.

get default_opts() {

@brianpetro
Copy link
Owner

Hey @bobbruno

Congrats on being issue #1 in the JS Brains repo 💪

The way I would approach this would be to create a databricks adapter, similar to the anthropic and google adapters https://github.com/brianpetro/jsbrains/tree/main/smart-chat-model/adapters

If the base smart_chat_model.js already mostly works, then the new adapter likely only needs to add the prepare_request_body() method to the adapter.

This gets called right before requesting the API and transforms the request body.
https://github.com/brianpetro/jsbrains/blob/main/smart-chat-model/smart_chat_model.js#L104C103-L104C123

Besides that, if you wanted to add Databricks as a platform (I'm not familiar with them, so I don't know if that makes sense), you could also create a fetch function for retrieving the models like in https://github.com/brianpetro/jsbrains/blob/main/smart-chat-model/models/open_router.js and then add the platform to the JSON file https://github.com/brianpetro/jsbrains/blob/main/smart-chat-model/platforms.json

If added as a platform, it will automatically be added to Smart Connections in the next update. Without adding as a platform, Smart Connections will require an additional update that allows selecting a specific adapter for use with the custom server configuration.

🌴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants