feat: add project-scoped work assistant results
This commit is contained in:
@@ -81,7 +81,9 @@ export const mergeKnowledgeSnippets = (...groups: RawKnowledgeSnippet[][]): Know
|
||||
export const searchKnowledge = async (
|
||||
queryText: string,
|
||||
position = getSelectedPosition(),
|
||||
conversation?: KnowledgeConversationState
|
||||
conversation?: KnowledgeConversationState,
|
||||
projectCode?: string,
|
||||
source: 'mobile_uni_sop' | 'mobile_uni_voice' = 'mobile_uni_sop'
|
||||
) => {
|
||||
const response = await apiRequest<UnifiedKnowledgeResponse>({
|
||||
url: '/api/knowledge/query',
|
||||
@@ -90,9 +92,11 @@ export const searchKnowledge = async (
|
||||
queryText,
|
||||
category: 'sop',
|
||||
position,
|
||||
source,
|
||||
limit: 5,
|
||||
conversationId: conversation?.conversationId,
|
||||
contextVersion: conversation?.contextVersion
|
||||
contextVersion: conversation?.contextVersion,
|
||||
projectCode
|
||||
},
|
||||
timeout: 30000
|
||||
});
|
||||
@@ -104,7 +108,8 @@ export const searchKnowledgeWithMedia = (
|
||||
queryText: string,
|
||||
position = getSelectedPosition(),
|
||||
onUploadTask?: (task: ReturnType<typeof uni.uploadFile> | null) => void,
|
||||
conversation?: KnowledgeConversationState
|
||||
conversation?: KnowledgeConversationState,
|
||||
projectCode?: string
|
||||
) => new Promise<KnowledgeSearchResponse>((resolve, reject) => {
|
||||
const task = uni.uploadFile({
|
||||
url: apiUrl('/api/knowledge/query-media'),
|
||||
@@ -117,7 +122,8 @@ export const searchKnowledgeWithMedia = (
|
||||
...(conversation ? {
|
||||
conversationId: conversation.conversationId,
|
||||
contextVersion: String(conversation.contextVersion)
|
||||
} : {})
|
||||
} : {}),
|
||||
...(projectCode ? { projectCode } : {})
|
||||
},
|
||||
timeout: 360000,
|
||||
success: (response) => {
|
||||
@@ -137,7 +143,8 @@ export const searchKnowledgeWithMedia = (
|
||||
export const queryKnowledgeTool = async (
|
||||
toolCode: 'MY_PRACTICE_SUMMARY' | 'TEAM_PRACTICE_SUMMARY',
|
||||
queryText: string,
|
||||
conversation?: KnowledgeConversationState
|
||||
conversation?: KnowledgeConversationState,
|
||||
projectCode?: string
|
||||
) => {
|
||||
const response = await apiRequest<UnifiedKnowledgeResponse>({
|
||||
url: '/api/knowledge/query',
|
||||
@@ -148,7 +155,8 @@ export const queryKnowledgeTool = async (
|
||||
limit: 5,
|
||||
toolCode,
|
||||
conversationId: conversation?.conversationId,
|
||||
contextVersion: conversation?.contextVersion
|
||||
contextVersion: conversation?.contextVersion,
|
||||
projectCode
|
||||
},
|
||||
timeout: 30000
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user