mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
Renamed to chat instead of aichat
This commit is contained in:
@@ -5,10 +5,10 @@ import { MessageCircle, Send, X } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
||||
import { useAIChatStore } from '@/stores/chat/store'
|
||||
import { useChatStore } from '@/stores/chat/store'
|
||||
|
||||
export function Chat() {
|
||||
const { messages, isProcessing, error, sendMessage } = useAIChatStore()
|
||||
const { messages, isProcessing, error, sendMessage } = useChatStore()
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
const [message, setMessage] = useState('')
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import { create } from 'zustand'
|
||||
import { devtools } from 'zustand/middleware'
|
||||
import { useWorkflowStore } from '../workflow/store'
|
||||
import { useEnvironmentStore } from '../environment/store'
|
||||
import { AIChatStore, ChatMessage } from './types'
|
||||
import { ChatStore, ChatMessage } from './types'
|
||||
import { getNextBlockNumber } from './utils'
|
||||
|
||||
export const useAIChatStore = create<AIChatStore>()(
|
||||
export const useChatStore = create<ChatStore>()(
|
||||
devtools(
|
||||
(set, get) => ({
|
||||
messages: [],
|
||||
|
||||
@@ -5,16 +5,16 @@ export interface ChatMessage {
|
||||
timestamp: number
|
||||
}
|
||||
|
||||
export interface AIChatState {
|
||||
export interface ChatState {
|
||||
messages: ChatMessage[]
|
||||
isProcessing: boolean
|
||||
error: string | null
|
||||
}
|
||||
|
||||
export interface AIChatActions {
|
||||
export interface ChatActions {
|
||||
sendMessage: (content: string) => Promise<void>
|
||||
clearChat: () => void
|
||||
setError: (error: string | null) => void
|
||||
}
|
||||
|
||||
export type AIChatStore = AIChatState & AIChatActions
|
||||
export type ChatStore = ChatState & ChatActions
|
||||
Reference in New Issue
Block a user