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
|
runs-on: ubuntu-latest
|
||||||
arch-suffix: amd64
|
arch-suffix: amd64
|
||||||
- platform: linux/arm64
|
- platform: linux/arm64
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04-arm
|
||||||
arch-suffix: arm64
|
arch-suffix: arm64
|
||||||
|
|
||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
|
@ -117,4 +117,4 @@ jobs:
|
||||||
phact/openrag-opensearch:$VERSION-arm64
|
phact/openrag-opensearch:$VERSION-arm64
|
||||||
docker buildx imagetools create -t phact/openrag-opensearch:latest \
|
docker buildx imagetools create -t phact/openrag-opensearch:latest \
|
||||||
phact/openrag-opensearch:$VERSION-amd64 \
|
phact/openrag-opensearch:$VERSION-amd64 \
|
||||||
phact/openrag-opensearch:$VERSION-arm64
|
phact/openrag-opensearch:$VERSION-arm64
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ interface RequestBody {
|
||||||
function ChatPage() {
|
function ChatPage() {
|
||||||
const isDebugMode = process.env.NODE_ENV === 'development' || process.env.NEXT_PUBLIC_OPENRAG_DEBUG === 'true'
|
const isDebugMode = process.env.NODE_ENV === 'development' || process.env.NEXT_PUBLIC_OPENRAG_DEBUG === 'true'
|
||||||
const { user } = useAuth()
|
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[]>([
|
const [messages, setMessages] = useState<Message[]>([
|
||||||
{
|
{
|
||||||
role: "assistant",
|
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
|
// Listen for file upload events from navigation
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -508,7 +508,7 @@ function ChatPage() {
|
||||||
window.removeEventListener('fileUploadComplete', handleFileUploadComplete as EventListener)
|
window.removeEventListener('fileUploadComplete', handleFileUploadComplete as EventListener)
|
||||||
window.removeEventListener('fileUploadError', handleFileUploadError as EventListener)
|
window.removeEventListener('fileUploadError', handleFileUploadError as EventListener)
|
||||||
}
|
}
|
||||||
}, [endpoint])
|
}, [endpoint, setPreviousResponseIds])
|
||||||
|
|
||||||
// Handle click outside to close dropdown
|
// Handle click outside to close dropdown
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import React, { createContext, useContext, useState, useEffect, ReactNode } from 'react'
|
import React, { createContext, useContext, useState, useEffect, useCallback, ReactNode } from 'react'
|
||||||
|
|
||||||
interface User {
|
interface User {
|
||||||
user_id: string
|
user_id: string
|
||||||
|
|
@ -40,7 +40,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
const [isNoAuthMode, setIsNoAuthMode] = useState(false)
|
const [isNoAuthMode, setIsNoAuthMode] = useState(false)
|
||||||
|
|
||||||
const checkAuth = async () => {
|
const checkAuth = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/auth/me')
|
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...')
|
console.log('Backend not ready, retrying in 2 seconds...')
|
||||||
setTimeout(checkAuth, 2000)
|
setTimeout(checkAuth, 2000)
|
||||||
}
|
}
|
||||||
}
|
}, [])
|
||||||
|
|
||||||
const login = () => {
|
const login = () => {
|
||||||
// Don't allow login in no-auth mode
|
// Don't allow login in no-auth mode
|
||||||
|
|
@ -157,7 +157,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
checkAuth()
|
checkAuth()
|
||||||
}, [])
|
}, [checkAuth])
|
||||||
|
|
||||||
const value: AuthContextType = {
|
const value: AuthContextType = {
|
||||||
user,
|
user,
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ interface ConversationData {
|
||||||
messages: ConversationMessage[]
|
messages: ConversationMessage[]
|
||||||
endpoint: EndpointType
|
endpoint: EndpointType
|
||||||
response_id: string
|
response_id: string
|
||||||
|
title: string
|
||||||
[key: string]: unknown
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,7 +33,7 @@ interface ChatContextType {
|
||||||
chat: string | null
|
chat: string | null
|
||||||
langflow: 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
|
refreshConversations: () => void
|
||||||
refreshTrigger: number
|
refreshTrigger: number
|
||||||
loadConversation: (conversation: ConversationData) => void
|
loadConversation: (conversation: ConversationData) => void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue