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

Secrets #12

Open
lmangani opened this issue Nov 8, 2024 · 6 comments
Open

Secrets #12

lmangani opened this issue Nov 8, 2024 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@lmangani
Copy link
Collaborator

lmangani commented Nov 8, 2024

The extension should leverage Secrets as an option to safely store parameters across sessions.

@lmangani lmangani added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Nov 8, 2024
@aborruso
Copy link

Ciao @lmangani , I have a related question: now is there no way to save default api_url, api_token and api_key?
Do I have to set them every time at startup?

Thank you for this great tool

@lmangani
Copy link
Collaborator Author

CIao @aborruso at this time the settings are indeed required, but if there's interest I'll get started on stored SECRETS 👍

@aborruso
Copy link

CIao @aborruso at this time the settings are indeed required, but if there's interest I'll get started on stored SECRETS 👍

Grazie @lmangani, my use case is very trivial: I would like to open duckdb cli and use this fantastic work of yours, as available by default (with automatic load in .rc file), and without every time writing these parameters.

And set these parameters only when I don't want to use the default ones. If you think this is helpful, and you can put time and head into it, thank you very much. I would like to help you, but I don't know how to do it.

@lmangani
Copy link
Collaborator Author

lmangani commented Dec 29, 2024

@aborruso here's an untested PR with SECRETS support and instructions. Would you able to build and validate it locally?

Instructions

Clone and build the PR branch locally:

cd /usr/src
git clone -b secret-manager --recurse-submodules https://github.com/quackscience/duckdb-extension-openprompt
cd duckdb-extension-openprompt
OVERRIDE_GIT_DESCRIBE="v1.1.3" GEN=ninja make

Run the local DuckDB build:

./build/release/duckdb

Add and test SECRETS

D CREATE SECRET IF NOT EXISTS open_prompt (
      TYPE open_prompt,
      PROVIDER config,
      api_token 'your-api-token',
      api_url 'http://localhost:11434/v1/chat/completions',
      model_name 'qwen2.5:0.5b',
      api_timeout '30'
  );

Testing

At this point the parameters should be derived from SECRETS instead of SET parameters.

@lmangani
Copy link
Collaborator Author

lmangani commented Dec 29, 2024

I also added ENV parameters to allow provisioning the process from the system at runtime

    OPEN_PROMPT_API_URL
    OPEN_PROMPT_API_TOKEN
    OPEN_PROMPT_MODEL_NAME
    OPEN_PROMPT_API_TIMEOUT

@aborruso
Copy link

Grazie @lmangani , I will try tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants