Skip to content

Commit d9b4269

Browse files
authored
Merge pull request #410 from truefoundry/fix/multimodal-controller
fix: multi modal parser and set qa max upload size to 200MB
2 parents f2f18a6 + a0b8da4 commit d9b4269

File tree

4 files changed

+34
-31
lines changed

4 files changed

+34
-31
lines changed

backend/modules/query_controllers/multimodal/controller.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MultiModalRAGQueryController(BaseQueryController):
3030
async def _stream_vlm_answer(self, llm, message_payload, docs):
3131
try:
3232
async with async_timeout.timeout(GENERATION_TIMEOUT_SEC):
33-
yield Docs(content=self._cleanup_metadata(docs))
33+
yield Docs(content=self._enrich_context_for_stream_response(docs))
3434
async for chunk in llm.astream(message_payload):
3535
yield Answer(content=chunk.content)
3636
except asyncio.TimeoutError:

frontend/src/screens/dashboard/docsqa/main/components/ConfigSelector.tsx

+28-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
import { MenuItem, Select } from '@mui/material'
3+
import { FormControl, MenuItem, Select } from '@mui/material'
44

55
interface ConfigProps {
66
title: string
@@ -25,31 +25,33 @@ const ConfigSelector = (props: ConfigProps) => {
2525
return (
2626
<div className={`flex justify-between items-center ${className}`}>
2727
<div className="text-sm">{title}:</div>
28-
<Select
29-
value={initialValue}
30-
onChange={(e) => handleOnChange(e)}
31-
placeholder={placeholder + '...'}
32-
sx={{
33-
background: 'white',
34-
height: '2rem',
35-
width: '13.1875rem',
36-
border: '1px solid #CEE0F8 !important',
37-
outline: 'none !important',
38-
'& fieldset': {
39-
border: 'none !important',
40-
},
41-
}}
42-
>
43-
{data?.map((item: any) =>
44-
renderItem ? (
45-
renderItem(item)
46-
) : (
47-
<MenuItem value={item} key={item}>
48-
{item}
49-
</MenuItem>
50-
),
51-
)}
52-
</Select>
28+
<FormControl>
29+
<Select
30+
value={initialValue}
31+
onChange={(e) => handleOnChange(e)}
32+
label={placeholder + '...'}
33+
sx={{
34+
background: 'white',
35+
height: '2rem',
36+
width: '13.1875rem',
37+
border: '1px solid #CEE0F8 !important',
38+
outline: 'none !important',
39+
'& fieldset': {
40+
border: 'none !important',
41+
},
42+
}}
43+
>
44+
{data?.map((item: any) =>
45+
renderItem ? (
46+
renderItem(item)
47+
) : (
48+
<MenuItem value={item} key={item}>
49+
{item}
50+
</MenuItem>
51+
),
52+
)}
53+
</Select>
54+
</FormControl>
5355
</div>
5456
)
5557
}

frontend/src/screens/dashboard/docsqa/main/components/ConfigSidebar.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,20 @@ const Left = (props: any) => {
8888
{allRetrieverOptions && selectedRetriever?.key && (
8989
<ConfigSelector
9090
title="Retriever"
91-
placeholder="Select Retriever..."
92-
initialValue={selectedRetriever?.summary}
91+
placeholder="Select Retriever"
92+
initialValue={selectedRetriever?.key}
9393
data={allRetrieverOptions}
9494
className="mt-4"
9595
handleOnChange={(e) => {
96+
console.log(allRetrieverOptions.map((retriever) => retriever.key))
9697
const retriever = allRetrieverOptions.find(
9798
(retriever) => retriever.key === e.target.value,
9899
)
99100
setSelectedRetriever(retriever)
100101
setPromptTemplate(retriever?.promptTemplate)
101102
}}
102103
renderItem={(item) => (
103-
<MenuItem key={item.key} value={item.summary}>
104+
<MenuItem key={item.key} value={item.key}>
104105
{item.summary}
105106
</MenuItem>
106107
)}

frontend/src/stores/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export const IS_DOCS_QA_REDIRECT_ENABLED =
33
export const DOCS_QA_STANDALONE_PATH = import.meta.env
44
.VITE_DOCS_QA_STANDALONE_PATH
55
export const DOCS_QA_MAX_UPLOAD_SIZE_MB = parseInt(
6-
import.meta.env.VITE_DOCS_QA_MAX_UPLOAD_SIZE_MB || '2'
6+
import.meta.env.VITE_DOCS_QA_MAX_UPLOAD_SIZE_MB || '200'
77
)
88
export const IS_LOCAL_DEVELOPMENT = import.meta.env.VITE_USE_LOCAL === 'true'
99
export const GTAG_ID = import.meta.env.VITE_GTAG_ID

0 commit comments

Comments
 (0)