Skip to content

Commit

Permalink
Fix typos, update settings, and rename file
Browse files Browse the repository at this point in the history
- Correct typos in variable names in `app/actions.tsx` and `lib/agents/researcher.tsx`.
- Add custom words to spell checker in `.vscode/settings.json`.
- Rename `history-skelton.tsx` to `history-skeleton.tsx`.
- Fix project name typo in `package.json`.
  • Loading branch information
TechNickAI committed Jul 29, 2024
1 parent 219786d commit 0ec894b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
"cSpell.words": [
"openai",
"Tavily"
]
}
13 changes: 6 additions & 7 deletions app/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { VideoSearchSection } from '@/components/video-search-section'
import { transformToolMessages } from '@/lib/utils'
import { AnswerSection } from '@/components/answer-section'
import { ErrorCard } from '@/components/error-card'
import { use } from 'react'

async function submit(
formData?: FormData,
Expand Down Expand Up @@ -53,8 +52,8 @@ async function submit(
return { role, content } as CoreMessage
})

// goupeiId is used to group the messages for collapse
const groupeId = generateId()
// groupId is used to group the messages for collapse
const groupId = generateId()

const useSpecificAPI = process.env.USE_SPECIFIC_API_FOR_WRITER === 'true'
const useOllamaProvider = !!(
Expand Down Expand Up @@ -173,7 +172,7 @@ async function submit(
messages: [
...aiState.get().messages,
{
id: groupeId,
id: groupId,
role: 'tool',
content: JSON.stringify(output.result),
name: output.toolName,
Expand Down Expand Up @@ -219,7 +218,7 @@ async function submit(
messages: [
...aiState.get().messages,
{
id: groupeId,
id: groupId,
role: 'assistant',
content: answer,
type: 'answer'
Expand All @@ -241,13 +240,13 @@ async function submit(
messages: [
...aiState.get().messages,
{
id: groupeId,
id: groupId,
role: 'assistant',
content: JSON.stringify(relatedQueries),
type: 'related'
},
{
id: groupeId,
id: groupId,
role: 'assistant',
content: 'followup',
type: 'followup'
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion components/history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ChevronLeft, Menu } from 'lucide-react'
import { cn } from '@/lib/utils'
import { History as HistoryIcon } from 'lucide-react'
import { Suspense } from 'react'
import { HistorySkeleton } from './history-skelton'
import { HistorySkeleton } from './history-skeleton'
import { useAppState } from '@/lib/utils/app-state'

type HistoryProps = {
Expand Down
8 changes: 4 additions & 4 deletions lib/agents/researcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export async function researcher(
const includeToolResponses = messages.some(message => message.role === 'tool')
const useSubModel = useOllamaProvider && includeToolResponses

const streambleAnswer = createStreamableValue<string>('')
const answerSection = <AnswerSection result={streambleAnswer.value} />
const streamableAnswer = createStreamableValue<string>('')
const answerSection = <AnswerSection result={streamableAnswer.value} />

const currentDate = new Date().toLocaleString()
const result = await streamText({
Expand All @@ -51,7 +51,7 @@ export async function researcher(
onFinish: async event => {
finishReason = event.finishReason
fullResponse = event.text
streambleAnswer.done()
streamableAnswer.done()
}
}).catch(err => {
hasError = true
Expand Down Expand Up @@ -80,7 +80,7 @@ export async function researcher(
if (useAnthropicProvider && !hasToolResult) {
streamableText.update(fullResponse)
} else {
streambleAnswer.update(fullResponse)
streamableAnswer.update(fullResponse)
}
}
break
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mophic",
"name": "morphic",
"version": "0.1.0",
"private": true,
"license": "Apache-2.0",
Expand Down Expand Up @@ -60,4 +60,4 @@
"eslint": "^8",
"eslint-config-next": "^14.2.3"
}
}
}

0 comments on commit 0ec894b

Please sign in to comment.