mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Skip somethings for chats idk
This commit is contained in:
3 files changed
+44
-22
No files matched your search
@@ -14,6 +14,7 @@ interface UseAIChatSessionOptions {
|
||||
onUpdateMetadata?: (title: string, description: string) => void;
|
||||
onAIError?: (error: Error) => void;
|
||||
workingDir?: string; // Optional working directory (for chats)
|
||||
isChat?: boolean; // Whether this is a chat session (vs a project session)
|
||||
}
|
||||
|
||||
interface StreamingMessage {
|
||||
@@ -34,7 +35,8 @@ export function useAIChat({
|
||||
maxSteps = 50,
|
||||
onUpdateMetadata,
|
||||
onAIError,
|
||||
workingDir
|
||||
workingDir,
|
||||
isChat
|
||||
}: UseAIChatSessionOptions) {
|
||||
const sessionManager = useSessionManager();
|
||||
const { isConfigured } = useAISettings();
|
||||
@@ -48,14 +50,14 @@ export function useAIChat({
|
||||
|
||||
const initSession = useCallback(async () => {
|
||||
// Load or update session
|
||||
const session = await sessionManager.loadSession(projectId, tools, customTools, maxSteps, workingDir);
|
||||
const session = await sessionManager.loadSession(projectId, tools, customTools, maxSteps, workingDir, isChat);
|
||||
// Initialize individual state variables from existing session
|
||||
setMessages([...session.messages]);
|
||||
setStreamingMessage(session.streamingMessage ? { ...session.streamingMessage } : undefined);
|
||||
setIsLoading(session.isLoading);
|
||||
setTotalCost(session.totalCost || 0);
|
||||
setLastInputTokens(session.lastInputTokens || 0);
|
||||
}, [sessionManager, projectId, tools, customTools, maxSteps, workingDir]);
|
||||
}, [sessionManager, projectId, tools, customTools, maxSteps, workingDir, isChat]);
|
||||
|
||||
// Initialize session
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user