Skip to content

Commit

Permalink
0.5.2 (#138)
Browse files Browse the repository at this point in the history
* Tracing (#60)

* Tracing to separate conversations

* Basic Postgres Connection via Supabase

* MVP Postgres Backed Chat Message History

* Full binary install or psycopg3

* Use Supabase directly to avoid issues with postgres connections

* .env.template update

* 0.3.0 Long Term Memory (#62)

* Add reply to discord and limit chat history to 10 messages

* reverse returned messages and cleanup comments

* Update changelog

* increase cache limit

* Switch to Azure OpenAI

* Changelog

* fix: update link to more recent blog post

* Sanitize thoughts before sending them in the thought's channel (#65)

* LayeredLRU Cache (#69)

* Make BloomChain a static class

* MVP Layered LRU Cache using Postgres

* Remove testing variables

* Async Mutex Lock on Cache

* Stateless bug (#70)

* Dynamic model switching

* Fix hardcoding and add recovery logic for conversation tables

* Add support for multiple conversations

* Fix merge errors

* Fix merge errors 2

* fix: top_p 0.5 to address gibberish

* Custom Web UI (#76)

* init nextjs

* fast api init

* styling and thoughts

* streaming updates

* connect to api

* Add thoughts to the web UI

* Refactor input to be a form for UX (e.g. pressing enter sends)

* typing and thoughts

* Refactor input to be a form for UX (e.g. pressing enter sends)

* Revert "Merge remote-tracking branch 'origin/custom-web' into custom-web"

This reverts commit 1eae747.

* Skeleton Multiple Chat Window UI

* MVP Layout

* Tested Discord and Skeleton FastAPI

* Add, Delete, and Set Conversations

* Get and send messages

* Edit message names

* Local serving from FastAPI via static export

* Deployment strategy for static files

* Separate out apps

* Vercel Deployment with Action

* Re-add discord to fly.toml

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Jacob Van Meter <[email protected]>

* Fix Github Action Workflow

* Fix Github Action Workflow

* add user prediction function

* Honcho Changes (#77)

* init nextjs

* fast api init

* styling and thoughts

* streaming updates

* connect to api

* Add thoughts to the web UI

* Refactor input to be a form for UX (e.g. pressing enter sends)

* typing and thoughts

* Refactor input to be a form for UX (e.g. pressing enter sends)

* Revert "Merge remote-tracking branch 'origin/custom-web' into custom-web"

This reverts commit 1eae747.

* Skeleton Multiple Chat Window UI

* MVP Layout

* Tested Discord and Skeleton FastAPI

* Add, Delete, and Set Conversations

* Get and send messages

* Edit message names

* Local serving from FastAPI via static export

* Deployment strategy for static files

* Separate out apps

* Vercel Deployment with Action

* Re-add discord to fly.toml

* Honcho Stream

* Honcho Stream

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Jacob Van Meter <[email protected]>

* Social Graph Changes

* Authentication Form Styling

* Working Auth

* Stylistic changes

* Address all linting errors

* Naive Route Protection

* Fly minimum machines

* Open Graph Image Changes

* Remove anonymous honcho usage, fix opengraph (#80)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* UI tweaks (#81)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* UI tweaks (#82)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* Open Graph, Block chat, delete convo

* Sign Up UI

* Sign Up UI 2

* Change open graph image

* Open Graph Fix

* Remove Streamlit

* UI tweaks (#84)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* Open Graph, Block chat, delete convo

* Sign Up UI

* Sign Up UI 2

* Change open graph image

* Remove native prompts for sweetalert

* Changelog

* Remove Honcho for discord

* Web fixes (#89)

* seperation between sidebar and window + formatting

* make app pwa downloadable

* move to new chat on button press

* remove router

* feat: Refactor code to use MarkdownWrapper component

- Refactored the code in the `Home` component to replace usages of `ReactMarkdown` and `SyntaxHighlighter` with the new `MarkdownWrapper` component.
- Updated the `Home` component to pass the `text` prop to the `MarkdownWrapper` component for each message.
- Added a new component `MarkdownWrapper` to handle rendering markdown text with syntax highlighting.
- Removed unused imports from the `page.tsx` file, including `ReactMarkdown`, `SyntaxHighlighter`, and `dark` styles.
- Also removed unused imports from the `sidebar.tsx` file, including `useState` import.

* Optimization (#96)

* Usable without honcho and move metadata to creation points

* Remove unused psycopg code

* Add Sentry instrumentation

* Sentry to python

* Update env

* Optimization (#98)

* Usable without honcho and move metadata to creation points

* Remove unused psycopg code

* Add Sentry instrumentation

* Sentry to python

* Update env

* Sentry & Posthog integration on web

* Linting Errors

* add latex support and incentive it (#104)

* prevent unallowed messages (#111)

* implement autoscroll (#112)

* implement autoscroll
Refactored imports in "page.tsx" to improve readability and maintainability. Updated the type of the "input" ref to be more specific. Added a new state and ref to track the scroll position of the message container. Set up an event listener to update the state when the scroll position changes. Made adjustments to the scroll position in certain event handlers.

* update scroll

---------

Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ add multiline support (#118)

* ♻️ refactor all of the api stuff (#119)

* ♻️ refactor all of the api stuff

a redo of the old refactor branch, but cleaner.
moved all api calls to api.ts and supabase.ts

* Minor Bug Fixes

- Add `build-essential` to dockerfile
- Fix signin button size
- Add await for signout
- Force re-render on conversation name change

---------

Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ implement dark mode (#120)

automatically check for system mode
manual control via animated thingy

Co-authored-by: Vineeth Voruganti <[email protected]>

* Documentation (#121)

* README update and start of supabase plus making next buildable

* Supabase Local Setup and README additions

* Update web .env template and note on supabase local auth

* Force redirect for unauthenticated and add posthog events (#122)

* Update version

* Static banner

* ✨ caching and skeletons (#127)

* Revert "✨ caching and skeletons (#127)"

This reverts commit 15e649e.

* Http error handling (#129)

* upgrade openai and langchain

Co-authored-by: Jacob Vanmeter <[email protected]>

* extend supabase timeout

* Handle moderation errors + other streaming errors explicitly

* Streaming error handling

* ✨ caching and skeletons (#127)

* Revert "✨ caching and skeletons (#127)"

This reverts commit 15e649e.

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ caching and skeletons 2 (#130)

* ✨ caching and skeletons

* 🐛 fix the swr revalidation errors

* 💄 fix dark mode typing indicator

* Changelogs (#131)

* Tutor-GPT 0.5.0 (#124)

* Tracing (#60)

* Tracing to separate conversations

* Basic Postgres Connection via Supabase

* MVP Postgres Backed Chat Message History

* Full binary install or psycopg3

* Use Supabase directly to avoid issues with postgres connections

* .env.template update

* 0.3.0 Long Term Memory (#62)

* Add reply to discord and limit chat history to 10 messages

* reverse returned messages and cleanup comments

* Update changelog

* increase cache limit

* Switch to Azure OpenAI

* Changelog

* fix: update link to more recent blog post

* Sanitize thoughts before sending them in the thought's channel (#65)

* LayeredLRU Cache (#69)

* Make BloomChain a static class

* MVP Layered LRU Cache using Postgres

* Remove testing variables

* Async Mutex Lock on Cache

* Stateless bug (#70)

* Dynamic model switching

* Fix hardcoding and add recovery logic for conversation tables

* Add support for multiple conversations

* Fix merge errors

* Fix merge errors 2

* fix: top_p 0.5 to address gibberish

* Custom Web UI (#76)

* init nextjs

* fast api init

* styling and thoughts

* streaming updates

* connect to api

* Add thoughts to the web UI

* Refactor input to be a form for UX (e.g. pressing enter sends)

* typing and thoughts

* Refactor input to be a form for UX (e.g. pressing enter sends)

* Revert "Merge remote-tracking branch 'origin/custom-web' into custom-web"

This reverts commit 1eae747.

* Skeleton Multiple Chat Window UI

* MVP Layout

* Tested Discord and Skeleton FastAPI

* Add, Delete, and Set Conversations

* Get and send messages

* Edit message names

* Local serving from FastAPI via static export

* Deployment strategy for static files

* Separate out apps

* Vercel Deployment with Action

* Re-add discord to fly.toml

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Jacob Van Meter <[email protected]>

* Fix Github Action Workflow

* Fix Github Action Workflow

* add user prediction function

* Honcho Changes (#77)

* init nextjs

* fast api init

* styling and thoughts

* streaming updates

* connect to api

* Add thoughts to the web UI

* Refactor input to be a form for UX (e.g. pressing enter sends)

* typing and thoughts

* Refactor input to be a form for UX (e.g. pressing enter sends)

* Revert "Merge remote-tracking branch 'origin/custom-web' into custom-web"

This reverts commit 1eae747.

* Skeleton Multiple Chat Window UI

* MVP Layout

* Tested Discord and Skeleton FastAPI

* Add, Delete, and Set Conversations

* Get and send messages

* Edit message names

* Local serving from FastAPI via static export

* Deployment strategy for static files

* Separate out apps

* Vercel Deployment with Action

* Re-add discord to fly.toml

* Honcho Stream

* Honcho Stream

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Jacob Van Meter <[email protected]>

* Social Graph Changes

* Authentication Form Styling

* Working Auth

* Stylistic changes

* Address all linting errors

* Naive Route Protection

* Fly minimum machines

* Open Graph Image Changes

* Remove anonymous honcho usage, fix opengraph (#80)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* UI tweaks (#81)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* UI tweaks (#82)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* Open Graph, Block chat, delete convo

* Sign Up UI

* Sign Up UI 2

* Change open graph image

* Open Graph Fix

* Remove Streamlit

* UI tweaks (#84)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* Open Graph, Block chat, delete convo

* Sign Up UI

* Sign Up UI 2

* Change open graph image

* Remove native prompts for sweetalert

* Changelog

* Remove Honcho for discord

* Web fixes (#89)

* seperation between sidebar and window + formatting

* make app pwa downloadable

* move to new chat on button press

* remove router

* feat: Refactor code to use MarkdownWrapper component

- Refactored the code in the `Home` component to replace usages of `ReactMarkdown` and `SyntaxHighlighter` with the new `MarkdownWrapper` component.
- Updated the `Home` component to pass the `text` prop to the `MarkdownWrapper` component for each message.
- Added a new component `MarkdownWrapper` to handle rendering markdown text with syntax highlighting.
- Removed unused imports from the `page.tsx` file, including `ReactMarkdown`, `SyntaxHighlighter`, and `dark` styles.
- Also removed unused imports from the `sidebar.tsx` file, including `useState` import.

* Optimization (#96)

* Usable without honcho and move metadata to creation points

* Remove unused psycopg code

* Add Sentry instrumentation

* Sentry to python

* Update env

* Optimization (#98)

* Usable without honcho and move metadata to creation points

* Remove unused psycopg code

* Add Sentry instrumentation

* Sentry to python

* Update env

* Sentry & Posthog integration on web

* Linting Errors

* add latex support and incentive it (#104)

* prevent unallowed messages (#111)

* implement autoscroll (#112)

* implement autoscroll
Refactored imports in "page.tsx" to improve readability and maintainability. Updated the type of the "input" ref to be more specific. Added a new state and ref to track the scroll position of the message container. Set up an event listener to update the state when the scroll position changes. Made adjustments to the scroll position in certain event handlers.

* update scroll

---------

Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ add multiline support (#118)

* ♻️ refactor all of the api stuff (#119)

* ♻️ refactor all of the api stuff

a redo of the old refactor branch, but cleaner.
moved all api calls to api.ts and supabase.ts

* Minor Bug Fixes

- Add `build-essential` to dockerfile
- Fix signin button size
- Add await for signout
- Force re-render on conversation name change

---------

Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ implement dark mode (#120)

automatically check for system mode
manual control via animated thingy

Co-authored-by: Vineeth Voruganti <[email protected]>

* Documentation (#121)

* README update and start of supabase plus making next buildable

* Supabase Local Setup and README additions

* Update web .env template and note on supabase local auth

* Force redirect for unauthenticated and add posthog events (#122)

* Update version

* Static banner

---------

Co-authored-by: vintro <[email protected]>
Co-authored-by: Jacob Vanmeter <[email protected]>
Co-authored-by: hyusap <[email protected]>
Co-authored-by: vintro <[email protected]>

* Changelogs

---------

Co-authored-by: vintro <[email protected]>
Co-authored-by: Jacob Vanmeter <[email protected]>
Co-authored-by: hyusap <[email protected]>
Co-authored-by: vintro <[email protected]>

* 🐛 hotfix thought glitch (#136)

* Simple change to add next static export for local testing (#135)

* Re-sync staging with main  (#134)

* 0.5.1 (#132)

* Tracing (#60)

* Tracing to separate conversations

* Basic Postgres Connection via Supabase

* MVP Postgres Backed Chat Message History

* Full binary install or psycopg3

* Use Supabase directly to avoid issues with postgres connections

* .env.template update

* 0.3.0 Long Term Memory (#62)

* Add reply to discord and limit chat history to 10 messages

* reverse returned messages and cleanup comments

* Update changelog

* increase cache limit

* Switch to Azure OpenAI

* Changelog

* fix: update link to more recent blog post

* Sanitize thoughts before sending them in the thought's channel (#65)

* LayeredLRU Cache (#69)

* Make BloomChain a static class

* MVP Layered LRU Cache using Postgres

* Remove testing variables

* Async Mutex Lock on Cache

* Stateless bug (#70)

* Dynamic model switching

* Fix hardcoding and add recovery logic for conversation tables

* Add support for multiple conversations

* Fix merge errors

* Fix merge errors 2

* fix: top_p 0.5 to address gibberish

* Custom Web UI (#76)

* init nextjs

* fast api init

* styling and thoughts

* streaming updates

* connect to api

* Add thoughts to the web UI

* Refactor input to be a form for UX (e.g. pressing enter sends)

* typing and thoughts

* Refactor input to be a form for UX (e.g. pressing enter sends)

* Revert "Merge remote-tracking branch 'origin/custom-web' into custom-web"

This reverts commit 1eae747.

* Skeleton Multiple Chat Window UI

* MVP Layout

* Tested Discord and Skeleton FastAPI

* Add, Delete, and Set Conversations

* Get and send messages

* Edit message names

* Local serving from FastAPI via static export

* Deployment strategy for static files

* Separate out apps

* Vercel Deployment with Action

* Re-add discord to fly.toml

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Jacob Van Meter <[email protected]>

* Fix Github Action Workflow

* Fix Github Action Workflow

* add user prediction function

* Honcho Changes (#77)

* init nextjs

* fast api init

* styling and thoughts

* streaming updates

* connect to api

* Add thoughts to the web UI

* Refactor input to be a form for UX (e.g. pressing enter sends)

* typing and thoughts

* Refactor input to be a form for UX (e.g. pressing enter sends)

* Revert "Merge remote-tracking branch 'origin/custom-web' into custom-web"

This reverts commit 1eae747.

* Skeleton Multiple Chat Window UI

* MVP Layout

* Tested Discord and Skeleton FastAPI

* Add, Delete, and Set Conversations

* Get and send messages

* Edit message names

* Local serving from FastAPI via static export

* Deployment strategy for static files

* Separate out apps

* Vercel Deployment with Action

* Re-add discord to fly.toml

* Honcho Stream

* Honcho Stream

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Jacob Van Meter <[email protected]>

* Social Graph Changes

* Authentication Form Styling

* Working Auth

* Stylistic changes

* Address all linting errors

* Naive Route Protection

* Fly minimum machines

* Open Graph Image Changes

* Remove anonymous honcho usage, fix opengraph (#80)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* UI tweaks (#81)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* UI tweaks (#82)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* Open Graph, Block chat, delete convo

* Sign Up UI

* Sign Up UI 2

* Change open graph image

* Open Graph Fix

* Remove Streamlit

* UI tweaks (#84)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* Open Graph, Block chat, delete convo

* Sign Up UI

* Sign Up UI 2

* Change open graph image

* Remove native prompts for sweetalert

* Changelog

* Remove Honcho for discord

* Web fixes (#89)

* seperation between sidebar and window + formatting

* make app pwa downloadable

* move to new chat on button press

* remove router

* feat: Refactor code to use MarkdownWrapper component

- Refactored the code in the `Home` component to replace usages of `ReactMarkdown` and `SyntaxHighlighter` with the new `MarkdownWrapper` component.
- Updated the `Home` component to pass the `text` prop to the `MarkdownWrapper` component for each message.
- Added a new component `MarkdownWrapper` to handle rendering markdown text with syntax highlighting.
- Removed unused imports from the `page.tsx` file, including `ReactMarkdown`, `SyntaxHighlighter`, and `dark` styles.
- Also removed unused imports from the `sidebar.tsx` file, including `useState` import.

* Optimization (#96)

* Usable without honcho and move metadata to creation points

* Remove unused psycopg code

* Add Sentry instrumentation

* Sentry to python

* Update env

* Optimization (#98)

* Usable without honcho and move metadata to creation points

* Remove unused psycopg code

* Add Sentry instrumentation

* Sentry to python

* Update env

* Sentry & Posthog integration on web

* Linting Errors

* add latex support and incentive it (#104)

* prevent unallowed messages (#111)

* implement autoscroll (#112)

* implement autoscroll
Refactored imports in "page.tsx" to improve readability and maintainability. Updated the type of the "input" ref to be more specific. Added a new state and ref to track the scroll position of the message container. Set up an event listener to update the state when the scroll position changes. Made adjustments to the scroll position in certain event handlers.

* update scroll

---------

Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ add multiline support (#118)

* ♻️ refactor all of the api stuff (#119)

* ♻️ refactor all of the api stuff

a redo of the old refactor branch, but cleaner.
moved all api calls to api.ts and supabase.ts

* Minor Bug Fixes

- Add `build-essential` to dockerfile
- Fix signin button size
- Add await for signout
- Force re-render on conversation name change

---------

Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ implement dark mode (#120)

automatically check for system mode
manual control via animated thingy

Co-authored-by: Vineeth Voruganti <[email protected]>

* Documentation (#121)

* README update and start of supabase plus making next buildable

* Supabase Local Setup and README additions

* Update web .env template and note on supabase local auth

* Force redirect for unauthenticated and add posthog events (#122)

* Update version

* Static banner

* ✨ caching and skeletons (#127)

* Revert "✨ caching and skeletons (#127)"

This reverts commit 15e649e.

* Http error handling (#129)

* upgrade openai and langchain

Co-authored-by: Jacob Vanmeter <[email protected]>

* extend supabase timeout

* Handle moderation errors + other streaming errors explicitly

* Streaming error handling

* ✨ caching and skeletons (#127)

* Revert "✨ caching and skeletons (#127)"

This reverts commit 15e649e.

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ caching and skeletons 2 (#130)

* ✨ caching and skeletons

* 🐛 fix the swr revalidation errors

* 💄 fix dark mode typing indicator

* Changelogs (#131)

* Tutor-GPT 0.5.0 (#124)

* Tracing (#60)

* Tracing to separate conversations

* Basic Postgres Connection via Supabase

* MVP Postgres Backed Chat Message History

* Full binary install or psycopg3

* Use Supabase directly to avoid issues with postgres connections

* .env.template update

* 0.3.0 Long Term Memory (#62)

* Add reply to discord and limit chat history to 10 messages

* reverse returned messages and cleanup comments

* Update changelog

* increase cache limit

* Switch to Azure OpenAI

* Changelog

* fix: update link to more recent blog post

* Sanitize thoughts before sending them in the thought's channel (#65)

* LayeredLRU Cache (#69)

* Make BloomChain a static class

* MVP Layered LRU Cache using Postgres

* Remove testing variables

* Async Mutex Lock on Cache

* Stateless bug (#70)

* Dynamic model switching

* Fix hardcoding and add recovery logic for conversation tables

* Add support for multiple conversations

* Fix merge errors

* Fix merge errors 2

* fix: top_p 0.5 to address gibberish

* Custom Web UI (#76)

* init nextjs

* fast api init

* styling and thoughts

* streaming updates

* connect to api

* Add thoughts to the web UI

* Refactor input to be a form for UX (e.g. pressing enter sends)

* typing and thoughts

* Refactor input to be a form for UX (e.g. pressing enter sends)

* Revert "Merge remote-tracking branch 'origin/custom-web' into custom-web"

This reverts commit 1eae747.

* Skeleton Multiple Chat Window UI

* MVP Layout

* Tested Discord and Skeleton FastAPI

* Add, Delete, and Set Conversations

* Get and send messages

* Edit message names

* Local serving from FastAPI via static export

* Deployment strategy for static files

* Separate out apps

* Vercel Deployment with Action

* Re-add discord to fly.toml

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Jacob Van Meter <[email protected]>

* Fix Github Action Workflow

* Fix Github Action Workflow

* add user prediction function

* Honcho Changes (#77)

* init nextjs

* fast api init

* styling and thoughts

* streaming updates

* connect to api

* Add thoughts to the web UI

* Refactor input to be a form for UX (e.g. pressing enter sends)

* typing and thoughts

* Refactor input to be a form for UX (e.g. pressing enter sends)

* Revert "Merge remote-tracking branch 'origin/custom-web' into custom-web"

This reverts commit 1eae747.

* Skeleton Multiple Chat Window UI

* MVP Layout

* Tested Discord and Skeleton FastAPI

* Add, Delete, and Set Conversations

* Get and send messages

* Edit message names

* Local serving from FastAPI via static export

* Deployment strategy for static files

* Separate out apps

* Vercel Deployment with Action

* Re-add discord to fly.toml

* Honcho Stream

* Honcho Stream

---------

Co-authored-by: hyusap <[email protected]>
Co-authored-by: Jacob Van Meter <[email protected]>

* Social Graph Changes

* Authentication Form Styling

* Working Auth

* Stylistic changes

* Address all linting errors

* Naive Route Protection

* Fly minimum machines

* Open Graph Image Changes

* Remove anonymous honcho usage, fix opengraph (#80)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* UI tweaks (#81)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* UI tweaks (#82)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* Open Graph, Block chat, delete convo

* Sign Up UI

* Sign Up UI 2

* Change open graph image

* Open Graph Fix

* Remove Streamlit

* UI tweaks (#84)

* Remove anonymous honcho usage, fix opengraph

* Remove extra excess logging and comment

* I hate typescript

* Open Graph, Block chat, delete convo

* Sign Up UI

* Sign Up UI 2

* Change open graph image

* Remove native prompts for sweetalert

* Changelog

* Remove Honcho for discord

* Web fixes (#89)

* seperation between sidebar and window + formatting

* make app pwa downloadable

* move to new chat on button press

* remove router

* feat: Refactor code to use MarkdownWrapper component

- Refactored the code in the `Home` component to replace usages of `ReactMarkdown` and `SyntaxHighlighter` with the new `MarkdownWrapper` component.
- Updated the `Home` component to pass the `text` prop to the `MarkdownWrapper` component for each message.
- Added a new component `MarkdownWrapper` to handle rendering markdown text with syntax highlighting.
- Removed unused imports from the `page.tsx` file, including `ReactMarkdown`, `SyntaxHighlighter`, and `dark` styles.
- Also removed unused imports from the `sidebar.tsx` file, including `useState` import.

* Optimization (#96)

* Usable without honcho and move metadata to creation points

* Remove unused psycopg code

* Add Sentry instrumentation

* Sentry to python

* Update env

* Optimization (#98)

* Usable without honcho and move metadata to creation points

* Remove unused psycopg code

* Add Sentry instrumentation

* Sentry to python

* Update env

* Sentry & Posthog integration on web

* Linting Errors

* add latex support and incentive it (#104)

* prevent unallowed messages (#111)

* implement autoscroll (#112)

* implement autoscroll
Refactored imports in "page.tsx" to improve readability and maintainability. Updated the type of the "input" ref to be more specific. Added a new state and ref to track the scroll position of the message container. Set up an event listener to update the state when the scroll position changes. Made adjustments to the scroll position in certain event handlers.

* update scroll

---------

Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ add multiline support (#118)

* ♻️ refactor all of the api stuff (#119)

* ♻️ refactor all of the api stuff

a redo of the old refactor branch, but cleaner.
moved all api calls to api.ts and supabase.ts

* Minor Bug Fixes

- Add `build-essential` to dockerfile
- Fix signin button size
- Add await for signout
- Force re-render on conversation name change

---------

Co-authored-by: Vineeth Voruganti <[email protected]>

* ✨ implement dark mode (#120)

automatically check for system mode
manual control via animated thingy

Co-authored-by: Vineeth Voruganti <[email protected]>

* Documentation (#121)

* README update and start of supabase plus making next buildable

* Supabase Local Setup and README additions

* Update web .env template and note on supabase local auth

* Force redirect for unauthenticated and add posthog events (#122)

* Update version

* Static banner

---------

Co-authored-by: vintro <[email protected]>
Co-authored-by: Jacob Vanmeter <[email protected]>
Co-authored-by: hyusap <[email protected]>
Co-authored-by: vintro <[email protected]>

* Changelogs

---------

Co-authored-by: vintro <[email protected]>
Co-authored-by: Jacob Vanmeter <[email protected]>
Co-authored-by: hyusap <[email protected]>
Co-authored-by: vintro <[email protected]>

---------

Co-authored-by: vintro <[email protected]>
Co-authored-by: Jacob Vanmeter <[email protected]>
Co-authored-by: hyusap <[email protected]>
Co-authored-by: vintro <[email protected]>

* Enforce no anonymous users (#133)

---------

Co-authored-by: vintro <[email protected]>
Co-authored-by: Jacob Vanmeter <[email protected]>
Co-authored-by: hyusap <[email protected]>
Co-authored-by: vintro <[email protected]>

* Remove revalidation on focus (#137)

* Remove revalidation on focus

* Add PostHog Provider back for production

---------

Co-authored-by: vintro <[email protected]>
Co-authored-by: Jacob Vanmeter <[email protected]>
Co-authored-by: hyusap <[email protected]>
Co-authored-by: vintro <[email protected]>
  • Loading branch information
5 people authored Dec 20, 2023
1 parent 479f1ba commit cb489b5
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 123 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.5.2] - 2023-12-20

### Fixed

- screen jitter on revalidation conversations and messages on webui

### Changed

- Removed A/B testing logic

## [0.5.1] - 2023-12-12

### Added
Expand Down
4 changes: 2 additions & 2 deletions agent/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def think(cls, cache: Conversation, input: str):
chain = thought_prompt | cls.llm

def save_new_messages(ai_response):
cache.add_message("response", HumanMessage(content=input))
cache.add_message("response", AIMessage(content=ai_response))
cache.add_message("thought", HumanMessage(content=input))
cache.add_message("thought", AIMessage(content=ai_response))

return Streamable(chain.astream({}, {"tags": ["thought"], "metadata": {"conversation_id": cache.conversation_id, "user_id": cache.user_id}}), save_new_messages)

Expand Down
87 changes: 43 additions & 44 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ async def delete_conversation(conversation_id: str):
@app.get("/api/conversations/insert")
async def add_conversation(user_id: str, location_id: str = "web"):
async with LOCK:
metadata = {"A/B": False}
if not user_id.startswith("anon_"):
# metadata = /B": False}
# if not user_id.startswith("anon_"):
# metadata["A/B"] = bool(random.getrandbits(1))
metadata["A/B"] = True
representation = MEDIATOR.add_conversation(location_id=location_id, user_id=user_id, metadata=metadata)
# metadata["A/B"] = True
representation = MEDIATOR.add_conversation(location_id=location_id, user_id=user_id)
conversation_id = representation["id"]
return {
"conversation_id": conversation_id
Expand All @@ -113,17 +113,17 @@ async def chat(inp: ConversationInput):
return HTTPException(status_code=401, detail="unauthorized please sign in")
async with LOCK:
conversation = Conversation(MEDIATOR, user_id=inp.user_id, conversation_id=inp.conversation_id)
conversation_data = MEDIATOR.conversation(session_id=inp.conversation_id)
if honcho_url and conversation_data and conversation_data["metadata"]:
metadata = conversation_data["metadata"]
if "A/B" in metadata.keys() and metadata["A/B"]:
response = requests.post(f'{honcho_url}/chat', json={
"user_id": inp.user_id,
"conversation_id": inp.conversation_id,
"message": inp.message
}, stream=True)
print(response)
return response
# conversation_data = MEDIATOR.conversation(session_id=inp.conversation_id)
if honcho_url:
# metadata = conversation_data["metadata"]
# if "A/B" in metadata.keys() and metadata["A/B"]:
response = requests.post(f'{honcho_url}/chat', json={
"user_id": inp.user_id,
"conversation_id": inp.conversation_id,
"message": inp.message
}, stream=True)
print(response)
return response
if conversation is None:
raise HTTPException(status_code=404, detail="Item not found")
thought, response = await BloomChain.chat(conversation, inp.message)
Expand All @@ -140,35 +140,34 @@ async def stream(inp: ConversationInput):
return HTTPException(status_code=401, detail="unauthorized please sign in")
async with LOCK:
conversation = Conversation(MEDIATOR, user_id=inp.user_id, conversation_id=inp.conversation_id)
conversation_data = MEDIATOR.conversation(session_id=inp.conversation_id)
if honcho_url and not inp.user_id.startswith("anon_") and conversation_data and conversation_data["metadata"]:
metadata = conversation_data["metadata"]
if "A/B" in metadata.keys() and metadata["A/B"]:
response = requests.post(f'{honcho_url}/stream', json={
"user_id": inp.user_id,
"conversation_id": inp.conversation_id,
"message": inp.message
}, stream=True)

def generator():
try:
for chunk in response.iter_content(chunk_size=8192):
# print(f"Received chunk: {chunk}")
if chunk:
yield chunk
except ChunkedEncodingError as e:
print(f"Chunked encoding error occurred: {e}")
print(response)
print(response.headers)
# Optionally yield an error message to the client
yield b"An error occurred while streaming the response."
except Exception as e:
print(f"An unexpected error occurred: {e}")
# Optionally yield an error message to the client
yield b"An unexpected error occurred."

print("A/B Confirmed")
return StreamingResponse(generator())
# conversation_data = MEDIATOR.conversation(session_id=inp.conversation_id)
if honcho_url and not inp.user_id.startswith("anon_"):
# metadata = conversation_data["metadata"]
# if "A/B" in metadata.keys() and metadata["A/B"]:
response = requests.post(f'{honcho_url}/stream', json={
"user_id": inp.user_id,
"conversation_id": inp.conversation_id,
"message": inp.message
}, stream=True)

def generator():
try:
for chunk in response.iter_content(chunk_size=8192):
# print(f"Received chunk: {chunk}")
if chunk:
yield chunk
except ChunkedEncodingError as e:
print(f"Chunked encoding error occurred: {e}")
print(response)
print(response.headers)
# Optionally yield an error message to the client
yield b"An error occurred while streaming the response."
except Exception as e:
print(f"An unexpected error occurred: {e}")
# Optionally yield an error message to the client
yield b"An unexpected error occurred."

return StreamingResponse(generator())
if conversation is None:
raise HTTPException(status_code=404, detail="Item not found")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tutor-gpt"
version = "0.5.1"
version = "0.5.2"
description = "LangChain LLM application. Dynamic few-shot metaprompting for the task of tutoring."
authors = ["vintro <[email protected]>", "VVoruganti <[email protected]"]
readme = "README.md"
Expand Down
101 changes: 50 additions & 51 deletions www/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default function Home() {
setConversationId(conversations[0].conversationId);
setCanSend(true);
},
revalidateOnFocus: false,
});

const messagesFetcher = async (conversationId: string) => {
Expand All @@ -119,7 +120,7 @@ export default function Home() {
mutate: mutateMessages,
isLoading: messagesLoading,
error: _,
} = useSWR(conversationId, messagesFetcher);
} = useSWR(conversationId, messagesFetcher, { revalidateOnFocus: false });

async function chat() {
const textbox = input.current!;
Expand Down Expand Up @@ -163,19 +164,17 @@ export default function Home() {
while (true) {
const { done, value } = await reader.read();
if (done) {
// console.log("done");
setCanSend(true);
break;
}
// console.log(value);
if (isThinking) {
if (value.includes("❀")) {
// a bloom delimiter
isThinking = false;
continue;
}
setThought((prev) => prev + value);
mutateMessages(newMessages, { revalidate: false });
// mutateMessages(newMessages, { revalidate: false });
} else {
if (value.includes("❀")) {
setCanSend(true); // Bloom delimeter
Expand Down Expand Up @@ -265,60 +264,60 @@ export default function Home() {
className="flex flex-col flex-1 overflow-y-auto lg:px-5 dark:text-white"
ref={messageContainerRef}
>
{
messagesLoading || messages === undefined ? (
<MessageBox loading />
) : (
messages.map((message, i) => (
<MessageBox isUser={message.isUser} key={i}>
<MarkdownWrapper text={message.text} />
</MessageBox>
))
)
}
{
messagesLoading || messages === undefined ? (
<MessageBox loading />
) : (
messages.map((message, i) => (
<MessageBox isUser={message.isUser} key={i}>
<MarkdownWrapper text={message.text} />
</MessageBox>
))
)
}
</section >
<form
id="send"
className="flex p-3 lg:p-5 gap-3 border-gray-300"
onSubmit={(e) => {
e.preventDefault();
if (canSend && input.current?.value) {
posthog.capture("user_sent_message");
chat();
}
}}
>
{/* TODO: validate input */}
<textarea
ref={input}
placeholder="Type a message..."
className={`flex-1 px-3 py-1 lg:px-5 lg:py-3 bg-gray-100 dark:bg-gray-800 text-gray-400 rounded-2xl border-2 resize-none ${canSend ? " border-green-200" : "border-red-200 opacity-50"
}`}
disabled={!canSend}
rows={1}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
<form
id="send"
className="flex p-3 lg:p-5 gap-3 border-gray-300"
onSubmit={(e) => {
e.preventDefault();
if (canSend && input.current?.value) {
posthog.capture("user_sent_message");
chat();
}
}
}}
/>
<button
className="bg-dark-green text-neon-green rounded-full px-4 py-2 lg:px-7 lg:py-3 flex justify-center items-center gap-2"
type="submit"
>
<FaPaperPlane className="inline" />
</button>
</form>
}}
>
{/* TODO: validate input */}
<textarea
ref={input}
placeholder="Type a message..."
className={`flex-1 px-3 py-1 lg:px-5 lg:py-3 bg-gray-100 dark:bg-gray-800 text-gray-400 rounded-2xl border-2 resize-none ${canSend ? " border-green-200" : "border-red-200 opacity-50"
}`}
rows={1}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault();
if (canSend && input.current?.value) {
posthog.capture("user_sent_message");
chat();
}
}
}}
/>
<button
className="bg-dark-green text-neon-green rounded-full px-4 py-2 lg:px-7 lg:py-3 flex justify-center items-center gap-2"
type="submit"
disabled={!canSend}
>
<FaPaperPlane className="inline" />
</button>
</form>
</div >
<Thoughts
thought={thought}
setIsThoughtsOpen={setIsThoughtsOpen}
isThoughtsOpen={isThoughtsOpen}
/>
<Thoughts
thought={thought}
setIsThoughtsOpen={setIsThoughtsOpen}
isThoughtsOpen={isThoughtsOpen}
/>
</main >
);
}
4 changes: 2 additions & 2 deletions www/components/markdownWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default function MarkdownWrapper({ text }: { text: string }) {
// @ts-expect-error i think typing is wrong from the library itself, this comment should raise an error once its fixed. // TODO: remove this comment
rehypePlugins={[rehypeKatex]}
components={{
ol: ({ node, ...props }) => <ol className="list-decimal" {...props} />,
ul: ({ node, ...props }) => <ul className="list-disc" {...props} />,
ol: ({ node, ...props }) => { const { ordered, ...filteredProps } = props; return <ol className="list-decimal" {...filteredProps} /> },
ul: ({ node, ...props }) => { const { ordered, ...filteredProps } = props; return <ul className="list-disc" {...filteredProps} /> },
code({ node, inline, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || "");
return !inline && match ? (
Expand Down
2 changes: 1 addition & 1 deletion www/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
// output: "standalone",
output: "standalone",
// rewrites: async () => {
// return [
// {
Expand Down
Loading

1 comment on commit cb489b5

@vercel
Copy link

@vercel vercel bot commented on cb489b5 Dec 20, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.