mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Feature/OpenAI Assistant V2 (#2258)
* add gpt4 turbo to assistant * OpenAI Assistant V2 * update langfuse handler
This commit is contained in:
@@ -420,6 +420,11 @@ export class AnalyticHandler {
|
||||
}
|
||||
|
||||
if (langfuseTraceClient) {
|
||||
langfuseTraceClient.update({
|
||||
input: {
|
||||
text: input
|
||||
}
|
||||
})
|
||||
const span = langfuseTraceClient.span({
|
||||
name,
|
||||
input: {
|
||||
@@ -472,6 +477,14 @@ export class AnalyticHandler {
|
||||
span.end({
|
||||
output
|
||||
})
|
||||
const langfuseTraceClient = this.handlers['langFuse'].trace[returnIds['langFuse'].trace]
|
||||
if (langfuseTraceClient) {
|
||||
langfuseTraceClient.update({
|
||||
output: {
|
||||
output
|
||||
}
|
||||
})
|
||||
}
|
||||
if (shutdown) {
|
||||
const langfuse: Langfuse = this.handlers['langFuse'].client
|
||||
await langfuse.shutdownAsync()
|
||||
@@ -513,6 +526,14 @@ export class AnalyticHandler {
|
||||
error
|
||||
}
|
||||
})
|
||||
const langfuseTraceClient = this.handlers['langFuse'].trace[returnIds['langFuse'].trace]
|
||||
if (langfuseTraceClient) {
|
||||
langfuseTraceClient.update({
|
||||
output: {
|
||||
error
|
||||
}
|
||||
})
|
||||
}
|
||||
if (shutdown) {
|
||||
const langfuse: Langfuse = this.handlers['langFuse'].client
|
||||
await langfuse.shutdownAsync()
|
||||
|
||||
@@ -14,10 +14,10 @@ export const addBase64FilesToStorage = async (file: string, chatflowid: string,
|
||||
const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
|
||||
const mime = splitDataURI[0].split(':')[1].split(';')[0]
|
||||
|
||||
const key = chatflowid + '/' + filename
|
||||
const Key = chatflowid + '/' + filename
|
||||
const putObjCmd = new PutObjectCommand({
|
||||
Bucket,
|
||||
Key: key,
|
||||
Key,
|
||||
ContentEncoding: 'base64', // required for binary data
|
||||
ContentType: mime,
|
||||
Body: bf
|
||||
@@ -61,6 +61,7 @@ export const addFileToStorage = async (mime: string, bf: Buffer, fileName: strin
|
||||
Body: bf
|
||||
})
|
||||
await s3Client.send(putObjCmd)
|
||||
return 'FILE-STORAGE::' + fileName
|
||||
} else {
|
||||
const dir = path.join(getStoragePath(), ...paths)
|
||||
if (!fs.existsSync(dir)) {
|
||||
@@ -69,6 +70,7 @@ export const addFileToStorage = async (mime: string, bf: Buffer, fileName: strin
|
||||
|
||||
const filePath = path.join(dir, fileName)
|
||||
fs.writeFileSync(filePath, bf)
|
||||
return 'FILE-STORAGE::' + fileName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user