Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Better TypeScript not a javascript #222

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Better TypeScript not a javascript #222

wants to merge 18 commits into from

Conversation

H0llyW00dzZ
Copy link
Owner

  • [+] fix(chat.ts): import getProviderFromState function from utils
  • [+] refactor(chat.ts): remove unused code related to text moderation
  • [+] refactor(chat.ts): simplify logic for skipping text moderation for certain providers
  • [+] refactor(chat.ts): change 'var' to 'let' for variable 'api'

Copy link

CodeQL analysis is complete for PR #222

@H0llyW00dzZ H0llyW00dzZ marked this pull request as ready for review December 28, 2023 23:09
@H0llyW00dzZ H0llyW00dzZ marked this pull request as draft December 28, 2023 23:16
@H0llyW00dzZ H0llyW00dzZ changed the title Refactor [Module] [Chats] Pass Context of Text Moderation Better TypeScript not a javascript Dec 29, 2023
@H0llyW00dzZ H0llyW00dzZ added enhancement New feature or request todo labels Dec 29, 2023
- [+] fix(chat.ts): import getProviderFromState function from utils
- [+] refactor(chat.ts): remove unused code related to text moderation
- [+] refactor(chat.ts): simplify logic for skipping text moderation for certain providers
- [+] refactor(chat.ts): change 'var' to 'let' for variable 'api'
- [+] fix(config.ts): change textmoderation default value from true to false
- [+] chore(config.ts): update version to 4.6 and add migration logic for textmoderation
- [+] fix(chat.ts): fix condition grouping for text moderation checks
- [+] refactor(openai.ts): remove text moderation logic from chat method
- [+] feat(chat.tsx): add import statement for ChatOptions from "../client/api"
- [+] refactor(chat.tsx): extract handleChatCommand function from doSubmit function
- [+] refactor(chat.tsx): extract submitText function from doSubmit function
- [+] refactor(chat.tsx): extract sendMessage function from doSubmit function
- [+] refactor(chat.tsx): extract findUserMessageForResend helper function
- [+] refactor(chat.tsx): extract findBotMessageForResend helper function
- [+] refactor(chat.tsx): refactor onResend function to use helper functions
- [+] refactor(chat.tsx): refactor doSubmit function to use sendMessage function
- [+] refactor(chat.tsx): refactor doSubmit function to use setAutoScroll function
- [+] refactor(chat.tsx): refactor doSubmit function to clear input field and local state
- [+] refactor(chat.tsx): refactor doSubmit function to focus on input field after submission
- [+] refactor(chat.tsx): refactor onResend function to use chatOptions object with onFinish property
- [+] refactor(chat.tsx): refactor onResend function to use chatOptions object with messages property
- [+] refactor(chat.tsx): refactor onResend function to use chatOptions object with config property
- [+] refactor(chat.tsx): refactor onResend function to use chatOptions object with whitelist property
- [+] refactor(chat.tsx): refactor onResend function to use setIsLoading function
- [+] refactor(chat.tsx): refactor onResend function to delete botMessage only if it exists
- [+] refactor(chat.tsx): refactor onResend function to focus on input field after resending
- [+] fix(utils.ts): add import statements for ModelProvider and ServiceProvider
- [+] refactor(utils.ts): refactor getProviderFromState function to handle enum values correctly
- [+] feat(utils.ts): add helper functions isServiceProvider and isModelProvider to check enum values in getProviderFromState function
- [+] refactor(utils.ts): remove unnecessary type casting in getProviderFromState function
- [+] fix(utils.ts): throw error when provider is not a valid ServiceProvider
- [+] feat(chat.tsx): add support for DEFAULT_MODELS constant
- [+] feat(chat.tsx): add helper function isGoogleAI to check if model is provided by Google
- [+] feat(chat.tsx): add textModerationEnabled variable to access text moderation state
- [+] feat(chat.tsx): add modelProviderName variable to access model name from session
- [+] feat(chat.tsx): update sendMessage function to handle text moderation result and loading state
- [+] feat(chat.tsx): update doSubmit function to send message, handle response, and clear input field
- [+] feat(chat.tsx): update _Chat function to use helper functions to find user and bot messages
- [+] fix(chat.tsx): remove unnecessary await keyword before submitText function call
- [+] feat(chat.tsx): add support for isGoogleAI helper function
- [+] feat(utils.ts): add isGoogleAI helper function
- [+] feat(chat.tsx): add support for findUserMessageForResend helper function
- [+] feat(chat.tsx): add support for findBotMessageForResend helper function
- [+] fix(constant.ts): fix UNFINISHED_INPUT function to use template literals instead of string concatenation
- [+] feat(constant.ts): add type definitions for Provider and Model
- [+] feat(constant.ts): update DEFAULT_MODELS array to include provider information for each model
- [+] fix(chat.ts): fix type error in fillTemplateWith function
- [+] feat(chat.ts): add ModelName type for modelConfig.model
- [+] fix(openai.ts): fix models() method to correctly map DEFAULT_MODELS to LLMModel type
- [+] refactor(common.ts): modify requestOpenai function to handle multiple providers for custom models
- [+] feat(common.ts): add support for LLMModelProvider in collectModelTable function
- [+] refactor(utils.ts): simplify logic for checking if a model is a Google AI model
- [+] fix(utils.ts): fix comment to accurately describe the fallback behavior
- [+] feat(constant.ts): add support for new GPT-4-32k models
- [+] refactor(constant.ts): update provider id, name, and type for Gopher Secret model
- [+] chore(model-config.tsx): remove unused import of ModelProvider
- [+] chore(model-config.tsx): add TODO comment for listing all models based on the provider
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant