Skip to content

Feature: Add API key loading from secrets.toml for chat widget #630

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

joshlavroff
Copy link
Contributor


name: Pull Request
about: Create a pull request to contribute to the project
title: ''
labels: ''
assignees: ''

Description of Changes
API keys for the chat component can now be loaded from a project's secrets.toml file. Keys that are entered during a session are not saved and will remain only in the sessionStorage until the app is closed.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • New example
  • Test improvement

Testing
Code has been tested against the currently present chat example in the Iris example project.

Screenshot (812)
Screenshot (813)

2025-04-07.16-49-28.mp4

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have run my code against examples and ensured no errors
  • Any dependent changes have been merged and published in downstream modules

Copy link
Member

@shivam-singhal shivam-singhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshlavroff can you use tomli instead of tomllib? Also is there error testing in case secrets.toml doesn't exist?

@joshlavroff
Copy link
Contributor Author

@shivam-singhal yes if there's no secrets.toml or no API key included it will ask for an API key when you try to use the widget. I will update to tomli today

@joshlavroff
Copy link
Contributor Author

@shivam-singhal I've updated the PR to use tomli instead of tomllib

@joshlavroff
Copy link
Contributor Author

@shivam-singhal just checking back in on this, are there any other changes that need to be made?

@joshlavroff
Copy link
Contributor Author

@therealrinku thank you for pointing this out! I've resolved the issue

@amrutha97 amrutha97 force-pushed the main branch 2 times, most recently from 6ac1dad to bdb2c4e Compare April 24, 2025 07:54
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

Successfully merging this pull request may close these issues.

4 participants