Skip to content

Commit

Permalink
Merge pull request #7 from kk17/6-add-huggingchat-support
Browse files Browse the repository at this point in the history
add huggingchat support
  • Loading branch information
kk17 authored Aug 12, 2023
2 parents ec1d6cf + a2aa2bb commit fb639c4
Show file tree
Hide file tree
Showing 7 changed files with 1,415 additions and 32 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
info.plist
# info.plist
prefs.plist
*.pyc
lib
lib
.hugchat_cookies
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export PYTHONPATH=.:lib
/usr/bin/python3 \
ask_ai.py \
-v \
--model-provider openai_text-davinci-003 \
--model-provider hugchat_OpenAssistant/oasst-sft-6-llama-30b-xor \
translate chinese \
"python code to use keyboard package to trigger the cmd+v shortcut. the code should works on mac os and windows os and linux."
```
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ A powerful workflow for using Notion's AskAI feature from anywhere.
1. [Download the workflow](https://github.com/kk17/alfred-ask-ai-anywhere-workflow/releases/latest)
2. Double click the `.alfredworkflow` file to install and configure the workflow.

Note that the [Alfred 5 Powerpack](https://www.alfredapp.com/powerpack/) and one of the LLM provider to use the workflow.
- NotionAI: Follow [this guide](https://github.com/Vaayne/notionai-py#get-notion-token-and-workspace-id) to get Notion token and workspace ID from you broswer.
- OpenAI: Get your api key from [here](https://platform.openai.com/account/api-keys)
Note that the [Alfred 5 Powerpack](https://www.alfredapp.com/powerpack/) is required to use the workflow. To get started, you will need to register for one of the following services:

After configure the API key, you need to configure hotkeys for the workflow.
- Huggingface Chat (Free): Register your account [here](https://huggingface.co/chat/).
- OpenAI: Get your API key from [here](https://platform.openai.com/account/api-keys).
- NotionAI: Follow [this guide](https://github.com/Vaayne/notionai-py#get-notion-token-and-workspace-id) to get your Notion token and workspace ID from your browser.

After configure the LLM provider, you need to configure hotkeys for the workflow.
![configure hotkeys](./docs/config-hotkeys.png)

## Usage
Expand Down
5 changes: 3 additions & 2 deletions ask_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
keyboard = Controller()

MODEL_CHOICES = [
"hugchat_OpenAssistant/oasst-sft-6-llama-30b-xor",
"hugchat_meta-llama/Llama-2-70b-chat-hf",
"notionai",
# "openai",
"openai_gpt-3.5-turbo",
"openai_gpt-4",
"openai_text-davinci-003",
Expand Down Expand Up @@ -53,7 +54,7 @@
help='LLM provider, support notionai, openai',
type=click.Choice(MODEL_CHOICES),
multiple=True,
default=['openai_text-davinci-003'])
default=['hugchat_meta-llama/Llama-2-70b-chat-hf'])
@click.option('--input-to-clipboard',
is_flag=True,
help='Copy input content to clipboard.')
Expand Down
Loading

0 comments on commit fb639c4

Please sign in to comment.