Merge branch 'main' of github.com:phact/gendb
This commit is contained in:
commit
e810aef588
4 changed files with 11 additions and 10 deletions
4
.github/workflows/build-multiarch.yml
vendored
4
.github/workflows/build-multiarch.yml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
arch-suffix: amd64
|
||||
- platform: linux/arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
runs-on: ubuntu-24.04-arm
|
||||
arch-suffix: arm64
|
||||
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
|
|
@ -117,4 +117,4 @@ jobs:
|
|||
phact/openrag-opensearch:$VERSION-arm64
|
||||
docker buildx imagetools create -t phact/openrag-opensearch:latest \
|
||||
phact/openrag-opensearch:$VERSION-amd64 \
|
||||
phact/openrag-opensearch:$VERSION-arm64
|
||||
phact/openrag-opensearch:$VERSION-arm64
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ interface RequestBody {
|
|||
function ChatPage() {
|
||||
const isDebugMode = process.env.NODE_ENV === 'development' || process.env.NEXT_PUBLIC_OPENRAG_DEBUG === 'true'
|
||||
const { user } = useAuth()
|
||||
const { endpoint, setEndpoint, currentConversationId, conversationData, setCurrentConversationId, addConversationDoc, forkFromResponse, refreshConversations, previousResponseIds, setPreviousResponseIds, setPlaceholderConversation } = useChat()
|
||||
const { endpoint, setEndpoint, currentConversationId, conversationData, setCurrentConversationId, addConversationDoc, forkFromResponse, refreshConversations, previousResponseIds, setPreviousResponseIds } = useChat()
|
||||
const [messages, setMessages] = useState<Message[]>([
|
||||
{
|
||||
role: "assistant",
|
||||
|
|
@ -436,7 +436,7 @@ function ChatPage() {
|
|||
}
|
||||
])
|
||||
}
|
||||
}, [conversationData, currentConversationId, isUserInteracting, isForkingInProgress, lastForkTimestamp])
|
||||
}, [conversationData, currentConversationId, isUserInteracting, isForkingInProgress, lastForkTimestamp, setPreviousResponseIds])
|
||||
|
||||
// Listen for file upload events from navigation
|
||||
useEffect(() => {
|
||||
|
|
@ -508,7 +508,7 @@ function ChatPage() {
|
|||
window.removeEventListener('fileUploadComplete', handleFileUploadComplete as EventListener)
|
||||
window.removeEventListener('fileUploadError', handleFileUploadError as EventListener)
|
||||
}
|
||||
}, [endpoint])
|
||||
}, [endpoint, setPreviousResponseIds])
|
||||
|
||||
// Handle click outside to close dropdown
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use client"
|
||||
|
||||
import React, { createContext, useContext, useState, useEffect, ReactNode } from 'react'
|
||||
import React, { createContext, useContext, useState, useEffect, useCallback, ReactNode } from 'react'
|
||||
|
||||
interface User {
|
||||
user_id: string
|
||||
|
|
@ -40,7 +40,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
|||
const [isLoading, setIsLoading] = useState(true)
|
||||
const [isNoAuthMode, setIsNoAuthMode] = useState(false)
|
||||
|
||||
const checkAuth = async () => {
|
||||
const checkAuth = useCallback(async () => {
|
||||
try {
|
||||
const response = await fetch('/api/auth/me')
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
|||
console.log('Backend not ready, retrying in 2 seconds...')
|
||||
setTimeout(checkAuth, 2000)
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
const login = () => {
|
||||
// Don't allow login in no-auth mode
|
||||
|
|
@ -157,7 +157,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
|||
|
||||
useEffect(() => {
|
||||
checkAuth()
|
||||
}, [])
|
||||
}, [checkAuth])
|
||||
|
||||
const value: AuthContextType = {
|
||||
user,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ interface ConversationData {
|
|||
messages: ConversationMessage[]
|
||||
endpoint: EndpointType
|
||||
response_id: string
|
||||
title: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ interface ChatContextType {
|
|||
chat: string | null
|
||||
langflow: string | null
|
||||
}
|
||||
setPreviousResponseIds: (ids: { chat: string | null; langflow: string | null }) => void
|
||||
setPreviousResponseIds: (ids: { chat: string | null; langflow: string | null } | ((prev: { chat: string | null; langflow: string | null }) => { chat: string | null; langflow: string | null })) => void
|
||||
refreshConversations: () => void
|
||||
refreshTrigger: number
|
||||
loadConversation: (conversation: ConversationData) => void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue