Skip to content

Commit

Permalink
fix: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
taskingaiwww authored and SimsonW committed May 23, 2024
1 parent fe0cad7 commit 1d56646
Show file tree
Hide file tree
Showing 21 changed files with 112 additions and 477 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Test

on:
pull_request:
branches: ["master"]
paths:
- "frontend/**"
- "!**.md"

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

environment: test

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set short SHA
run: echo "IMAGE_TAG=$(echo ${{ github.sha }} | cut -c 1-7)" >> $GITHUB_ENV

- name: Check for git tag version
id: get_tag
run: |
TAG=$(git describe --tags --exact-match 2> /dev/null || echo "")
if [[ -n "$TAG" ]]; then
echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV
fi
- name: Check spelling of repo
uses: crate-ci/typos@master

4 changes: 4 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[default]
extend-ignore-words-re = [
"\\bba\\b"
]
2 changes: 1 addition & 1 deletion backend/app/models/inference/chat_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ChatCompletionAssistantMessage(ChatCompletionMessage):

function_calls: Optional[List[ChatCompletionFunctionCall]] = Field(
None,
description="The funcion calls requested by the assistant.",
description="The function calls requested by the assistant.",
)


Expand Down
2 changes: 1 addition & 1 deletion backend/app/schemas/assistant/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MessageGenerateRequest(BaseModel):
min_length=0,
max_length=16,
description="The variables that fit the system prompt template.",
examples=[{"langauge": "English"}],
examples=[{"language": "English"}],
)
stream: bool = Field(
False,
Expand Down
File renamed without changes
12 changes: 6 additions & 6 deletions frontend/src/components/apiKey/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function ApiKeys() {
setDisabled(true)
}
}
const handleCreateConfrim = async () => {
const handleCreateConfirm = async () => {
if (id) {
form1.validateFields().then(async () => {
setLoading(true);
Expand Down Expand Up @@ -225,7 +225,7 @@ function ApiKeys() {
const handleChangeNameValue = (e: ChangeEvent<HTMLInputElement>) => {
setCreateNameValue(e.target.value)
}
const handleDeleteConfrim = async () => {
const handleDeleteConfirm = async () => {
setDeleteLoading(true)

await deleteApiKeys(record.apikey_id)
Expand All @@ -252,7 +252,7 @@ function ApiKeys() {
<Button key="cancel" onClick={handleModalCancel} className='cancel-button'>
{t('cancel')}
</Button>,
<Button key="submit" loading={loading} onClick={handleCreateConfrim} className='next-button'>
<Button key="submit" loading={loading} onClick={handleCreateConfirm} className='next-button'>
{t('confirm')}
</Button>
]}
Expand All @@ -273,7 +273,7 @@ function ApiKeys() {
<Button key="cancel" onClick={handleCreateCancel} className='cancel-button'>
{t('cancel')}
</Button>,
<Button key="submit" loading={confirmLoading} onClick={handleCreateConfrim} className='next-button'>
<Button key="submit" loading={confirmLoading} onClick={handleCreateConfirm} className='next-button'>
{t('confirm')}
</Button>
]}
Expand All @@ -294,14 +294,14 @@ function ApiKeys() {
<Button key="cancel" onClick={handleDeleteCancel} className='cancel-button'>
{t('cancel')}
</Button>,
<Button key="delete" onClick={handleDeleteConfrim} className={disabled ? 'disabled-button' : 'delete-button'} disabled={disabled} loading={deleteLoading}>
<Button key="delete" onClick={handleDeleteConfirm} className={disabled ? 'disabled-button' : 'delete-button'} disabled={disabled} loading={deleteLoading}>
{t('delete')}
</Button>
]}
>
<p className={styles['p']}>{t('deleteItem')}<span className={styles['span']}> {record.name}</span>? {t('projectDeleteDesc')} </p>
<Form layout='vertical' className={styles['edit-form']} form={deleteForm}>
<Form.Item label={t('projectAPIKeyName')} name="name" rules={[{ required: true, message: `${t('projectAPIKeyVaildate')}` }]}>
<Form.Item label={t('projectAPIKeyName')} name="name" rules={[{ required: true, message: `${t('projectAPIKeyValidate')}` }]}>
<Input onChange={handleDeleteValue} className={styles['edit-instance-modal']} placeholder={t('projectAPIKeyDeletePlaceholder')}></Input>
</Form.Item>
</Form>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/assistants/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ function Assistant() {

} catch (error) {
console.log(error)
const errotType = error as ApiErrorResponse
const errorMessage: string = errotType.response.data.error.message;
const errorType = error as ApiErrorResponse
const errorMessage: string = errorType.response.data.error.message;
toast.error(errorMessage)
}
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/createPlugin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ function CreatePlugin(props: any) {
})
setInputSchema(arr)
}
const handleClickBundle = async (bundleId: string, bundelName: string, item: any) => {
const handleClickBundle = async (bundleId: string, bundleName: string, item: any) => {
setBundleId(bundleId)
setPluginInfoLoading(true)
setBundleName(bundelName)
setBundleName(bundleName)
// setBundleDesc(item.description)
// const res = await getPluginDetail(bundleId)
setPluginListData(item.plugins)
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ToolGreenIcon from '@/assets/img/toolGreenIcon.svg?react'
import AssistantGreenIcon from '@/assets/img/assistantGreenIcon.svg?react'
import RetrievalGreenIcon from '@/assets/img/retrievalGreenIcon.svg?react'
import ForwardIcon from '@/assets/img/forwardIcon.svg?react'
import ApiRefrence from '../../assets/img/restApisIcon.svg?react'
import ApiReference from '../../assets/img/restApisIcon.svg?react'
import PythonIcon from '@/assets/img/pythonIcon.svg?react'
import NodeIcon from '@/assets/img/jsIcon.svg?react'
import OpenaiIcon from '@/assets/img/openaiIcon.svg?react'
Expand Down Expand Up @@ -136,7 +136,7 @@ import taskingai
taskingai.init(api_key="YOUR_API_KEY")
# authentication with OpenAI-compatiable APIs
# authentication with OpenAI-compatible APIs
from openai import OpenAI
client = OpenAI(
Expand All @@ -155,7 +155,7 @@ client = OpenAI(
<div className={styles['card-bottom']}>
<div className={styles['card-bottom-item']}>
<div className={styles['card-header']}>
<ApiRefrence />
<ApiReference />
<span className={styles['card-bottom-title']}>REST APIs</span>
</div>
<div>
Expand All @@ -176,7 +176,7 @@ client = OpenAI(
<div className={styles['card-bottom-item']}>
<div className={styles['card-header']}>
<OpenaiIcon />
<span className={styles['card-bottom-title']}>OpenAI Compatiable APIs</span>
<span className={styles['card-bottom-title']}>OpenAI compatible APIs</span>
</div>
<div style={{ display: 'flex', gap: '12px' }}>
<Button onClick={()=>window.open('https://platform.openai.com/docs/guides/text-generation/chat-completions-api')} className='cancel-button'>OpenAI</Button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/drawerAssistant/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ const DrawerAssistant = forwardRef((props: any, ref: any) => {
{retrievalFormList.map((item: any, index: number) => (
<div className='retrieval-list' key={item.collection_id}>
<Select options={[
{ value: 'Collecion', label: 'Collection' }
{ value: 'Collection', label: 'Collection' }
]} defaultValue='Collection' className='retrieval-type'></Select>
<Select className='input' placeholder={!item?.collection_id && t('projectAssistantRetrievalPlaceHolder')} onClick={() => handleCollectionModal(index, item.collection_id)} suffixIcon={<RightOutlined />} open={false} value={item.collection_id ? item.collection_id : undefined} removeIcon={null} />
<div> <DeleteInputIcon onClick={() => handleDeleteRetrieval(item.collection_id,index)} style={{ marginTop: '8px' }} /></div>
Expand Down
22 changes: 11 additions & 11 deletions frontend/src/components/modelModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
const [modelTypes, setModelTypes] = useState('chat_completion')
const [name, setName] = useState('')
const [centerLoading, setCenterLoading] = useState(false)
const [properties, setProerties] = useState('')
const [properties, setProperties] = useState('')
const [type, setType] = useState('')
const [propertyForm] = Form.useForm()
const [wildcardForm] = Form.useForm()
Expand All @@ -68,7 +68,7 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
const [prividerDesc, setPrividerDesc] = useState('')
const [openModalOne, setOpenModalOne] = useState(false)
const [modelTypesList, setModelTypesList] = useState<string[]>([])
const [discription, setDiscription] = useState('')
const [description, setDescription] = useState('')
const [resourcesList, setResourcesList] = useState<any>([])
const handleCancel = () => {
setOpenModalOne(false)
Expand All @@ -89,8 +89,8 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
setSelectedOneId(res.data[0].model_schema_id)
setName(res.data[0].name)
setType(res.data[0].type)
setProerties(res.data[0].properties)
setDiscription(res.data[0].description)
setProperties(res.data[0].properties)
setDescription(res.data[0].description)
setProviderId(res.data[0].provider_id)
}

Expand All @@ -104,8 +104,8 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
const handleClickModel = (item: projectIdType) => () => {
setName(item.name)
setSelectedOneId(item.model_schema_id)
setProerties(item.properties)
setDiscription(item.description)
setProperties(item.properties)
setDescription(item.description)
setType(item.type)
}
const fetchModelProviderList = async (type?: any) => {
Expand Down Expand Up @@ -263,8 +263,8 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
setSelectedOneId(res.data[0].model_schema_id)
setName(res.data[0].name)
setType(res.data[0].type)
setProerties(res.data[0].properties)
setDiscription(res.data[0].description)
setProperties(res.data[0].properties)
setDescription(res.data[0].description)

setProviderId(res.data[0].provider_id)
}
Expand Down Expand Up @@ -335,7 +335,7 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
<div className='content'>

<div className='label3'>{t('projectAssistantsColumnDescription')}</div>
<div className='desc-info'>{discription}</div>
<div className='desc-info'>{description}</div>
<div className='label3' style={{ marginTop: '22px' }}>{t('projectModelColumnType')}</div>

<div className='model-types'>
Expand Down Expand Up @@ -516,7 +516,7 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {
</>}
{modelTypes === 'chat_completion' && <>
<Form.Item label="Function call" required name='function_call' valuePropName="checked">
<div className='description'>{t('projectModelProoertiesDesc')}</div>
<div className='description'>{t('projectModelPropertiesDesc')}</div>
<ConfigProvider theme={{
components: {
Switch: {
Expand Down Expand Up @@ -571,7 +571,7 @@ const ModelModal = react.forwardRef((props: modelModalProps, ref) => {

{type === 'chat_completion' && <Form layout="vertical" className='second-form' form={propertyForm}>
<Form.Item label="Function call" required name='function_call' valuePropName="checked">
<div className='description'>{t('projectModelProoertiesDesc')}</div>
<div className='description'>{t('projectModelPropertiesDesc')}</div>
<ConfigProvider theme={{
components: {
Switch: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/modelModal/modelModal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
padding-top: 24px;
padding-left: 24px;

.lable3 {
.label3 {
position: relative;
font-size: 16px;
line-height: 20px;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/modelsPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function ModelsPage() {
setDisabled(true)
}
}
const handleDeleteConfrim = async () => {
const handleDeleteConfirm = async () => {
setDeleteLoading(true)
const params = {
model_id: record.model_id
Expand Down Expand Up @@ -443,7 +443,7 @@ function ModelsPage() {
</>}
{type === 'chat_completion' && <>
<Form.Item label="Function call" required name='function_call' valuePropName="checked">
<div className={styles['description']}>{t('projectModelProoertiesDesc')}</div>
<div className={styles['description']}>{t('projectModelPropertiesDesc')}</div>
<ConfigProvider theme={{
components: {
Switch: {
Expand Down Expand Up @@ -498,7 +498,7 @@ function ModelsPage() {

{modelType === 'chat_completion' && <Form layout="vertical" className='second-form' form={propertyForm}>
<Form.Item label="Function call" required name='function_call' valuePropName="checked">
<div className={styles['description']}>{t('projectModelProoertiesDesc')}</div>
<div className={styles['description']}>{t('projectModelPropertiesDesc')}</div>
<ConfigProvider theme={{
components: {
Switch: {
Expand Down Expand Up @@ -609,7 +609,7 @@ function ModelsPage() {
<Button key="cancel" onClick={handleDeleteCancel} className='cancel-button'>
{t('cancel')}
</Button>,
<Button key="delete" onClick={handleDeleteConfrim} className={disabled ? 'disabled-button' : 'delete-button'} disabled={disabled} loading={deleteLoading}>
<Button key="delete" onClick={handleDeleteConfirm} className={disabled ? 'disabled-button' : 'delete-button'} disabled={disabled} loading={deleteLoading}>
{t('delete')}
</Button>
]}
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ function Playground() {
setDrawerDesc(value)
}

const handleCreateConfrim = () => {
const handleCreateConfirm = () => {
setOpenModalTable(false)
}
const hangleFilterData = (value: any[]) => {
Expand Down Expand Up @@ -1131,14 +1131,14 @@ function Playground() {
const data3 = JSON.stringify(data1, null, 4)
setChatCompletionCall(data3)
const label = data1.event_step?.charAt(0).toUpperCase() + data1.event_step?.slice(1)
const lable1 = data1.event.split('_').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
setCollapseLabel1(`${lable1}: ${label}`)
const label1 = data1.event.split('_').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
setCollapseLabel1(`${label1}: ${label}`)
} else if (data2) {
delete data2.color
const data4 = JSON.stringify(data2, null, 4)
const label = data2.event_step?.charAt(0).toUpperCase() + data2.event_step?.slice(1)
const lable1 = data2.event.split('_').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
setCollapseLabel1(`${lable1}: ${label}`)
const label1 = data2.event.split('_').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
setCollapseLabel1(`${label1}: ${label}`)
setChatCompletionCall(data4)
}
setChatCompletionResult(JSON.stringify(item, null, 4))
Expand Down Expand Up @@ -1361,7 +1361,7 @@ function Playground() {
<Button key="cancel" onClick={handleCloseModal} className={`cancel-button ${styles.cancelButton}`}>
{t('cancel')}
</Button>
<Button key="submit" onClick={handleCreateConfrim} className='next-button'>
<Button key="submit" onClick={handleCreateConfirm} className='next-button'>
{t('confirm')}
</Button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/plugins/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ function Plugins() {
setFormDisabled(false)

}
const handleClickBundle = async (bundleId: string, bundelName: string, item: any) => {
const handleClickBundle = async (bundleId: string, bundleName: string, item: any) => {
setBundleId(bundleId)
setBundleName(bundelName)
setBundleName(bundleName)
setBundleDesc(item.description)
setPluginListData(item.plugins)
setPluginId(item.plugins[0].plugin_id)
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/contents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function CommonComponents() {
text_embedding: <TextEmbeddingIcon />,
wildcard: <WildCardIcon />
}
const revereseLabel: Record<string, any> = {
const reverseLabel: Record<string, any> = {
naive: 'Naive',
zero: 'Zero',
[`message_window`]: 'Message Window',
Expand Down Expand Up @@ -99,8 +99,8 @@ function CommonComponents() {
dataIndex: 'properties',
key: 'properties',
width: 360,
render: (proerties: object) => (
<ModelIcon properties={proerties} />
render: (properties: object) => (
<ModelIcon properties={properties} />
),
},
{
Expand Down Expand Up @@ -409,7 +409,7 @@ function CommonComponents() {
width: 180,
dataIndex: 'memory',
render: (_: any) => (
<div>{revereseLabel[_]}</div>
<div>{reverseLabel[_]}</div>

)
},
Expand Down
Loading

0 comments on commit 1d56646

Please sign in to comment.