Skip to content

Commit

Permalink
Merge branch 'refactor/ui-types'
Browse files Browse the repository at this point in the history
  • Loading branch information
okradze committed Nov 7, 2023
2 parents 9530572 + 0041f40 commit 5f01b66
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 80 deletions.
2 changes: 0 additions & 2 deletions apps/ui/src/modals/RunLogsModal/RunLogs/RunLogs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import styled from 'styled-components'
import Typography from '@l3-lib/ui-core/dist/Typography'
import TypographyPrimary from 'components/Typography/Primary'
import { useTranslation } from 'react-i18next'
import { useRunLogsService } from 'services/run'
import Loader from '@l3-lib/ui-core/dist/Loader'
Expand Down
37 changes: 0 additions & 37 deletions apps/ui/src/modals/SpotlightModal/SpotlightModal.tsx

This file was deleted.

1 change: 0 additions & 1 deletion apps/ui/src/modals/SpotlightModal/index.ts

This file was deleted.

27 changes: 0 additions & 27 deletions apps/ui/src/modals/SpotlightModal/spotlightStyle.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import TagsRow from './TagsRow'

import IconButton from '@l3-lib/ui-core/dist/IconButton'
import Button from '@l3-lib/ui-core/dist/Button'
import Edit from '@l3-lib/ui-core/dist/icons/Edit'

import Download from '@l3-lib/ui-core/dist/icons/Download'

import { useLocation, useNavigate, useParams } from 'react-router-dom'
import { useLocation, useNavigate } from 'react-router-dom'
import { useModal } from 'hooks'
import { AuthContext } from 'contexts'
import { StyledEditIcon } from 'pages/TeamOfAgents/TeamOfAgentsCard/TeamOfAgentsCard'
Expand All @@ -26,9 +25,10 @@ import MenuDots from '@l3-lib/ui-core/dist/icons/MenuDots'
import { useAgents } from 'pages/Agents/useAgents'
import { useGetAccountModule } from 'utils/useGetAccountModule'
import { useModelsService } from 'services'
import { AgentWithConfigs } from 'types'

type AgentViewDetailBoxProps = {
agentData: any
agentData: AgentWithConfigs
}

const AgentVIewDetailBox = ({ agentData }: AgentViewDetailBoxProps) => {
Expand Down Expand Up @@ -56,9 +56,7 @@ const AgentVIewDetailBox = ({ agentData }: AgentViewDetailBoxProps) => {

const isCreator = user?.id === agent?.created_by

const agentModel = models
?.filter((modelData: any) => modelData.id === model)
.map((model: any) => model.name)
const agentModel = models?.filter(modelData => modelData.id === model).map(model => model.name)

const handleEdit = () => {
closeModal('agent-view-modal')
Expand Down Expand Up @@ -158,7 +156,7 @@ const AgentVIewDetailBox = ({ agentData }: AgentViewDetailBoxProps) => {

{agentModel?.length > 0 && <TagsRow title={t('model')} items={agentModel} />}

{temperature && <TagsRow title={t('temperature')} items={[temperature]} />}
{temperature && <TagsRow title={t('temperature')} items={[temperature.toString()]} />}

<TagsRow title={t('template')} items={[is_template ? 'True' : 'False']} />
</StyledWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const useFineTuningForm = () => {
const { data: models } = useModelsService()

const modelOptions = models
?.filter((model: any) => model.fine_tuning === true)
?.filter(model => model.fine_tuning === true)
?.map(({ id, name, provider }) => ({
value: id,
label: `${name} (${provider})`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ const TeamOfAgentsDetailsBox = ({ teamData }: TeamOfAgentsDetailsBoxProps) => {
const { model, temperature } = configs
const isCreator = user?.id === created_by

const teamModel = models
?.filter((modelData: any) => modelData.id === model)
.map((model: any) => model.name)
const teamModel = models?.filter(modelData => modelData.id === model).map(model => model.name)

const handleEdit = () => {
closeModal('team-of-agent-view-modal')
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/src/services/model/useModelsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { useQuery } from '@apollo/client'
import MODELS_GQL from '../../gql/ai/model/models.gql'
import { Model } from 'types'

type ModelsData = {
type UseModelsServiceData = {
models: Model[]
}

export const useModelsService = () => {
const { data, error, loading, refetch } = useQuery<ModelsData>(MODELS_GQL)
const { data, error, loading, refetch } = useQuery<UseModelsServiceData>(MODELS_GQL)

return {
data: data?.models || [],
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/types/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface AgentWithConfigs {
avatar: string
is_template: boolean
is_memory: boolean
created_by: string
}
configs: {
goals: string[]
Expand Down

0 comments on commit 5f01b66

Please sign in to comment.