mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-06-30 00:45:10 +08:00
feat(app/log): Add Referenced Content in Application Logs (#7082)
This commit is contained in:
parent
d338f69837
commit
2c188a45c8
@ -126,6 +126,7 @@ const getFormattedChatList = (messages: ChatMessage[], conversationId: string, t
|
|||||||
tokens: item.answer_tokens + item.message_tokens,
|
tokens: item.answer_tokens + item.message_tokens,
|
||||||
latency: item.provider_response_latency.toFixed(2),
|
latency: item.provider_response_latency.toFixed(2),
|
||||||
},
|
},
|
||||||
|
citation: item.metadata?.retriever_resources,
|
||||||
annotation: (() => {
|
annotation: (() => {
|
||||||
if (item.annotation_hit_history) {
|
if (item.annotation_hit_history) {
|
||||||
return {
|
return {
|
||||||
|
@ -13,8 +13,14 @@ export type Feedbacktype = {
|
|||||||
content?: string | null
|
content?: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FeedbackFunc = (messageId: string, feedback: Feedbacktype) => Promise<any>
|
export type FeedbackFunc = (
|
||||||
export type SubmitAnnotationFunc = (messageId: string, content: string) => Promise<any>
|
messageId: string,
|
||||||
|
feedback: Feedbacktype
|
||||||
|
) => Promise<any>
|
||||||
|
export type SubmitAnnotationFunc = (
|
||||||
|
messageId: string,
|
||||||
|
content: string
|
||||||
|
) => Promise<any>
|
||||||
|
|
||||||
export type DisplayScene = 'web' | 'console'
|
export type DisplayScene = 'web' | 'console'
|
||||||
|
|
||||||
@ -91,20 +97,22 @@ export type IChatItem = {
|
|||||||
input?: any
|
input?: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MessageEnd = {
|
export type Metadata = {
|
||||||
id: string
|
retriever_resources?: CitationItem[]
|
||||||
metadata: {
|
annotation_reply: {
|
||||||
retriever_resources?: CitationItem[]
|
id: string
|
||||||
annotation_reply: {
|
account: {
|
||||||
id: string
|
id: string
|
||||||
account: {
|
name: string
|
||||||
id: string
|
|
||||||
name: string
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type MessageEnd = {
|
||||||
|
id: string
|
||||||
|
metadata: Metadata
|
||||||
|
}
|
||||||
|
|
||||||
export type MessageReplace = {
|
export type MessageReplace = {
|
||||||
id: string
|
id: string
|
||||||
task_id: string
|
task_id: string
|
||||||
|
@ -4,6 +4,7 @@ import type {
|
|||||||
Edge,
|
Edge,
|
||||||
Node,
|
Node,
|
||||||
} from '@/app/components/workflow/types'
|
} from '@/app/components/workflow/types'
|
||||||
|
import type { Metadata } from '@/app/components/base/chat/chat/type'
|
||||||
|
|
||||||
// Log type contains key:string conversation_id:string created_at:string quesiton:string answer:string
|
// Log type contains key:string conversation_id:string created_at:string quesiton:string answer:string
|
||||||
export type Conversation = {
|
export type Conversation = {
|
||||||
@ -102,6 +103,7 @@ export type MessageContent = {
|
|||||||
from_end_user_id?: string
|
from_end_user_id?: string
|
||||||
}>
|
}>
|
||||||
message_files: VisionFile[]
|
message_files: VisionFile[]
|
||||||
|
metadata: Metadata
|
||||||
agent_thoughts: any[] // TODO
|
agent_thoughts: any[] // TODO
|
||||||
workflow_run_id: string
|
workflow_run_id: string
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user