Skip to content

Commit

Permalink
feat: initial commit # => v1.0.0 on @latest
Browse files Browse the repository at this point in the history
  • Loading branch information
briansunter committed Jun 5, 2022
0 parents commit 633ed73
Show file tree
Hide file tree
Showing 18 changed files with 3,224 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,39 @@
# This is a basic workflow to help you get started with Actions

name: Releases

env:
PLUGIN_NAME: logseq-plugin-gpt3-openai

# Controls when the action will run.
on:
push:
branches:
- "master"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
- uses: pnpm/action-setup@v2.2.1
with:
version: 6.0.2
- run: pnpm install
- run: pnpm build
- name: Install zip
uses: montudor/action-zip@v1
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GTOKEN }}
24 changes: 24 additions & 0 deletions .gitignore
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
44 changes: 44 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,44 @@
# 1.0.0 (2022-06-05)


### Features

* initial commit # => v0.0.1 on [@latest](https://github.com/latest) ([7f0c03d](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/7f0c03d3081d6b664737101091c5beed17cf235d))
* initial commit # => v0.0.1 on [@latest](https://github.com/latest) ([5b8f909](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/5b8f90942eb76cb37bc10598a950ba71901f6671))
* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([0d4ebd2](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/0d4ebd204a9ed1c86114edeb75f038a51f4d2e0b))
* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([2721977](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/27219772f686e63deb47d4b223acf7a706ecca76))
* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([9b46f87](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/9b46f87816dbb3755a7ee850391998a6429f54f8))

# 1.0.0 (2022-06-05)


### Features

* initial commit # => v0.0.1 on [@latest](https://github.com/latest) ([7f0c03d](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/7f0c03d3081d6b664737101091c5beed17cf235d))
* initial commit # => v0.0.1 on [@latest](https://github.com/latest) ([5b8f909](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/5b8f90942eb76cb37bc10598a950ba71901f6671))
* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([2721977](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/27219772f686e63deb47d4b223acf7a706ecca76))
* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([9b46f87](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/9b46f87816dbb3755a7ee850391998a6429f54f8))

# 1.0.0 (2022-06-05)


### Features

* initial commit # => v0.0.1 on [@latest](https://github.com/latest) ([5b8f909](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/5b8f90942eb76cb37bc10598a950ba71901f6671))
* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([2721977](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/27219772f686e63deb47d4b223acf7a706ecca76))
* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([9b46f87](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/9b46f87816dbb3755a7ee850391998a6429f54f8))

# 1.0.0 (2022-06-05)


### Features

* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([2721977](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/27219772f686e63deb47d4b223acf7a706ecca76))
* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([9b46f87](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/9b46f87816dbb3755a7ee850391998a6429f54f8))

# 1.0.0 (2022-06-05)


### Features

* initial commit # => v1.0.0 on [@latest](https://github.com/latest) ([9b46f87](https://github.com/briansunter/logseq-plugin-gpt3-openai/commit/9b46f87816dbb3755a7ee850391998a6429f54f8))
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
153 changes: 153 additions & 0 deletions README.md
@@ -0,0 +1,153 @@
<p align="center">
<a href="" rel="noopener">
<img width=400px height=200px src="./docs/open-ai.webp" alt="Project logo"></a>
<img width=200px height=200px src="./docs/logseq.png" alt="Project logo"></a>
</p>

<h3 align="center">logseq-plugin-gpt3-openai</h3>

<div align="center">

[![Status](https://img.shields.io/badge/status-active-success.svg)]()
[![GitHub Issues](https://img.shields.io/github/issues/briansunter/logseq-plugin-gpt3-openai.svg)](https://github.com/briansunter/logseq-plugin-gpt3-openai)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/briansunter/logseq-plugin-gpt3-openai.svg)](https://github.com/briansunter/logseq-plugin-gpt3-openai)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)

</div>

---

<p align="center"> A plugin for GPT-3 AI assisted note taking in Logseq
<br>
</p>

## Usage

Just type `/gpt3` in a block or select `gpt3` from the block menu.

[See here for example usages](https://beta.openai.com/examples).

## Demo

https://user-images.githubusercontent.com/2816289/171101687-0e4ebca3-5a05-4d40-b53f-9c67336cef44.mp4

## 📝 Table of Contents

- [About](#about)
- [Getting Started](#getting_started)
- [Deployment](#deployment)
- [Usage](#usage)
- [Built Using](#built_using)
- [TODO](../TODO.md)
- [Contributing](../CONTRIBUTING.md)
- [Authors](#authors)
- [Acknowledgments](#acknowledgement)

## About <a name = "about"></a>
`logseq-plugin-gpt3-openai` allows users to generate human-like text using GPT-3 within the LogSeq editor.

Just write a GPT-3 command in a block, then run the open `openai` command via the slash menu or the block menu. The plugin will generate a GPT-3 reponse using the OpenAI API and insert it beneath the block.

## 📖 Example Use Cases
- Summarizing or explaining a block of text


https://user-images.githubusercontent.com/2816289/171097277-bbf0ccc1-2730-4814-b2a6-079112024a75.mov


- Creating bullet point outlines for a given topic


https://user-images.githubusercontent.com/2816289/171097641-797e7693-2f98-47a7-aa2c-c8ae37aea888.mov

- Creating study plan for a given topic


https://user-images.githubusercontent.com/2816289/171098679-ce14a44d-b727-486b-8db5-80f0f5e1a34f.mov

- Explain how to do something


https://user-images.githubusercontent.com/2816289/171099995-8a6d8ec3-df61-4220-8a98-5c077cd78ca6.mp4


- Explaining code in human-understandable english


https://user-images.githubusercontent.com/2816289/171100160-cfadc07f-e522-4d64-9261-57191c8bf83c.mp4



- Generate code to do a given task
- Correct grammar
- Translate into other languages
- Parse tabular data from plain english

https://user-images.githubusercontent.com/2816289/171100243-7f155861-2e4d-4757-b7d4-8acd677f79b5.mp4

- Classification and keyword tagging of text
- Generate lists of given topics
- `List 10 top selling science fiction books`
- Write about a given topic
- `Write a tagline for an ice cream shop.`
- Answer Questions
- `Q: How does a telescope work?`

## Getting Started <a name = "getting_started"></a>
How to build and develop the project locally.

### Prerequisites

[An API key from OpenAI Click here to get one](https://beta.openai.com/account/api-keys)

### Installing

```
npm i
```

## Running the tests <a name = "tests"></a>
- [ ] Add Tests


## Build <a name="usage"></a>
```
npm run build
```

## 💻 Local Development

This enables the local dev server with hot reloading, via the logseq vite plugin.

```
npm run dev
```

## Local Installation

First run `npm i` and `npm run build`

Open LogSeq

Go to Settings > Turn on Developer Mode

This will bring up the "Plugins" entry in three dots more menu list on top right of head bar. Go to Plugins page, and you will get a button with the `Load unpacked plugin label`. Select the root folder of this plugin repo.

Make sure you add your [OpenAI Key](https://beta.openai.com/account/api-keys)

## 🚀 Deployment <a name = "deployment"></a>

- [ ] Add to Logseq marketplace

## Built Using <a name = "built_using"></a>

- [LogSeq](https://logseq.com/) - Privacy-first, open-source knowledge base that works on top of local plain-text Markdown and Org-mode files.
- [Vite](https://vitejs.dev/) - Next Generation Frontend Tooling

## Authors <a name = "authors"></a>

- [@briansunter](https://github.com/birnaunster) - Author

## Acknowledgements <a name = "acknowledgement"></a>

- [OpenAI Examples](https://beta.openai.com/examples)
15 changes: 15 additions & 0 deletions favicon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions index.html
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
35 changes: 35 additions & 0 deletions package.json
@@ -0,0 +1,35 @@
{
"name": "logseq-plugin-gpt3-openai",
"private": true,
"version": "1.0.0",
"main": "dist/index.html",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/exec": "6.0.3",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "^8.0.4",
"@semantic-release/npm": "9.0.1",
"conventional-changelog-conventionalcommits": "^5.0.0",
"semantic-release": "^19.0.2",
"typescript": "^4.5.4",
"vite": "^2.9.9",
"vite-plugin-logseq": "^1.1.2"
},
"dependencies": {
"@logseq/libs": "^0.0.6",
"openai": "^2.0.5"
},
"logseq": {
"name": "logseq-plugin-gpt3-openai",
"id": "_79n711y6e"
},
"peerDependencies": {
"semantic-release": "^19.0.2"
}
}

0 comments on commit 633ed73

Please sign in to comment.