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

Add hugging-face-ai extension #16329

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

Conversation

wderocco8
Copy link

@wderocco8 wderocco8 commented Jan 12, 2025

Hello, Raycast team! 👋

Hugging Face AI Extension

The past few weeks, I've been working on Hugging Face AI, an extension that allows users to interact with Hugging Face's Inference API. This extension offers features such as contextual question asking, conversation tracking, and even custom model creation.

For a detailed overview, please refer to the README.


Why a Separate Extension?

Although inspired by the ChatGPT extension by Abiel Zulio M, Hugging Face AI is designed to serve a slightly different audience. Key differences include:

  1. Free Access: Users can interact with various models using a free token, removing the pay-as-you-go restriction of ChatGPT.
  2. Easy export/import: Two command approach allows users to easily export and import all extension data (excluding their access_token)
  3. Open Ecosystem: Hugging Face offers a broad range of community-driven models, enabling users to experiment with different capabilities.

While I considered extending the ChatGPT extension, I felt a separate extension would reduce complexity and better align with the Hugging Face community's needs. However, I'm open to feedback on integration or alternative approaches.


Key Features

  • Ask Questions: Chat with Hugging Face models directly.
  • Conversation History: View and manage past conversations.
  • Custom Models: Create and manage personalized AI models.
  • Data Import/Export: Backup or transfer conversation data via JSON.

Why It’s Valuable

This extension provides a cost-effective and flexible solution for developers, AI enthusiasts, and anyone exploring natural language models without incurring additional expenses.

Additionally, it offers greater model diversity and supports users interested in experimenting with AI.


Next Steps

I look forward to your feedback and suggestions. If integration with the ChatGPT extension is a preferred path, I’d be happy to discuss how this can be achieved.


Screencast

1-ask-question-conversation.mov

(Note: the "operation was aborted" above since I selected "Stop Response")

2-conversations-and-deletion.mov
3-markdown.mov
4-export-data.mov
5-import-data.mov

Checklist

- removed old imports
- not satisfied with icons yet, removed them (and also updated readme)
- added free icons from flaticon for now (will create custom ones later)
- added comment
- improved error handling in generateResponse + generateStreamedResponse
- improved error handling in storage
- added confirmation for importing data (irreversible)
- updated changelog
- added searchBarPlaceholders
- improved token creation instructions
- added to readme
- updated deps
- changed extension icon to png
- added assistant context to messages (to prevent redundant responses)
- import/export data workingg
- added file-type validation
- promisified export data
- fixed bugs for no selected folder
- auto-open in finder
- successfully exporting data
- Create LICENSE
- chores
- added hugging fact extension icon
- renamed extension
- refactored update in useConversations
- refactored update in useModels
- added disclaimer for updating models
- able to update models now, but dropdown value is incorrect
- somewhat abandoned ai-description, but fixed recent-questions in conversations
- added non-stream response boilerplate and updated types
- added word count
- fixed question ordering
- fixed abortControlled reset bug
- integrated AbortController to stop web-stream (really cool feature)
- fixed streaming bug (on esc)
- renamed files to kebab-case
- Merge pull request raycast#6 from wderocco8/feat/custom-models
- added selectedModelId (not updating ui though???)
- updated pr template
- removed markdown label
- added link to hf model
- added model detail and delete
- rendered metadata with model information
- holy cow models are working in ask-question wohoo
- model creation set up
- added boilerplate for useModels
- renamed chat to ask-question
- added toggle
- added some metadata (with toggle)
- added copy action
- added empty state for conversations
- refactored converations ActionPanels for organization
- put bandaid on bug (potentially a Raycast issue)
- added empty state images
- swapped comments
- cleanup
- fixed duplicate question bug with Rich Text Input (still has performance bug though)
- added delete question functionality
- rich text input working (some minor bugs)
- added boilerplate for isAskingQuestion (to be fixed...)
- added delete convo confirmation
- added new convo functionality
- added refresh to useQuestions to ensure conversations get latest data
- added refresh mechanism
- some pretty significant refactors to how useConversations is handled (mainly abandoning functional setData in order to properly await saveToLocalStorage
- removed markdown header (maybe will bring back, it looks overwhelming tho)
- conversations enriched with questions in hook
- cleaned types a bit
- remove all questions by conversation implemented
- added metadata to conversations detail
- added sorting to convos
- added new command for viewing conversations
- successfully created conversation
- Merge pull request raycast#5 from wderocco8/refactor/generate-response-conversation
- cleared question on submit
- Merge pull request raycast#4 from wderocco8/refactor/generate-response-conversation
- filtered questions up until questionId
- fixed questions to filter by matching convo
- added dot for to track isStreaming
- Merge pull request raycast#3 from wderocco8/feat/multiple-questions
- holy somehow things are finally coming together (streaming properly integrated with multiple questions)
- still broken, but better stopping point
- selectedQuestionId is synced (but has weird issue on submit)
- fixed bug with searchQuestion
- Merge pull request raycast#2 from wderocco8/refactor/ui-chat-form
- good stopping point (can ask questions, just can\'t see results respectively
- can ask questions again now
- more refactoreds to initializing questions and data handling
- refactored questions
- updated eslint and refactored conversatons
- added hook for conversations and installed uuid:
- refactored useQuestions a bit
- added boilerplate for questions hook
- started wroking on SQL integration
- actions panel is WORKING yuh yuh yuh
- making some refactors (action panel won\'t show up?)
- initial refactors -> moved chat to AskQuestionForm
- renamed ouptu
- added loading states with toasts
- added form validation
- Merge pull request raycast#1 from wderocco8/feat/stream-chat-completion
- added PR template
- STREAM AND CHAT are BOTH working 🌝
- refactoring approach (was accidentally using text-generation instead of chat-completion)
- able to interact with chat using raycast form
- stream finally working 🙏
- made some stream progress..
- new approach
- stream still not working 🥲
- hugging face chatCompletion working (without stream)
- added boilerplate for chat command
- initialized repo
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Jan 12, 2025
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five business days.

Once the PR is approved and merged, the extension will be available on our Store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new extension Label for PRs with new extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants