mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-25 09:26:38 +08:00
just add
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { type NextRequest } from 'next/server'
|
||||
import { ChatClient } from 'dify-client'
|
||||
import { ChatClient, DifyClient } from 'dify-client'
|
||||
import { v4 } from 'uuid'
|
||||
import { API_KEY, API_URL, APP_ID } from '@/config'
|
||||
|
||||
@ -19,3 +19,4 @@ export const setSession = (sessionId: string) => {
|
||||
}
|
||||
|
||||
export const client = new ChatClient(API_KEY, API_URL || undefined)
|
||||
export const commonClient = new ChatClient(API_KEY, API_URL || undefined)
|
||||
|
||||
@ -19,6 +19,7 @@ import Loading from '@/app/components/base/loading'
|
||||
import { replaceVarWithValues, userInputsFormToPromptVariables } from '@/utils/prompt'
|
||||
import AppUnavailable from '@/app/components/app-unavailable'
|
||||
import { API_KEY, APP_ID, APP_INFO, isShowPrompt, promptTemplate } from '@/config'
|
||||
import { checkOrSetAccessToken } from '@/utils/access-token'
|
||||
|
||||
const Main: FC = () => {
|
||||
const { t } = useTranslation()
|
||||
@ -197,6 +198,8 @@ const Main: FC = () => {
|
||||
return
|
||||
}
|
||||
(async () => {
|
||||
await checkOrSetAccessToken()
|
||||
|
||||
try {
|
||||
const [conversationData, appParams] = await Promise.all([fetchConversations(), fetchAppParams()])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user