enricoros / big-AGI

Generative AI suite powered by state-of-the-art models and providing advanced AI/AGI functions. It features AI personas, AGI functions, multi-model chats, text-to-image, voice, response streaming, code highlighting and execution, PDF import, presets for developers, much more. Deploy on-prem or in the cloud.
https://big-agi.com
MIT License
5.6k stars 1.3k forks source link

Feature: Scratch pad for notes and/or text splitting? #17

Open centminmod opened 1 year ago

centminmod commented 1 year ago

@enricoros Love your work, it was very easy to setup using Cloudflare Pages https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/ once you set NODE_VERSION https://developers.cloudflare.com/pages/platform/build-configuration/ 😀

The first suggestion is how about a scratch pad for notes on a expand/collapse sidebar column? Sometimes you work with a text size that is greater than the token length, so need the whole text to be placed somewhere.

Even better, add support for the notepad to allow full-text input and count characters/tokens and then users can define how many characters or tokens to split text by and have neat snippets of text displayed to be copied and pasted. I did a standalone text splitter demo for what I mean at https://slicer.centminmod.com/ 😃

cheers

George

enricoros commented 1 year ago

Hi George thanks for your feedback.

Cloudflare: Will you be willing to write a little Markdown (we put it in /docs/deploy-cloudflare.md) to super briefly explain how to do it? I've never done it, and would love to document, link it from the main Readme, and try it out!

Scratchpad. Love the idea. Shall be there. I'll mark this as a feature and work on it.

Text splitting I like your demo. I am thinking at having a scratchpad with tokens counting, and maybe a splitter button that will create other pads. Before I do this part - can you tell me more about your usecase and your workflow?

centminmod commented 1 year ago

For setting up your nextjs app on Cloudflare Pages you can follow Cloudflare developer docs at https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/

The only difference is I took these steps below:

  1. I forked your repo to my own Github repo
  2. On the Cloudflare Pages section, click Create a project button > Connect To Git and give Cloudflare Pages either All Github account Repo access or selected Repo access. I use selected Repo access and select the forked repo from step 1
  3. Once you select the forked Github repo, you click Begin Setup button to setup build and deployments. On this page you set you Project name, Production branch i.e. main and your Build settings where you select from Framework preset dropdown menu Next.js. Leave the preset filled Build command and Build output directory as preset defaults. You'd want to set Environmental variables (advanced) on this page to configure some variables as follows:
VARIABLE | VALUE -- | -- GO_VERSION | 1.16 NEXT_TELEMETRY_DISABLED | 1 NODE_VERSION | 17 PHP_VERSION | 7.4 PYTHON_VERSION | 3.7 RUBY_VERSION | 2.7.1
  1. Click the Save and Deploy button
  2. Then watch the process run to initialize your build environment, clone Github repo, build the application and deploy to Cloudflare Network once that is done, proceed to the project you created.
  3. Custom domains tab allows you to set up your domain via CNAME
  4. Settings page will have 2 settings you want to enable, Access Policy to restrict preview deployments to members of your Cloudflare account via one time pin and to restrict primary *.YOURPROJECT.pages.dev domain see https://developers.cloudflare.com/pages/platform/known-issues/#enabling-access-on-your-pagesdev-domain and enable Web Analytics

If that is something you can follow?

My use case is basically for coding or where inputs are pretty large so needs splitting up to drip feed the inputs to ChatGPT

enricoros commented 1 year ago

Added a placeholder for where the scratchpad will be (now that we support multiple chats).

image

centminmod commented 1 year ago

@enricoros thanks!

enricoros commented 1 year ago

@centminmod, used your instructions up here to create deploy-cloudflare.md

centminmod commented 1 year ago

that link to md file gives me no search results? edit: ah you mean https://github.com/enricoros/nextjs-chatgpt-app/blob/main/docs/deploy-cloudflare.md :)

Related to scratch pad when pasting in text, not sure if anything can be done for security to protect against prompt injection attacks like

enricoros commented 1 year ago

Thanks for pointing this out. Will keep this top on mind in the next refactorings.

enricoros commented 1 year ago

This will be part of the editor of #202